Issue3694
Created on 2008-08-27 04:29 by ajaksu2, last changed 2008-08-27 09:26 by amaury.forgeotdarc.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
s26.diff
|
georg.brandl,
2008-08-27 08:47
|
|
|
|
|
s30.diff
|
georg.brandl,
2008-08-27 08:47
|
|
|
|
| msg72005 (view) |
Author: Daniel Diniz (ajaksu2) |
Date: 2008-08-27 04:29 |
|
The following code leads to XXX Undetected errors in debug builds of
trunk and 3.0:
import _struct
_struct.pack_into(b"8", bytearray(1), None)
Besides that, there's something fishy happening in non-debug builds:
2.6:
>>> _struct.pack_into(b"8", bytearray(1), None);
>>> _struct.pack_into(b"8", bytearray(1), None);
>>> import sys
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: an integer is required
3.0:
>>> _struct.pack_into(b"8", bytearray(1), None)
>>> _struct.pack_into(b"8", bytearray(1), None)
SystemError: Objects/longobject.c:433: bad argument to internal function
Found with Fusil.
|
| msg72014 (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2008-08-27 08:44 |
|
The problem is that, unlike PyInt_AsSsize_t, PyLong_AsSsize_t expects
its argument to already be a long object and else raises the SystemError.
It should probably behave like PyInt_AsSsize_t and raise the TypeError
since in 3.0 it's used in many places where PyInt_AsSsize_t was used.
|
| msg72015 (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2008-08-27 08:47 |
|
The attached patches at least correct the XXX undetected error.
|
| msg72016 (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) |
Date: 2008-08-27 09:26 |
|
Isn't PyNumber_AsSsize_t designed for this purpose?
|
|
| Date |
User |
Action |
Args |
| 2008-08-27 09:26:28 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages:
+ msg72016 |
| 2008-08-27 08:47:36 | georg.brandl | set | files:
+ s30.diff |
| 2008-08-27 08:47:30 | georg.brandl | set | files:
+ s26.diff keywords:
+ patch messages:
+ msg72015 |
| 2008-08-27 08:44:42 | georg.brandl | set | nosy:
+ georg.brandl messages:
+ msg72014 |
| 2008-08-27 04:29:50 | ajaksu2 | create | |
|