This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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.
History
Date User Action Args
2013-06-06 13:48:39vajraskysetrecipients: + vajrasky, pitrou, benjamin.peterson, stutzbach, alex, nikratio, hynek, serhiy.storchaka
2013-06-06 13:48:39vajraskysetmessageid: <1370526519.66.0.217698195779.issue18116@psf.upfronthosting.co.za>
2013-06-06 13:48:39vajraskylinkissue18116 messages
2013-06-06 13:48:39vajraskycreate