[issue24009] Get rid of rare format units in PyArg_Parse*

2018-06-14 Thread Tal Einat
Change by Tal Einat : -- nosy: -taleinat ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-05-26 Thread Martin Panter
Martin Panter added the comment: Yes I just figured out that myself. Specifically, PyBufferProcs.bf_releasebuffer has to be NULL, and the buffer stays alive as long as the object stays alive. Also it looks like I was wrong about “u” being useless. I was tricked by a contradiction in the docum

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: “s#”, “z#”, “y” and “y#” work only with read-only buffers, for which PyBuffer_Release() is no-op operation. Initially they was designed for work with old buffer protocol that doesn't support releasing a buffer. -- ___

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-05-25 Thread Martin Panter
Martin Panter added the comment: “u#” should not be deprecated without first deprecating “u”, which is less useful due to not returning a buffer length. Also, I have always been mystified about how “s#”, “z#”, “y” and “y#” can properly to return a pointer into a buffer for arbitrary immutable

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, of course, I think we shouldn't drop support of these format units. But using them likely is a sign of outdated or transitional code. It should be discouraged in new code, and every case should be analyzed and cleaned. -- __

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-05-06 Thread Ronald Oussoren
Ronald Oussoren added the comment: Note that these format characters can also be used outside of CPython. -- nosy: +ronaldoussoren ___ Python tracker ___

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-05-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset d65233f630e1 by Serhiy Storchaka in branch 'default': Issue #24009: Got rid of using rare "y#" format unit in TextIOWrapper.tell(). https://hg.python.org/cpython/rev/d65233f630e1 -- nosy: +python-dev ___

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-25 Thread Tal Einat
Tal Einat added the comment: +1. I was recently trying to use the C API for a 3rd party library, and all of these subtly different string parameter formats made things surprisingly confusing. These are part of the Python C API, so removing them could break 3rd party code. Simply searching thr

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Convert os._getfullpathname() and os._isdir() to Argument Clinic ___ Python tracker ___ __

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file39185/issue24009_textio_decoder_getstate.patch ___ Python tracker ___

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file39186/issue24009_textio_decoder_getstate.patch ___ Python tracker ___ __

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In textio.c, the decoder always should return bytes, not arbitrary read-only buffer (this is required in other parts of the code). So "y#" can be replaced with "O" with PyBytes_GET_SIZE. -- keywords: +patch Added file: http://bugs.python.org/file391

[issue24009] Get rid of rare format units in PyArg_Parse*

2015-04-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are a lot of format units supported in PyArg_Parse* functions, but some of them are rarely or never used in current CPython code. Some of format units are legacy from Python 2 and are not needed in modern Python 3 code or can be replaced with custom