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