mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Force to "backslashreplace" when UnicodeEncodeError arises when writing file // Issue #2796
This commit is contained in:
2
docs
2
docs
Submodule docs updated: e8b9361615...8d04b2e1f3
@ -63,7 +63,7 @@ def write_file_contents(path, contents):
|
|||||||
with open(path, "w") as fp:
|
with open(path, "w") as fp:
|
||||||
return fp.write(contents)
|
return fp.write(contents)
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
with io.open(path, "w", encoding="latin-1") as fp:
|
with io.open(path, "w", encoding="latin-1", errors="backslashreplace") as fp:
|
||||||
return fp.write(contents)
|
return fp.write(contents)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user