| Index: Lib/distutils/file_util.py |
| diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.py |
| index 3a71bfd1ac27c622549e9776cd8f4ab2cc6eed92..ceb16b3cd9403c2c0dcab4b319f6b554917dd390 100644 |
| --- a/Lib/distutils/file_util.py |
| +++ b/Lib/distutils/file_util.py |
| @@ -225,7 +225,7 @@ def write_file(filename, contents): |
| """Create a file with the specified name and write 'contents' (a |
| sequence of strings without line terminators) to it. |
| """ |
| - f = open(filename, "w") |
| + f = open(filename, "w", encoding="utf-8", errors="surrogateescape") |
|
Antoine Pitrou
2010/07/30 13:35:47
Why the hardcoding to utf-8?
haypo
2010/07/30 20:47:04
utf-8 is maybe not needed, only errors.
amaury
2010/07/31 11:33:01
What is this function used for?
merwok
2010/07/31 22:15:40
distutils is feature-frozen, and this is arguably
merwok
2010/08/10 21:40:30
Distutils writes files in UTF-8; it’s undocumented
|
| for line in contents: |
| f.write(line + "\n") |
| f.close() |