Index: Misc/NEWS =================================================================== --- Misc/NEWS (révision 81870) +++ Misc/NEWS (copie de travail) @@ -412,6 +412,8 @@ Library ------- +- Issue #8784: Default encoding of tarfile module is now 'utf-8' on Windows + - Issue #8897: Fix sunau module, use bytes to write the header. Patch written by Thomas Jollans. Index: Doc/library/tarfile.rst =================================================================== --- Doc/library/tarfile.rst (révision 81870) +++ Doc/library/tarfile.rst (copie de travail) @@ -185,8 +185,8 @@ .. data:: ENCODING - The default character encoding i.e. the value from either - :func:`sys.getfilesystemencoding` or :func:`sys.getdefaultencoding`. + The default character encoding: ``'utf-8'`` on Windows, + :func:`sys.getfilesystemencoding` otherwise. .. seealso:: Index: Lib/tarfile.py =================================================================== --- Lib/tarfile.py (révision 81870) +++ Lib/tarfile.py (copie de travail) @@ -159,9 +159,10 @@ #--------------------------------------------------------- # initialization #--------------------------------------------------------- -ENCODING = sys.getfilesystemencoding() -if ENCODING is None: - ENCODING = "ascii" +if os.name not in ("nt", "ce"): + ENCODING = sys.getfilesystemencoding() +else: + ENCODING = "utf-8" #--------------------------------------------------------- # Some useful functions