On 22/05/15 10:10, Matti Picus wrote:


On 06/02/15 13:14, Amaury Forgeot d'Arc wrote:
CPython3 has this code to set sys.stdout to None in this case:
https://hg.python.org/cpython/file/v3.3.4/Python/pythonrun.c#l1083

But that's probably only for python3, python2 chose to not change anything:
http://bugs.python.org/issue706263
I merged pypyw which simply creates another exe, in line with what Armin suggested. Amaury, it is not clear to me how stdout is set to None since AFAICT is_valid_fd(stdout) passes, at least in the rpython test I tried. To reproduce: run test_shared in translator/c/test_standalone.py, then run the resulting test-1w.exe as

test-1.exe a b 2>err.txt

It will print a rpython exception to err.txt indicating that it failed in the actual write, not in the is_valid_fd(stdout) test just before the write.

Matti
Ahh, is_valid_fd in cpython also checks dummy_fd = dup(fd), which we do not do (in rposix.py). Sorry for the noise.
Matti
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to