[New-bugs-announce] [issue7415] PyUnicode_FromEncodedObject() uses PyObject_AsCharBuffer()

Stefan Behnel report at bugs.python.org
Tue Dec 1 07:19:14 CET 2009

New submission from Stefan Behnel <scoder at users.sourceforge.net>:

PyUnicode_FromEncodedObject() currently calls PyObject_AsCharBuffer() to
get the buffer pointer and length of a buffer supporting object. It
should be changed to support the buffer protocol correctly instead.

I filed this as a crash bug as the buffer protocol allows a buffer
supporting object to discard its buffer when the release function is
called. The decode function uses the buffer only *after* releasing it,
thus provoking a crash for objects that implement the buffer protocol
correctly in that they do not allow access to the buffer after the release.

components: Interpreter Core
messages: 95847
nosy: scoder
severity: normal
status: open
title: PyUnicode_FromEncodedObject() uses PyObject_AsCharBuffer()
type: crash
versions: Python 3.0, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list