bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)


The os.getcwdb() function now uses the UTF-8 encoding on Windows,
rather than the ANSI code page: see PEP 529 for the rationale. The
function is no longer deprecated on Windows.

os.getcwd() and os.getcwdb() now detect integer overflow on memory
allocations. On Unix, these functions properly report MemoryError on
memory allocation failure.
(cherry picked from commit 689830ee6243126798a6c519c05aa11ba73db7cd)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 files changed