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
After 2to3 it, the 'buffer' isn't changed to memoryview, so then it is
not valid program in Python 3:
Traceback (most recent call last):
File "bufferobj3.py", line 2, in <module>
b = buffer(a)
NameError: name 'buffer' is not defined
However even it changed to memoryview the program still not valid because:
>>> memoryview('a')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: cannot make memory view because object does not have the
buffer interface
I can reporduce this on both Python 3.0.1 and Python 3.1a1+ (py3k:70310).
2to3 will convert buffer to memoryview, but not by default because as
you can see, it can be wrong. (Pass "-f buffer" to 2to3.) You can only
use memoryviews on bytes-like objects like b'a', and not unicode strings
(This is like 2.x.).
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: