[New-bugs-announce] [issue32920] Implement PEP 529 for os.getcwdb on Windows

Eryk Sun report at bugs.python.org
Fri Feb 23 01:44:28 EST 2018


New submission from Eryk Sun <eryksun at 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 <report at bugs.python.org>
<https://bugs.python.org/issue32920>
_______________________________________


More information about the New-bugs-announce mailing list