Skip to content

Commit 5c1f75d

Browse files
MAINT: Resolve (#127)
add specific encoding UTF-8 for resolving UnicodeDecodeError at memory_profiler.py
1 parent 4d789da commit 5c1f75d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

memory_profiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ def exec_with_profiler(filename, profiler, backend, passed_args=[]):
12001200
try:
12011201
if _backend == 'tracemalloc' and has_tracemalloc:
12021202
tracemalloc.start()
1203-
with open(filename) as f:
1203+
with open(filename, encoding='utf-8') as f:
12041204
exec(compile(f.read(), filename, 'exec'), ns, ns)
12051205
finally:
12061206
if has_tracemalloc and tracemalloc.is_tracing():

0 commit comments

Comments
 (0)