| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
function (together with other locale aware ones) should into a new collation
support module. See python-dev for a discussion of this removal.
Note: This patch should also be applied to the 1.6 branch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the Python Unicode implementation.
The internal buffer used for implementing the buffer protocol
is renamed to defenc to make this change visible. It now holds the
default encoded version of the Unicode object and is calculated
on demand (NULL otherwise).
Since the default encoding defaults to ASCII, this will mean that
Unicode objects which hold non-ASCII characters will no longer
work on C APIs using the "s" or "t" parser markers. C APIs must now
explicitly provide Unicode support via the "u", "U" or "es"/"es#"
parser markers in order to work with non-ASCII Unicode strings.
(Note: this patch will also have to be applied to the 1.6 branch
of the CVS tree.)
|
|
|
|
|
| |
This is a notice without a date, which apparently is not a claim to
copyright but only advice to the reader. IANAL. :-)
|
|
|
|
| |
marked my*.h as obsolete
|
|
|
|
|
| |
char**) and return an int even on PC platforms. If not, please fix
PC/utils/makesrc.c ;-P
|
| |
|
|
|
|
| |
clean out some other warnings
|
| |
|
|
|
|
| |
(patch #100912)
|
|
|
|
|
| |
unicodeobject.c(735) :
error C2143: syntax error : missing ';' before '}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The UTF-8 decoder is still buggy (i.e. it doesn't pass Markus Kuhn's
stress test), mainly due to the following construct:
#define UTF8_ERROR(details) do { \
if (utf8_decoding_error(&s, &p, errors, details)) \
goto onError; \
continue; \
} while (0)
(The "continue" statement is supposed to exit from the outer loop,
but of course, it doesn't. Indeed, this is a marvelous example of
the dangers of the C programming language and especially of the C
preprocessor.)
|
|
|
|
|
|
|
|
|
|
| |
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").
There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
|
| |
|
|
|
|
| |
better error message for unicode coercion failure
|
|
|
|
|
|
|
|
|
|
| |
value is calculated from the character values, in a way
that makes sure an 8-bit ASCII string and a unicode string
with the same contents get the same hash value.
(as a side effect, this also works for ISO Latin 1 strings).
for more details, see the python-dev discussion.
|
| |
|
|
|
|
|
|
| |
objects including instance objects.
The old API PyUnicode_FromObject() is still available as shortcut.
|
|
|
|
|
| |
corrected some usage of 'unsigned long' where Py_UNICODE
should have been used.
|
|
|
|
| |
true after revision 2.36 was checked in...
|
| |
|
|
|
|
| |
should have been used.
|
|
|
|
| |
to the new alphabetic lookup APIs in unicodectype.c.
|
|
|
|
|
| |
Make unicode_compare a true UTF-16 compare function (includes
support for surrogates).
|
|
|
|
| |
A previous patch by Jack Jansen was accidently reverted.
|
|
|
|
|
|
| |
New buffer overflow checks for formatting strings.
By Trent Mick.
|
| |
|
|
|
|
|
|
|
|
| |
Patch to the standard unicode-escape codec which dynamically
loads the Unicode name to ordinal mapping from the module
ucnhash.
By Bill Tutt.
|
|
|
|
|
| |
Better error message for "1 in unicodestring". Submitted
by Andrew Kuchling.
|
|
|
|
|
|
|
|
| |
Fixed a bug in PyUnicode_Count() which would have caused a
core dump in case of substring coercion failure.
Synchronized .count() with the string method of the same name
to return len(s)+1 for s.count('').
|
|
|
|
|
| |
This patch fixes an optimisation mystery in _PyUnicodeNew causing segfaults
on AIX when the interpreter is compiled with -O.
|
|
|
|
| |
Added code so that .isXXX() testing returns 0 for emtpy strings.
|
|
|
|
|
| |
Fixed a typo and removed a debug printf(). Thanks to Finn Bock
for finding these.
|
| |
|
|
|
|
|
|
|
|
| |
Fixed %c formatting to check for one character arguments. Thanks
to Finn Bock for finding this bug.
Added a fix for bug PR#348 which originated from not resetting
the globals correctly in _PyUnicode_Fini().
|
|
|
|
|
|
|
|
|
|
| |
Change the default encoding to 'ascii' (it was previously
defined as UTF-8).
Note: The implementation still uses UTF-8 to implement
the buffer protocol, so C APIs will still see UTF-8. This
is on purpose: rather than fixing the Unicode implementation,
the C APIs should be made Unicode aware.
|
|
|
|
|
| |
M.-A. Lemburg <mal@lemburg.com>:
Fixed a core dump in PyUnicode_Format().
|
|
|
|
|
|
|
| |
Added support for user settable default encodings. The
current implementation uses a per-process global which
defines the value of the encoding parameter in case it
is set to NULL (meaning: use the default encoding).
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the string methods that implement slice-like semantics with
optional args (count, find, endswith, etc.) to properly handle
indeces outside [INT_MIN, INT_MAX]. Previously the "i" formatter
for PyArg_ParseTuple was used to get the indices. These could overflow.
This patch changes the string methods to use the "O&" formatter with
the slice_index() function from ceval.c which is used to do the same
job for Python code slices (e.g. 'abcabcabc'[0:1000000000L]).
|
|
|
|
| |
strings _are_ valid!
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.
(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode. I'm also holding back on his
change to main.c, which seems unnecessary to me.)
|
|
|
|
| |
a size of 0 *is* illegal.
|
|
|
|
| |
Fixes the MBCS codec to work correctly with zero length strings.
|
|
|
|
|
| |
Fixed \OOO interpretation for Unicode objects. \777 now
correctly produces the Unicode character with ordinal 511.
|
|
|
|
|
|
|
| |
Fixed a reference leak in the allocator.
Renamed utf8_string to _PyUnicode_AsUTF8String() and made
it external for use by other parts of the interpreter.
|
|
|
|
|
|
| |
The maxsplit functionality in .splitlines() was replaced by the keepends
functionality which allows keeping the line end markers together
with the string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* New exported API PyUnicode_Resize()
* The experimental Keep-Alive optimization was turned back
on after some tweaks to the implementation. It should now
work without causing core dumps... this has yet to tested
though (switching it off is easy: see the unicodeobject.c
file for details).
* Fixed a memory leak in the Unicode freelist cleanup code.
* Added tests to correctly process the return code from
_PyUnicode_Resize().
* Fixed a bug in the 'ignore' error handling routines
of some builtin codecs. Added test cases for these to
test_unicode.py.
|
|
|
|
| |
to prevent possible buffer overruns.
|
|
|
|
| |
doesn't mean what the Python programmer thought...
|
| |
|