Looking at this test test_fdopen_keeps_fd_open_on_errors which fails
on win32
http://buildbot.pypy.org/summary/longrepr?testname=AppTestPosix.%28%29.test_fdopen_keeps_fd_open_on_errors&builder=own-win-x86-32&build=442&mod=module.posix.test.test_posix2
It also fails when run with python -A, on cpython. It even fails in
C when running the code from the MSDN example of fdopen,
https://msdn.microsoft.com/en-us/library/dye30d82.aspx
if you replace the mode flag "r" with "w", windows will happily
repopen a read-only file in write mode.
The MSDN documentation is quiet on the issue of mode conflict
between fd and a call to fdopen, where posix explicitly will return
an error
http://linux.die.net/man/3/fdopen "The mode of the stream (one of
the values "r", "r+", "w", "w+", "a", "a+") must be compatible with
the mode of the file descriptor." I could find any google results
for complaints about win32's reckless behaviour.
Two courses of action are possible:
- fix the test to reflect current cpython and pypy behaviour on
win32
- file a bug with cpython and fix our win32 implementation to pass
the current test
Any thoughts?
Matti