diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-11 23:46:47 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-11 23:46:47 (GMT) |
commit | 0f35e2c0f44b2012e4e32aaccde6fa42756e61f1 (patch) | |
tree | 18a6f8dcfdf211b7b63825b3a09eea5a691b0389 /Lib/tarfile.py | |
parent | 7909b0085a86c6956506ff1892fdc6feac2dbfd1 (diff) | |
download | cpython-0f35e2c0f44b2012e4e32aaccde6fa42756e61f1.zip cpython-0f35e2c0f44b2012e4e32aaccde6fa42756e61f1.tar.gz cpython-0f35e2c0f44b2012e4e32aaccde6fa42756e61f1.tar.bz2 |
Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
Note: file system encoding cannot be None anymore (since r81190, issue #8610).
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 31967dd..4839eb1 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -159,9 +159,10 @@ TOEXEC = 0o001 # execute/search by other #--------------------------------------------------------- # initialization #--------------------------------------------------------- -ENCODING = sys.getfilesystemencoding() -if ENCODING is None: - ENCODING = "ascii" +if os.name in ("nt", "ce"): + ENCODING = "utf-8" +else: + ENCODING = sys.getfilesystemencoding() #--------------------------------------------------------- # Some useful functions |