Stefan Krah stefan-use...@bytereef.org added the comment:
I also wonder how the buffer interface section can fail.
PyBuffer_ToContiguous() should translate to a simple memcpy()
for a bytes object. What is going on?
--
nosy: +skrah
___
Python tracker
Larry Hastings la...@hastings.org added the comment:
I can't reproduce this, and it was pretty late in my day when I saw it, so
let's assume I was mistaken and PyBytes_CheckBuffer() works fine. Nevertheless
I think the patch is a good idea--why create a new object when you don't have
to?
New submission from Larry Hastings la...@hastings.org:
If you pass a valid PyUnicodeObject into PyUnicode_AsObject(), it incref's the
original object and returns it.
If you pass a valid PyBytesObject into PyBytes_AsObject()... it fails.
I assert that in the PyBytes_AsObject() should behave
Changes by Hynek Schlawack h...@ox.cx:
--
nosy: +hynek
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14889
___
___
Python-bugs-list mailing list
Larry Hastings la...@hastings.org added the comment:
The appropriate four line patch. (Six with whitespace.)
--
keywords: +patch
stage: needs patch - patch review
Added file:
http://bugs.python.org/file25682/larry.pybytes_fromobject.identity.1.diff
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
I suppose you are referring to PyUnicode_FromObject() and
PyBytes_FromObject()...
And by it fails did you simply mean it fails to return the same object?
--
nosy: +amaury.forgeotdarc
___
Larry Hastings la...@hastings.org added the comment:
1) Yes, whoopsies. It's late.
2) It fails, as in, it returns NULL.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14889
___
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
2) It fails, as in, it returns NULL.
It's not my experience. Do you have an example?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14889
Antoine Pitrou pit...@free.fr added the comment:
Well, the patch is nice but the PyObject_CheckBuffer(...) part should have
succeeded, so it's a bit mysterious why it doesn't.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14889
___
___
Python-bugs-list mailing list
10 matches
Mail list logo