You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace buffer()-->memoryview() in Lib/ctypes/test/ #51952
Activity
florentx commentedon Jan 14, 2010
In order to upgrate the tests for ctypes, following changes are required:
Then we can backport the Py3 ctypes tests to Py2.
florentx commentedon Jan 14, 2010
Patches attached:
pitrou commentedon Jan 14, 2010
Does binascii still work with array.array objects? Also, there should be additional tests for compatibility of binascii with memoryview objects.
florentx commentedon Jan 14, 2010
Additional tests for binascii.
pitrou commentedon Jan 14, 2010
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.
pitrou commentedon Jan 14, 2010
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.
florentx commentedon Jan 16, 2010
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"
pitrou commentedon Jan 16, 2010
I don't think the bytes -> bytearray changes are useful, e.g.:
+ 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.
florentx commentedon Jan 16, 2010
Changed.
florentx commentedon Jan 16, 2010
Removed no-op str("...") conversions.
pitrou commentedon Jan 16, 2010
When the following snippet is taken:
pascii will get released a second time at the end of function. The rest is fine, I'm gonna fix it myself.
pitrou commentedon Jan 16, 2010
The a2b_hqx() patch was committed in r77528 (trunk) and r77529 (py3k). Thanks again!
florentx commentedon Mar 22, 2010
Fixed with r79288 and r79295.