Message256431
>>> from io import *
>>> text = TextIOWrapper(BytesIO(), "iso-2022-jp")
>>> text.write(u"P")
1
>>> text.tell()
1
>>> text.write(u"anter 正")
7
>>> text.tell()
12
>>> text.write(u"孝")
1
>>> text.seek(12)
12
>>> text.read() # Should return 孝, not ASCII
"9'"
>>> text.buffer.getvalue()
b"Panter \x1b$B@59'"
>>> text.seek(1)
1
>>> text.read(7)
'anter 正'
>>> text.tell() # Another bug?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'iso2022_jp' codec can't decode bytes in position 2-3: illegal multibyte sequence |
|
Date |
User |
Action |
Args |
2015-12-15 02:37:24 | martin.panter | set | recipients:
+ martin.panter, vstinner, ezio.melotti |
2015-12-15 02:37:24 | martin.panter | set | messageid: <1450147044.33.0.0242462239972.issue25863@psf.upfronthosting.co.za> |
2015-12-15 02:37:24 | martin.panter | link | issue25863 messages |
2015-12-15 02:37:23 | martin.panter | create | |
|