changeset: 97536:2dd9294f679d parent: 97534:bf789ae9bde7 parent: 97535:687da8760a58 user: Serhiy Storchaka date: Fri Aug 28 22:20:29 2015 +0300 files: Lib/_pyio.py Misc/NEWS description: Issue #24881: Fixed setting binary mode in Python implementation of FileIO on Windows and Cygwin. Patch from Akira Li. diff -r bf789ae9bde7 -r 2dd9294f679d Lib/_pyio.py --- a/Lib/_pyio.py Fri Aug 28 10:36:01 2015 +1200 +++ b/Lib/_pyio.py Fri Aug 28 22:20:29 2015 +0300 @@ -8,12 +8,13 @@ import errno import array import stat +import sys # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock -if os.name == 'win32': +if sys.platform in {'win32', 'cygwin'}: from msvcrt import setmode as _setmode else: _setmode = None diff -r bf789ae9bde7 -r 2dd9294f679d Misc/NEWS --- a/Misc/NEWS Fri Aug 28 10:36:01 2015 +1200 +++ b/Misc/NEWS Fri Aug 28 22:20:29 2015 +0300 @@ -79,6 +79,9 @@ Library ------- +- Issue #24881: Fixed setting binary mode in Python implementation of FileIO + on Windows and Cygwin. Patch from Akira Li. + - Issue #21112: Fix regression in unittest.expectedFailure on subclasses. Patch from Berker Peksag.