[New-bugs-announce] [issue15827] Use "ll" for PY_FORMAT_SIZE_T on Win64

Stefan Behnel report at bugs.python.org
Fri Aug 31 07:01:21 CEST 2012


New submission from Stefan Behnel:

Formatting support for "lld"/"llu" was added (I think) in issue 7228, but the definition of PY_FORMAT_SIZE_T wasn't adapted. We are getting test output failures in Cython on Win64 when formatting error messages using the "Id" format, as defined by pyport.h:

"""
#ifndef PY_FORMAT_SIZE_T
#   if SIZEOF_SIZE_T == SIZEOF_INT && !defined(__APPLE__)
#       define PY_FORMAT_SIZE_T ""
#   elif SIZEOF_SIZE_T == SIZEOF_LONG
#       define PY_FORMAT_SIZE_T "l"
#   elif defined(MS_WINDOWS)
#       define PY_FORMAT_SIZE_T "I"
#   else
#       error "This platform's pyconfig.h needs to define PY_FORMAT_SIZE_T"
#   endif
#endif
"""

The "%Id" format is not being resolved in the error messages and shows up in the output instead.

NumPy uses "lld" when available, starting with Py2.7:

https://github.com/numpy/numpy/blob/master/numpy/core/include/numpy/npy_common.h#L66

Shouldn't PY_FORMAT_SIZE_T become "ll" on Win64 directly?

----------
components: Interpreter Core
messages: 169500
nosy: scoder
priority: normal
severity: normal
status: open
title: Use "ll" for PY_FORMAT_SIZE_T on Win64
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15827>
_______________________________________


More information about the New-bugs-announce mailing list