This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mattip
Recipients mattip, steve.dower, tim.golden, zach.ware
Date 2015-03-10.22:41:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426027309.83.0.475753794617.issue23634@psf.upfronthosting.co.za>
In-reply-to
Content
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 returns with no error.

Would a patch to fix this be welcomed? A test demonstrating the issue is attached. The fix would be to check that the mode requested matches the mode of the argument fd.

Related issues #22259 and #21191 did not consider this case
History
Date User Action Args
2015-03-10 22:41:49mattipsetrecipients: + mattip, tim.golden, zach.ware, steve.dower
2015-03-10 22:41:49mattipsetmessageid: <1426027309.83.0.475753794617.issue23634@psf.upfronthosting.co.za>
2015-03-10 22:41:49mattiplinkissue23634 messages
2015-03-10 22:41:49mattipcreate