[New-bugs-announce] [issue22673] Incorrect fileno for CONOUT$ / stdout

Aaron Myles Landwehr report at bugs.python.org
Sun Oct 19 21:00:58 CEST 2014


New submission from Aaron Myles Landwehr:

If I execute the following code, the file descriptor for CONOUT$ has a fileno != 1. With CONIN$ the fileno != 0. Similar code in another language such as perl produces the desired results. 

sys.stdout.close();
sys.stdout = open("CONOUT$", "w");
sys.stderr.write(str(sys.stdout.fileno()));

I believe it has to do with the fact that stdout is an object in python and in perl or c, you are operating directly on the stream ala freopen() or the equivalent.

----------
components: IO
messages: 229690
nosy: snaphat
priority: normal
severity: normal
status: open
title: Incorrect fileno for CONOUT$ / stdout
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22673>
_______________________________________


More information about the New-bugs-announce mailing list