Commit Graph

2284 Commits

Author SHA1 Message Date
Martin v. Löwis
04e38d94bf Put method-wrappers into trashcan. Fixes #927248. 2006-07-03 13:47:29 +00:00
Armin Rigo
53730fe64c Backport of r47061. 2006-06-21 22:11:16 +00:00
Brett Cannon
df43ce33fb Classic class that defined `def __coerce__(self, other): return other, self`
would infinitely recourse and segfault the interpreter.  Now a recursion check
occurs after a coercion.

Backport of fix for bug #992017.
2006-06-13 21:50:24 +00:00
Brett Cannon
fd827cb550 Fix bug introduced in rev. 46807 where variable was not declared at top of block. 2006-06-09 22:49:31 +00:00
Brett Cannon
7afe7fe14a Backport of fix of bug #532646 for new-style classes. 2006-06-09 22:38:29 +00:00
Martin v. Löwis
cbbe647bb7 Don't crash on Py_UNICODE values < 0. Fixes #1454485. 2006-06-05 10:43:57 +00:00
Neal Norwitz
9109341c43 Backport: Patch #1488312, Fix memory alignment problem on SPARC in unicode. 2006-05-15 07:22:23 +00:00
Armin Rigo
337c143b4a Ignore the references to the dummy objects used as deleted keys
in dicts and sets when computing the total number of references.
2006-04-12 17:06:58 +00:00
Georg Brandl
af55db9cd8 Bug #1177964: make file iterator raise MemoryError on too big files
(backport from rev. 43506)
2006-03-31 20:31:05 +00:00
Anthony Baxter
cb9051a608 after discussions with perky, reverted fix for Bug #1379994: Builtin
unicode_escape and raw_unicode_escape codec now encodes backslash correctly.

This caused another issue for unicode repr strings being double-escaped
(SF Bug #1459029). Correct fix will be in 2.5, but is too risky for 2.4.3.

Added a testcase for #1459029.
2006-03-28 07:32:36 +00:00
Neal Norwitz
55dd2b41e0 Fix the refleak from test_unicode.
Backport 42973 (lots of whitespace changes intermixed):

 - Reindent a confusingly indented piece of code (no intended code changes
    there)
 - Add missing DECREFs of inner-scope 'temp' variable
 - Add various missing DECREFs by changing 'return NULL' into 'goto onError'
 - Avoid double DECREF when last _PyUnicode_Resize() fails

Coverity found one of the missing DECREFs, but oddly enough not the others.
2006-03-28 06:05:21 +00:00
Anthony Baxter
022a55c0d9 update - still some old .cvsignore files lying around 2006-03-23 02:26:07 +00:00
Georg Brandl
d9ca66f2b2 Backport: Fix missing NULL checks after PyTuple_New, PyList_New, PyDict_New 2006-03-17 19:04:15 +00:00
Neal Norwitz
9165680203 Backport 43022:
Fix and test (manually w/xx module) passing NULLs to PyObject_Str() and
PyObject_Unicode().  This problem was originally reported from Coverity
and addresses mail on python-dev "checkin r43015".

This inlines the conversion of the string to unicode and cleans
up/simplifies some code at the end of the PyObject_Unicode().

We really need a complete C API test module for all public APIs
and passing good and bad parameter values.
2006-03-14 06:10:22 +00:00
Georg Brandl
2f014f8d0b Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
(backport from rev. 43014)
2006-03-13 22:22:15 +00:00
Hye-Shik Chang
361cd4bd6c Backport r42894: SF #1444030 Fix several potential defects found
by Coverity.
2006-03-07 15:59:09 +00:00
Armin Rigo
0b61a45223 Backported from r41842. 2006-02-20 10:21:14 +00:00
Neal Norwitz
a3b5e99d8d Fix SF #1412837, compile failed with Watcom compiler 2006-01-24 06:08:23 +00:00
Neal Norwitz
7fb3aa7b3c Backport:
- Patch #1400181, fix unicode string formatting to not use the locale.
  This is how string objects work.  u'%f' could use , instead of .
  for the decimal point.  Now both strings and unicode always use periods.

This is the code that would break:

    import locale
    locale.setlocale(locale.LC_NUMERIC, 'de_DE')
    u'%.1f' % 1.0
    assert '1.0' == u'%.1f' % 1.0

I couldn't create a test case which fails, but this fixes the problem.
(tested in interpreter and reported fixed by others)
2006-01-10 06:05:57 +00:00
Hye-Shik Chang
cb92b45e41 Bug #1379994: Fix *unicode_escape codecs to encode r'\' as r'\\'
just like string codecs.
2005-12-17 04:38:31 +00:00
Walter Dörwald
cff983722a Backport checkin:
Fix leaked reference to None.
2005-11-28 22:16:22 +00:00
Neal Norwitz
c2b4acf494 Backport: SF bug #1331563 ] string_subscript doesn't check for failed PyMem_Malloc. 2005-10-20 04:16:45 +00:00
Guido van Rossum
b693c1cea0 - On 64-bit platforms, when __len__() returns a value that cannot be
represented as a C int, raise OverflowError.
(Will forward-port.)
2005-09-20 16:36:07 +00:00
Georg Brandl
39871c8927 backport patch [ 1118729 ] Error in representation of complex numbers(again) 2005-09-16 06:42:32 +00:00
Walter Dörwald
fd8e0170e2 Backport checkin:
SF bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
about illegal code points. The codec now supports PEP 293 style error handlers.
(This is a variant of the patch by Nik Haldimann that detects truncated data)
2005-08-30 10:46:06 +00:00