New submission from Steve Dower:

In pythonrun.c, the is_valid_fd() function checks whether fileno(std*) are 
valid before attempting to create IO objects for them. However, the class 
created also checks using fstat().

In pythonw.exe built with VS 2013 (or 14, maybe 2012), the fstat() check fails 
while the earlier one succeeds. This prevents pythonw from starting.

The attached patch adds the fstat() check to pythonrun.c so that if the streams 
are not usable they will simply not be used. I believe this was the original 
intent, but at some point the invalid streams gained valid file numbers.

(I have no strong opinion about applying this to 3.4, except that it will help 
out people who rebuild/embed that version of Python with a newer compiler. 
Thoughts?)

----------
components: IO, Windows
files: pythonrun_fstat.diff
keywords: patch
messages: 222706
nosy: benjamin.peterson, pitrou, steve.dower, stutzbach, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pythonrun.c does not check std streams the same as fileio.c
versions: Python 3.5
Added file: http://bugs.python.org/file35921/pythonrun_fstat.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21953>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to