Patch # 1050 by Amaury Forgeot d'Arc.
On Windows, debug builds insert stack probes, and recursive functions
tend to exhaust the stack faster.
This patch reduces the marshal maximum depth from 2000 to 1500 for debug
builds only. Optimized builds are not affected.
This allows test_marshal to pass with debug builds.
On Windows, debug builds insert stack probes, and recursive functions
tend to exhaust the stack faster.
This patch reduces the marshal maximum depth from 2000 to 1500 for debug
builds only. Optimized builds are not affected.
This allows test_marshal to pass with debug builds.
1/ getargs.diff adds the 'Z' and 'Z#' format specifiers for
PyArg_ParseTuple. They mimic z and z# for unicode strings, by accepting
a Unicode or None (in which case the Py_UNICODE* pointer is set to
NULL). With doc and tests.
2/ subprocess.diff converts file PC/_subprocess.c to unicode. We use the
Unicode version of the win32 api (and Z conversion from previous patch)
3/ stdout.diff: sys.stdout must not convert the line endings, Windows
already does it.
Without this patch, when redirecting the output of python, the file
contains \r\r\n for each line. (test_subprocess did catch this)
However, I (GvR) removed the change to _fileio.c (included in the
patches) that prevents closing file descripors < 3 from being closed;
I think that needs to be solved in a different way.
has an extra (optional) output parameter through which it returns the size.
Use this in a few places where I used PyUnicode_AsString() + strlen(),
and in one new place (which fixes test_pep263).
previous version of PEP 3101. It's currently not compiled in, but I want to
leave it because it might be useful in the future and it makes
calc_number_widths() clearer. It justifies NumberFieldWidths.rsign
and .n__rsign.
From now on, trying to write str to a binary stream
is an error (I'm still working on the reverse).
There are still (at least) two failing tests:
- test_asynchat
- test_urllib2_localnet
but I'm sure these will be fixed by someone.
(PyUnicode these days) to a char* + length. The fix consists of calling
PyUnicode_AsString() and strlen(). This is not ideal, but AsCharBuffer()
is definitely not the API to use.
a tuple (literal, field_name, format_spec, conversion).
literal will always be a string, but might be of zero length.
field_name will be None if there is no markup text
format_spec will be a (possibly zero length) string if
field_name is non-None
conversion will be a one character string, or None
This makes the Formatter class, and especially it's parse()
method, easier to understand.
Suggestion was by Jim Jewett, inspired by the "tail" of an
elementtree node.
Also, fixed a reference leak in fieldnameiter_next.