[issue16204] PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2
STINNER Victor added the comment: @skrah: ping! @piro: can't you modify psycopg2 to add conditional code depending on the Python version? IMO the behaviour change is wanted. http://www.python.org/dev/peps/pep-3118/ -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16204 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16204] PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2
Stefan Krah added the comment: I've corresponded privately with Daniele Varrazzo about the psycopg2 issue already and then forgot about this (the psycopg2 fix is good). Yes, the change was intentional. There's one open issue (#15944) where dabeaz isn't happy about the change, so let's make that a superseder. -- resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - memoryviews and ctypes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16204 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16204] PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2
New submission from Daniele Varrazzo: Definitely related to this change in Python 3.3: Accessing a memoryview element with format ‘B’ (unsigned bytes) now returns an integer (in accordance with the struct module syntax). For returning a bytes object the view must be cast to ‘c’ first. The object returned by PyBuffer_FillInfo is 'B' format: this means that python code finds itself dealing in Py 3.3 with a different object respect to what returned in Py 3.1 and 3.2. Is this change in the behavior wanted? Wouldn't have been better having FillInfo return a 'c' buffer instead? I'm adding support to Py 3.3 to psycopg2 and the B buffers make the test suite fail. I want psycopg to return consistent objects across 3.x. Is the change in this commit correct? https://github.com/dvarrazzo/psycopg/commit/469b6f8aff4cafe203d851b19bedfab0128e795a Is this a good way to return a 'c' buffer? -- messages: 172710 nosy: piro priority: normal severity: normal status: open title: PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2 type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16204 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16204] PyBuffer_FillInfo returns 'B' buffer, whose behavior has changed w.r.t. 3.1/3.2
Changes by Antoine Pitrou pit...@free.fr: -- keywords: +3.3regression nosy: +skrah versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16204 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com