Message272645
For compatibility, I think it may be good to add custom implementations of the buffer attribute and detach() method to stdin/out. They should be able to at least read and write ASCII bytes. It might be easiest to keep them as the current BufferedReader/Writer objects. Probably also make stdin/out.fileno() defer to the buffer attribute.
With the current patch that only allows reading and writing in UTF-16 pairs, I forsee a few problems:
* I assume stdin.buffer.raw.readline() will try to read one byte at a time, and will therefore always indicate EOF.
* Incompatibility with using stdin/out.buffer for ASCII character input and output. I suggest testing the patch with “python -m base64”, a use case mentioned earlier in this thread. |
|
Date |
User |
Action |
Args |
2016-08-14 05:26:54 | martin.panter | set | recipients:
+ martin.panter, lemburg, mhammond, terry.reedy, paul.moore, tzot, amaury.forgeotdarc, ncoghlan, pitrou, giampaolo.rodola, christian.heimes, tim.golden, mark, ned.deily, christoph, ezio.melotti, v+python, hippietrail, ssbarnea, flox, davidsarah, santoso.wijaya, akira, BreamoreBoy, David.Sankel, smerlin, lilydjwg, piotr.dobrogost, Drekin, steve.dower, wiz21, stijn, Jonitis, escapewindow, dead1ne |
2016-08-14 05:26:53 | martin.panter | set | messageid: <1471152413.63.0.247734682573.issue1602@psf.upfronthosting.co.za> |
2016-08-14 05:26:53 | martin.panter | link | issue1602 messages |
2016-08-14 05:26:53 | martin.panter | create | |
|