Message198689
I have just tested Windows GUI application built against Python 3.2.1 with is_valid_fd patch according to http://hg.python.org/cpython/rev/f15943505db0/
All built using VS2012.
Again, I can confirm that is_valid_fd does NOT solve the problem.
Here is extract of execution flow in initstdio function:
1. fd = 0, despite it is GUI app, see https://connect.microsoft.com/VisualStudio/feedback/details/785119/
fd = fileno(stdin);
2. is_valid_fd will return __true__, so it moves to calling create_stdio()
if (!is_valid_fd(fd)) {
...
}
else {
std = create_stdio(iomod, fd, 0, "<stdin>", encoding, errors);
if (std == NULL)
goto error;
}
3. The create_stdio() call fails though, causing error followed by abort
Still, the only solution that solves this problem in Windows GUI applications buitl using VS2012 is to use check_fd() function to check fd, instead of is_valid_fd(). The check_fd() is more reliable as it will return -1 due to errno == EBADF.
My previous attempt to analyse _PyVerify_fd() is not relevant for the problem, let's forget it. |
|
Date |
User |
Action |
Args |
2013-09-30 10:57:10 | mloskot | set | recipients:
+ mloskot, tim.peters, amaury.forgeotdarc, pitrou, vstinner, christian.heimes, tim.golden, brian.curtin, V.E.O, m_python |
2013-09-30 10:57:10 | mloskot | set | messageid: <1380538630.17.0.264161429683.issue17797@psf.upfronthosting.co.za> |
2013-09-30 10:57:10 | mloskot | link | issue17797 messages |
2013-09-30 10:57:09 | mloskot | create | |
|