Message190714
| Author |
vajrasky |
| Recipients |
alex, benjamin.peterson, hynek, nikratio, pitrou, serhiy.storchaka, stutzbach, vajrasky |
| Date |
2013年06月06日.13:48:38 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1370526519.66.0.217698195779.issue18116@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Fixing IO leak resource would fix this bug but leave another bug opened which I try to fix as well.
These statements with Python3 under Linux will always fail because we need to open /dev/tty file in binary mode (for whatever reason).
fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY)
tty = os.fdopen(fd, 'w+', 1)
So I guess the correct fix would be to open /dev/tty in binary mode (and set buffering off) and go on from there.
Of course, one can argue whether this bug should be separated from the original bug (resource warning). I am not sure either.
Anyway, here is the patch that will work with stream StringIO and stdout.
Thank you for Serhiy for pointing out my mistakes. |
|