New submission from Eryk Sun <>:

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

    >>> os.getcwd()
    >>> os.getcwdb()

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, 
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 <>
Python-bugs-list mailing list

Reply via email to