Skip to content

Commit 9c25132

Browse files
authored
Add explicit encoding to open calls
1 parent 3997621 commit 9c25132

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ipykernel/debugger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ async def dumpCell(self, message):
351351
code = message['arguments']['code']
352352
file_name = get_file_name(code)
353353

354-
with open(file_name, 'w') as f:
354+
with open(file_name, 'w', encoding='utf-8') as f:
355355
f.write(code)
356356

357357
reply = {
@@ -378,7 +378,7 @@ async def source(self, message):
378378
}
379379
source_path = message["arguments"]["source"]["path"]
380380
if os.path.isfile(source_path):
381-
with open(source_path) as f:
381+
with open(source_path, encoding='utf-8') as f:
382382
reply['success'] = True
383383
reply['body'] = {
384384
'content': f.read()

0 commit comments

Comments
 (0)