[issue23634] os.fdopen reopening a read-only fd on windows

2021-02-24 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue23634] os.fdopen reopening a read-only fd on windows

2015-03-11 Thread eryksun
eryksun added the comment: I guess you were mainly testing with Python 2. Python 3 on Linux does not raise any error either In Python 3 os.fdopen delegates to io.open, which calls io.FileIO to create the raw file object. This doesn't verify a compatible mode on the file descriptor.

[issue23634] os.fdopen reopening a read-only fd on windows

2015-03-10 Thread mattip
New submission from mattip: If I have a read-only fd, and I try to open it as 'w' with os.fdopen(fd, 'w'), the operation raises on linux but succeeds on windows. Python relies on the underlying clib's fdopen to return an error, which glibc does, but MSVC happily closes the original fd and

[issue23634] os.fdopen reopening a read-only fd on windows

2015-03-10 Thread Martin Panter
Martin Panter added the comment: I guess you were mainly testing with Python 2. Python 3 on Linux does not raise any error either: wrote 3 to a read-only file should raise, opening a ro descriptor for writing