New submission from Eryk Sun <eryk...@gmail.com>:

When reviewing issue 32904 I noticed that os.getcwdb still calls the CRT 
_getcwd function. Apparently this was overlooked when implementing PEP 529. For 
example:

    >>> os.getcwd()
    'C:\\Temp\\Lang\\αβγδ'
    >>> os.getcwdb()
    b'C:\\Temp\\Lang\\a\xdf?d'

Not only is the encoding wrong, but because the CRT uses GetFullPathNameA (the 
CRT's implementation of _getcwd is convoluted, IMO), the call fails if the 
current directory exceeds MAX_PATH. Python 3.6+ on Windows 10 otherwise 
supports long paths.

----------
components: Library (Lib), Unicode, Windows
messages: 312620
nosy: eryksun, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, 
zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Implement PEP 529 for os.getcwdb on Windows
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32920>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to