[New-bugs-announce] [issue24881] _pyio checks that `os.name == 'win32'` instead of 'nt'
Cosimo Lupo
report at bugs.python.org
Mon Aug 17 16:11:07 CEST 2015
New submission from Cosimo Lupo:
the `_pyio` module at line 16 tries to check whether it is running on Windows platform, by doing:
```
if os.name == 'win32':
from msvcrt import setmode as _setmode
else:
_setmode = None
```
However, the string returned by os.name is 'nt' and not 'win32' (the latter is returned by `sys.platform`). Therefore, the value is always False and the setmode function from mscvrt module is never imported.
Thank you.
Cheers,
Cosimo
----------
components: IO
messages: 248728
nosy: Cosimo Lupo
priority: normal
severity: normal
status: open
title: _pyio checks that `os.name == 'win32'` instead of 'nt'
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24881>
_______________________________________
More information about the New-bugs-announce
mailing list