mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Use os.fsencode() to support surrogates
This commit is contained in:
parent
c39211f51e
commit
16004ace5b
2 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ def compress(filename, input, output):
|
|||
write32(output, mtime)
|
||||
output.write(b'\002') # ... slowest compression alg. ...
|
||||
output.write(b'\377') # ... OS (=unknown) ...
|
||||
bfilename = filename.encode(sys.getfilesystemencoding())
|
||||
bfilename = os.fsencode(filename)
|
||||
output.write(bfilename + b'\000') # ... original filename ...
|
||||
|
||||
crcval = zlib.crc32(b'')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue