cython/cython — pull request #147 by cgohlke (2012-08-31 00:15:03+00:00)
Title: Fix "PyErr_Format + PY_FORMAT_SSIZE_T likely broken in Win64"

This issue was reported on the cython-dev mailing list in 2009 (http://codespeak.net/pipermail/cython-dev/2009-September/006950.html) and leads to many test failures of the following kind in Cython-0.17b3 on win-amd64 (reported at http://mail.python.org/pipermail/cython-devel/2012-August/003068.html):

```
Expected:
Traceback (most recent call last):
TypeError: m() takes at most 2 positional arguments (3 given)
Got:
Traceback (most recent call last):
TypeError: m() takes at most %Id positional argument%s (%Id given)
```

This PR fixes all test errors of this kind and has no side effects on other tests.

The PR defines a new constant `CYTHON_FORMAT_SSIZE_T` that is used instead of `PY_FORMAT_SIZE_T` in `PyErr_Format` functions.

This fix only affects win-amd64 platforms when msvc compilers are used (`CYTHON_FORMAT_SSIZE_T == "z"`). Other platforms and compilers are not affected (`CYTHON_FORMAT_SSIZE_T == PY_FORMAT_SIZE_T`).