This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: unicodeobject.c not using PY_FORMAT_SIZE_T
Type: Stage:
Components: Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: John.Malmberg, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2014-07-01 04:59 by John.Malmberg, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unicodeobject.gdiff John.Malmberg, 2014-07-01 04:59 Patch to use PY_FORMAT_SIZE_T
Messages (6)
msg222009 - (view) Author: John Malmberg (John.Malmberg) * Date: 2014-07-01 04:59
unicodeobject.c is using %zd instead of the PY_FORMAT_SIZE_T as set by configure.

Comments in pymacconfig.h state that this will cause problems on OS-X 10.4 with binaries build on OS-X 10.5.

The attached patch unicodeobject.giff changes unicodeobject.c to be like the other modules that use PY_FORMAT_SIZE_T.
msg222016 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-01 06:58
New changeset 4f55e802baf0 by Victor Stinner in branch '3.4':
Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu to format C
http://hg.python.org/cpython/rev/4f55e802baf0

New changeset 669b43bffd87 by Victor Stinner in branch 'default':
(Merge 3.4) Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu
http://hg.python.org/cpython/rev/669b43bffd87
msg222019 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-01 06:58
Oh, I forgot the mention John Malmberg in the changelog, sorry :-(

Thanks for your fix John.
msg222311 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-07-04 19:45
This is incorrect. PY_FORMAT_SIZE_T shouldn't be used in format string of PyErr_Format. On one hand, PyErr_Format understand the "z" modifier. On other hand, it is not understand all platform-specific expansions of PY_FORMAT_SIZE_T (e.g. "I").
msg222313 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-04 20:50
New changeset 6fb1e2ce513a by Victor Stinner in branch '3.4':
Issue #21892, #21893: Partial revert of changeset 4f55e802baf0, PyErr_Format()
http://hg.python.org/cpython/rev/6fb1e2ce513a

New changeset 58cd562e3ef9 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21892, #21893: Partial revert of changeset 4f55e802baf0,
http://hg.python.org/cpython/rev/58cd562e3ef9
msg222315 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-04 20:51
> This is incorrect. PY_FORMAT_SIZE_T shouldn't be used in format string of PyErr_Format.

Oh, I forgot that. Thanks for the careful review Serhiy! Thanks.
History
Date User Action Args
2022-04-11 14:58:05adminsetgithub: 66092
2014-07-04 20:51:59vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg222315
2014-07-04 20:50:41python-devsetmessages: + msg222313
2014-07-04 19:45:16serhiy.storchakasetstatus: closed -> open

nosy: + serhiy.storchaka
messages: + msg222311

resolution: fixed -> (no value)
2014-07-01 06:58:53vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg222019
2014-07-01 06:58:05python-devsetnosy: + python-dev
messages: + msg222016
2014-07-01 06:38:04ned.deilysetnosy: + vstinner
2014-07-01 04:59:17John.Malmbergcreate