Meador Inge <mead...@gmail.com> added the comment: Hmmm... I take back what I said before (not sure what I was thinking), I don't think this is a regression. If this ever did work, it must have been a bug. For one reason, Python byte strings are now immutable. Allowing their memory to be indirectly mutated in Python via buffers created from 'from_buffer' would be very bad.
Also, I can't reproduce the reported behavior with 3.1.3: Python 3.1.3 (unknown, Nov 9 2011, 19:57:58) [GCC 4.6.1 20110908 (Red Hat 4.6.1-9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> (ctypes.c_char*5).from_buffer(b'abcde') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: expected an object with a writable buffer interface Are you sure it was 3.1.3? At first I thought you might be using 3.0a, since bytes are mutable in that version, but 'from_buffer' didn't exist in those times. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11427> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com