-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace buffer()-->memoryview() in Lib/ctypes/test/ #51952
Comments
In order to upgrate the tests for ctypes, following changes are required:
Then we can backport the Py3 ctypes tests to Py2. |
Patches attached:
|
Does binascii still work with array.array objects? Also, there should be additional tests for compatibility of binascii with memoryview objects. |
Additional tests for binascii. |
Please be careful with the coding style. Stuff like: + if (_PyString_Resize(&rv, 2*out_len) < 0) \ should be spread out on several lines. |
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. |
Patch for the last "t#" format string in binascii module. PS: I removed this comment. IMHO, it is a wrong assertion: |
I don't think the bytes -> bytearray changes are useful, e.g.:
+ fillers = bytearray() As for: + try: The "except SystemError" is pointless, since "except Exception" will catch SystemError anyway. |
Changed. |
Removed no-op str("...") conversions. |
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. |
The a2b_hqx() patch was committed in r77528 (trunk) and r77529 (py3k). Thanks again! |
Fixed with r79288 and r79295. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: