[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Tomasz Wasilczyk

Tomasz Wasilczyk added the comment:

It seems that bug remains *not* fixed.

Just like eaducac pointed out, there are cases when underlying file handle is 
-2, which is not a valid file handle, but *is* a valid handle (which is 
GetCurrentThread).

Thus, provided dup solution accepts it, while it shouldn't. However, suggested 
GetStdHandle check still doesn't work for me. While working on the related 
Spoon issue, I've worked out a working solution (see the patch attached).

Tomek,
Spoon.net dev

--
keywords: +patch
nosy: +twasilczyk@spoon
Added file: http://bugs.python.org/file37907/python-3.3.5-fdvalidation.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17797
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Tomasz Wasilczyk

Tomasz Wasilczyk added the comment:

I don't mean fixing VS, but providing a workaround in Python code, when 
compiled with VS2012.

I know newer VS versions are fixed. Do you mean, VS2012 is not supported? If 
it's not - then LibreOffice team have a problem, because their official release 
is built with this suite.

If it is supported, and you don't want to alter behavior for other versions, 
then a patch may also contain an ifdef for MSVC 11.0.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17797
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2015-01-29 Thread Tomasz Wasilczyk

Tomasz Wasilczyk added the comment:

In such case, I agree it's an enhancement, not a bugfix. Could go into 3.5 
branch.

How about changing the ifdef to the following, to avoid any issues on 
non-MSVS2012:

#if defined(MS_WINDOWS)  defined(HAVE_FSTAT)  defined(_MSC_VER)  _MSC_VER 
== 1700

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17797
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com