Skip to content

Commit 52e1b70

Browse files
committed
Add utf-8 encoding to test_pkg_resources
1 parent 9b081af commit 52e1b70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg_resources/tests/test_pkg_resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ def test_resource_filename_rewrites_on_change(self):
111111
filename = zp.get_resource_filename(manager, 'data.dat')
112112
actual = datetime.datetime.fromtimestamp(os.stat(filename).st_mtime)
113113
assert actual == self.ref_time
114-
f = open(filename, 'w')
114+
f = open(filename, 'w', encoding="utf-8")
115115
f.write('hello, world?')
116116
f.close()
117117
ts = self.ref_time.timestamp()
118118
os.utime(filename, (ts, ts))
119119
filename = zp.get_resource_filename(manager, 'data.dat')
120-
with open(filename) as f:
120+
with open(filename, encoding="utf-8") as f:
121121
assert f.read() == 'hello, world!'
122122
manager.cleanup_resources()
123123

0 commit comments

Comments
 (0)