Commit c3e84053 authored by Edvard Rejthar's avatar Edvard Rejthar

scan failed when well-hidden encoding bug came at the scene

parent 60d80fa0
...@@ -27,5 +27,5 @@ while True: ...@@ -27,5 +27,5 @@ while True:
else: else:
method = "w" method = "w"
files_encountered.add(file) files_encountered.add(file)
with open(file, method) as f: with open(file, method +"b") as f: # without writing as bytes, some pages end up with UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 197: ordinal not in range(128)
f.write(message["text"]) f.write(message["text"].encode("utf-8"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment