Message70583
Le vendredi 01 août 2008 à 17:53 +0000, Amaury Forgeot d'Arc a écrit :
> There is a small issue with the patch: in the "w#" format handler,
> bf_getwritebuffer(arg, 0, res) is wrong. The third argument should be
> &res (there is a compilation warning on windows),
>
> And a few lines after, in the "if (*format == '#')" block, there should
> be a line like
> *p = res;
> otherwise the user code never sees the buffer...
Nice catch! Making those changes actually fixes a segfault I had in
testReadinto in test_file.py.
By the way, please note bytearray.decode is broken:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ascii_decode() argument 1 must be string or pinned buffer, not bytearray
>>> bytearray(b"").decode("utf8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/antoine/cpython/bufferedwriter/Lib/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
TypeError: utf_8_decode() argument 1 must be string or pinned buffer, not bytearray
>>> bytearray(b"").decode("latin1")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: latin_1_decode() argument 1 must be string or pinned buffer, not bytearray |
|
Date |
User |
Action |
Args |
2008-08-01 18:48:28 | pitrou | set | recipients:
+ pitrou, loewis, barry, teoliphant, amaury.forgeotdarc, giampaolo.rodola, donmez, benjamin.peterson, gpolo |
2008-08-01 18:48:27 | pitrou | link | issue3139 messages |
2008-08-01 18:48:27 | pitrou | create | |
|