[issue17839] base64 module should use memoryview

Nick Coghlan report at bugs.python.org
Wed Oct 2 16:48:52 CEST 2013


Nick Coghlan added the comment:

After working through this, I found that the modern base64 API just relies on the checks in binascii. All that checks for is:

1. Can the data by exported using PyBUF_SIMPLE?
2. Is it C contiguous?

It completely ignores the number of dimensions and the format information. I added tests to at least capture this behaviour, even though it seems a little dubious to me.

For the legacy API, I didn't relax the input checks that far - the legacy API will still complain if there is more than 1 dimension and if the format code isn't one of 'c', 'b' or 'B'. That's already substantially more permissive than what it supported in previous versions.

Just running the full test suite now, will push after that finishes.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17839>
_______________________________________


More information about the Python-bugs-list mailing list