New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os: Some functions may report bogus errors on Windows #77071
Comments
Demo: >>> os.execve('', ['a'], {})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [WinError 0] The operation completed successfully: '' The reason is that path_error() used throughout os module always uses GetLastError() on Windows, but some functions are implemented via CRT calls which report errors via errno. It seems that commit 292c835 caused this issue. |
Thanks Alexey Izbyshev! |
Python 2.7 doesn't have the same issue. In os.execve(), posix_error() is used, but it is based on errno, which is correct. (A funny bit is that os.execve('', ['a'], {}) crashes in 2.7, probably because of some checks in CRT). And os.truncate() is not implemented in 2.7 at all. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: