]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 20 Oct 2018 00:46:25 +0000 (17:46 -0700)
committerGitHub <noreply@github.com>
Sat, 20 Oct 2018 00:46:25 +0000 (17:46 -0700)
commit8f53dcdb246a3acb0e64b742c35b5f785bd19092
treefa4942f093f9734901e5aef2a14ca30190bfbaec
parent3e5bcd12f661bdf363c025b52a3d515829e64ed2
bpo-32890, os: Use errno instead of GetLastError() in execve() and truncate() (GH-5784)

path_error() uses GetLastError() on Windows, but some os functions
are implemented via CRT APIs which report errors via errno.
This may result in raising OSError with invalid error code (such
as zero).

Introduce posix_path_error() function and use it where appropriate.
(cherry picked from commit 834603112e6ca35944dd21105b01fca562dc3241)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Lib/test/test_os.py
Misc/NEWS.d/next/Windows/2018-03-08-20-02-38.bpo-32890.3jzFzY.rst [new file with mode: 0644]
Modules/posixmodule.c