mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
Note: file system encoding cannot be None anymore (since r81190, issue #8610).
This commit is contained in:
parent
7909b0085a
commit
0f35e2c0f4
3 changed files with 8 additions and 5 deletions
|
@ -185,8 +185,8 @@ The following variables are available on module level:
|
||||||
|
|
||||||
.. data:: ENCODING
|
.. data:: ENCODING
|
||||||
|
|
||||||
The default character encoding i.e. the value from either
|
The default character encoding: ``'utf-8'`` on Windows,
|
||||||
:func:`sys.getfilesystemencoding` or :func:`sys.getdefaultencoding`.
|
:func:`sys.getfilesystemencoding` otherwise.
|
||||||
|
|
||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
|
@ -159,9 +159,10 @@ TOEXEC = 0o001 # execute/search by other
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
# initialization
|
# initialization
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
|
if os.name in ("nt", "ce"):
|
||||||
|
ENCODING = "utf-8"
|
||||||
|
else:
|
||||||
ENCODING = sys.getfilesystemencoding()
|
ENCODING = sys.getfilesystemencoding()
|
||||||
if ENCODING is None:
|
|
||||||
ENCODING = "ascii"
|
|
||||||
|
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
# Some useful functions
|
# Some useful functions
|
||||||
|
|
|
@ -421,6 +421,8 @@ C-API
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
|
||||||
|
|
||||||
- Issue #8966: If a ctypes structure field is an array of c_char, convert its
|
- Issue #8966: If a ctypes structure field is an array of c_char, convert its
|
||||||
value to bytes instead of str (as done for c_char and c_char_p).
|
value to bytes instead of str (as done for c_char and c_char_p).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue