Skip to content

Commit 4995bfc

Browse files
committed
add utf-8 encoding to cat
1 parent 87d8179 commit 4995bfc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • implement-shell-tools/cat

‎implement-shell-tools/cat/cat.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def read_file(path):
1717
"""Returns (content, error_message). error_message is None on success"""
1818
try:
19-
with open(path, "r",) as f:
19+
with open(path, "r", encoding="utf-8") as f:
2020
return f.read(), None
2121
except FileNotFoundError:
2222
return None, f"cat: {path}: No such file or directory"

0 commit comments

Comments
 (0)