diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 16:59:18 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 16:59:18 (GMT) |
commit | 16004ace5bb9b566b68e9016926e88d78edbbf50 (patch) | |
tree | 4253a76a37e92fb350224e1615ef3ee1277b07b8 /Demo | |
parent | c39211f51e377919952b139c46e295800cbc2a8d (diff) | |
download | cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.zip cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.tar.gz cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.tar.bz2 |
Use os.fsencode() to support surrogates
Diffstat (limited to 'Demo')
-rwxr-xr-x | Demo/zlib/minigzip.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Demo/zlib/minigzip.py b/Demo/zlib/minigzip.py index 52e81b9..b57de73 100755 --- a/Demo/zlib/minigzip.py +++ b/Demo/zlib/minigzip.py @@ -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'') |