[New-bugs-announce] [issue31966] print('hello\n', end='', flush=True) raises OSError when ran with py -u

Guillaume Aldebert report at bugs.python.org
Tue Nov 7 04:40:05 EST 2017


New submission from Guillaume Aldebert <galdebert at gmail.com>:

noticed on windows10, 3.6.3-64 and 3.7.0a2-64:

using this test.py file:

#!/usr/bin/env python3
print('hello\n', end='', flush=True)

and running it in unbuffered mode:

C:\Dev>py -u test.py
hello
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    print('hello\n', end='', flush=True)
OSError: [WinError 87] The parameter is incorrect

Note that (still using py -u):

print('hello', end='', flush=True) # works fine
print('', end='', flush=True) # raises OSError as well

----------
components: Windows
messages: 305726
nosy: Guillaume Aldebert, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: print('hello\n', end='', flush=True) raises OSError when ran with py -u
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31966>
_______________________________________


More information about the New-bugs-announce mailing list