msg97765 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-14 14:17 |
In order to upgrate the tests for ctypes, following changes are required: - binascii.hexlify should accept memoryview() objects - the ctypes character buffer should accept assignment of memoryview() objects using their "raw" property Then we can backport the Py3 ctypes tests to Py2. |
|
|
msg97766 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-14 14:23 |
Patches attached: - partial backport of Modules/binascii.c - partial backport of Modules/_ctypes/_ctypes.c (preserving 2.3 compat.) - update ctypes tests (buffer -> memoryview) |
|
|
msg97768 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-01-14 14:47 |
Does binascii still work with array.array objects? Also, there should be additional tests for compatibility of binascii with memoryview objects. |
|
|
msg97769 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-14 15:17 |
Additional tests for binascii. |
|
|
msg97772 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-01-14 16:01 |
Please be careful with the coding style. Stuff like: + if (_PyString_Resize(&rv, 2*out_len) < 0) \ + { Py_DECREF(rv); PyBuffer_Release(&pin); return NULL; } \ should be spread out on several lines. Otherwise, the binascii patch looks good. |
|
|
msg97773 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-01-14 16:35 |
I've now committed the binascii patch + tests to trunk, and merged the tests into py3k. Note: binascii_a2b_hqx() still uses the "t#" argument specifier in py3k as well as in trunk, this would deserve a separate patch. |
|
|
msg97867 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-16 10:10 |
Patch for the last "t#" format string in binascii module. And provide additional tests. PS: I removed this comment. IMHO, it is a wrong assertion: "# The hqx test is in test_binhex.py" |
|
|
msg97868 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-01-16 10:46 |
I don't think the bytes -> bytearray changes are useful, e.g.: - fillers = "" + fillers = bytearray() As for: + try: + f(empty) + except SystemError, err: + self.fail("{}({!r}) raises SystemError: {}".format(func, empty, err)) + except Exception, err: + self.fail("{}({!r}) raises {!r}".format(func, empty, err)) The "except SystemError" is pointless, since "except Exception" will catch SystemError anyway. |
|
|
msg97872 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-16 11:45 |
Changed. |
|
|
msg97877 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-01-16 13:14 |
Removed no-op str("...") conversions. |
|
|
msg97885 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-01-16 17:42 |
When the following snippet is taken: if (_PyString_Resize(&rv, (bin_data - (unsigned char *)PyString_AS_STRING(rv))) < 0) { PyBuffer_Release(&pascii); Py_DECREF(rv); rv = NULL; } pascii will get released a second time at the end of function. The rest is fine, I'm gonna fix it myself. |
|
|
msg97886 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-01-16 17:57 |
The a2b_hqx() patch was committed in r77528 (trunk) and r77529 (py3k). Thanks again! |
|
|
msg101518 - (view) |
Author: Florent Xicluna (flox) *  |
Date: 2010-03-22 16:09 |
Fixed with r79288 and r79295. |
|
|