fdopen(fd, 'w') whe fd is opened 'r'

What version of CPython did you compare with? This behavior was added/changed in 2.7.8. CPython has the exact same test and it doesn't seem to be skipped on Windows. Comparing directly with C fdopen does not make sense because os.fdopen isn't just a direct call to fdopen (includes verification of mode, fd, etc). http://bugs.python.org/issue21191 On Sat, Feb 21, 2015 at 1:58 PM, Matti Picus <matti.picus@gmail.com> wrote:

I tested with win32 2.7.8 The issue addressed in 21191 was that posix.fdopen was not closing fd on error. On windows there is no posix module so test_posix.py is skipped entirely. While the skipped test was modified in issue 21191 to test mode compatibility, posixmodule.c does not actually compare the input fd mode (perhaps via a call to fstat(fd, stat)? ) to the requested mode, rahter it only verifies that the requested mode itself is a valid mode for a call to fdopen. On windows posix.fdopen is exposed through os.fdopen, which AFAICT is only minimally tested outside of test_posix.py. On 22/02/2015 12:44 AM, Brian Kearns wrote:

What version of CPython did you compare with? This behavior was added/changed in 2.7.8. CPython has the exact same test and it doesn't seem to be skipped on Windows. Comparing directly with C fdopen does not make sense because os.fdopen isn't just a direct call to fdopen (includes verification of mode, fd, etc). http://bugs.python.org/issue21191 On Sat, Feb 21, 2015 at 1:58 PM, Matti Picus <matti.picus@gmail.com> wrote:

I tested with win32 2.7.8 The issue addressed in 21191 was that posix.fdopen was not closing fd on error. On windows there is no posix module so test_posix.py is skipped entirely. While the skipped test was modified in issue 21191 to test mode compatibility, posixmodule.c does not actually compare the input fd mode (perhaps via a call to fstat(fd, stat)? ) to the requested mode, rahter it only verifies that the requested mode itself is a valid mode for a call to fdopen. On windows posix.fdopen is exposed through os.fdopen, which AFAICT is only minimally tested outside of test_posix.py. On 22/02/2015 12:44 AM, Brian Kearns wrote:
participants (2)
-
Brian Kearns
-
Matti Picus