Commit Graph

3397 Commits

Author SHA1 Message Date
Antoine Pitrou 5a72e76b69 Merged revisions 87834 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87834 | antoine.pitrou | 2011-01-07 22:43:59 +0100 (ven., 07 janv. 2011) | 5 lines

  Issue #8020: Avoid a crash where the small objects allocator would read
  non-Python managed memory while it is being modified by another thread.
  Patch by Matt Bandy.
........
2011-01-07 21:49:44 +00:00
Mark Dickinson ecf8ec67ce Merged revisions 87032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87032 | mark.dickinson | 2010-12-04 12:25:30 +0000 (Sat, 04 Dec 2010) | 3 lines

  Issue #10596: Fix float.__mod__ to have the same behaviour as
  float.__divmod__ with respect to signed zeros.
........
2010-12-04 12:30:41 +00:00
Stefan Krah 918c90ce06 Merged revisions 86791 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86791 | stefan.krah | 2010-11-26 11:54:09 +0100 (Fri, 26 Nov 2010) | 1 line

  Indentation cleanup.
........
2010-11-26 11:03:55 +00:00
Armin Rigo 39e32a7e81 Revert r86726. Sorry about interfering with the rc. 2010-11-24 13:17:48 +00:00
Armin Rigo 442e4477fe A no-op change. It looks like this call was not meant to be a recursive
call, but just call the helper (which the recursive call ends up doing).
2010-11-24 10:39:23 +00:00
Eric Smith 6c84085cfb Improved docstrings for str and unicode methods format and __format__. 2010-11-06 19:43:44 +00:00
Jesus Cea 33c722b795 CObject use is marked as a Py3k warning, not a deprecation warning 2010-11-04 21:39:52 +00:00
Raymond Hettinger 2ad17e19ee Issue 10221: Improve error message for dict.pop(). 2010-10-30 08:17:46 +00:00
Antoine Pitrou 638cee62d5 Issue #9295: Fix a crash under Windows when calling close() on a file
object with custom buffering from two threads at once.
2010-10-28 14:50:57 +00:00
Benjamin Peterson bf775542b0 iterators passed to writelines() can close their files; don't segfault #10125 2010-10-16 19:20:12 +00:00
Benjamin Peterson dc9542435b Merged revisions 85392 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85392 | benjamin.peterson | 2010-10-12 17:57:59 -0500 (Tue, 12 Oct 2010) | 1 line

  prefer clearing global objects to obscure module.__dict__ bugs #10068
........
2010-10-12 23:02:35 +00:00
Benjamin Peterson 35c6be0b74 Merged revisions 85193 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85193 | benjamin.peterson | 2010-10-02 21:13:39 -0500 (Sat, 02 Oct 2010) | 1 line

  typo
........
2010-10-03 02:17:04 +00:00
Benjamin Peterson a5d5cc45c9 Merged revisions 85154 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85154 | benjamin.peterson | 2010-10-01 19:03:31 -0500 (Fri, 01 Oct 2010) | 1 line

  type.__abstractmethods__ should raise an AttributeError #10006
........
2010-10-02 00:08:58 +00:00
Mark Dickinson cb61e5d9b5 Issue #9869: Make long() and PyNumber_Long return something of type
long for a class whose __long__ method returns a plain int.  This
fixes an interpreter crash (due to long_subtype_new assuming
PyNumber_Long returns a long) when initializing an instance of a long
subclass from an object whose __long__ method returns a plain int.
2010-09-26 10:37:12 +00:00
Victor Stinner caafd77060 Issue #4947: The write() method of sys.stdout and sys.stderr uses their
encoding and errors attributes instead of using utf-8 in strict mode, to get
the same behaviour than the print statement.
2010-09-08 10:51:01 +00:00
Antoine Pitrou 9cf85f144e Merged revisions 84408-84409 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84408 | antoine.pitrou | 2010-09-01 23:14:16 +0200 (mer., 01 sept. 2010) | 4 lines

  Issue #9737: Fix a crash when trying to delete a slice or an item from
  a memoryview object.
........
  r84409 | antoine.pitrou | 2010-09-01 23:14:46 +0200 (mer., 01 sept. 2010) | 3 lines

  Fix a compilation warning
........
2010-09-01 21:17:34 +00:00
Antoine Pitrou 1fcdba84be Merged revisions 84391 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84391 | antoine.pitrou | 2010-09-01 14:58:21 +0200 (mer., 01 sept. 2010) | 5 lines

  Issue #3101: Helper functions _add_one_to_C() and _add_one_to_F() become
  _Py_add_one_to_C() and _Py_add_one_to_F(), respectively.
........
2010-09-01 13:02:50 +00:00
Antoine Pitrou a408350a08 Merged revisions 84344 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84344 | antoine.pitrou | 2010-08-28 20:17:03 +0200 (sam., 28 août 2010) | 4 lines

  Issue #1868: Eliminate subtle timing issues in thread-local objects by
  getting rid of the cached copy of thread-local attribute dictionary.
........
2010-08-28 18:29:13 +00:00
Benjamin Peterson 6f3d6a9b23 Merged revisions 84320 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84320 | benjamin.peterson | 2010-08-25 18:13:17 -0500 (Wed, 25 Aug 2010) | 1 line

  basicsize and itemsize are Py_ssize_t #9688
........
2010-08-25 23:17:42 +00:00
Alexander Belopolsky b8de9fab30 Merged revisions 84106 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84106 | alexander.belopolsky | 2010-08-16 16:17:07 -0400 (Mon, 16 Aug 2010) | 1 line

  Issue #8983: Corrected docstrings.
........
2010-08-16 20:30:26 +00:00
Florent Xicluna 172e15fdd6 Merged revisions 83833,83838-83839,83859,83878 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83833 | florent.xicluna | 2010-08-08 18:25:27 +0200 (dim., 08 août 2010) | 2 lines

  Add test case for the HTTPResponse being an iterable.  Follow-up of issue #4608.
........
  r83838 | florent.xicluna | 2010-08-08 20:03:44 +0200 (dim., 08 août 2010) | 2 lines

  Typo.
........
  r83839 | florent.xicluna | 2010-08-08 20:06:13 +0200 (dim., 08 août 2010) | 2 lines

  Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
........
  r83859 | florent.xicluna | 2010-08-09 00:07:16 +0200 (lun., 09 août 2010) | 2 lines

  Fix #8530: Prevent stringlib fastsearch from reading beyond the front of an array.
........
  r83878 | florent.xicluna | 2010-08-09 10:29:08 +0200 (lun., 09 août 2010) | 1 line

  Merge the 2to3 script from /sandbox/trunk/2to3/2to3, revision 72867 (latest).
........
2010-08-09 20:02:00 +00:00
Raymond Hettinger 3ad323ecaf Issue8757: Implicit set-to-frozenset conversion not thread-safe. 2010-08-06 10:18:56 +00:00
Georg Brandl d070cc5350 Merged revisions 83226-83227,83229-83230,83232 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83226 | georg.brandl | 2010-07-29 16:17:12 +0200 (Do, 29 Jul 2010) | 1 line

  #1090076: explain the behavior of *vars* in get() better.
........
  r83227 | georg.brandl | 2010-07-29 16:23:06 +0200 (Do, 29 Jul 2010) | 1 line

  Use Py_CLEAR().
........
  r83229 | georg.brandl | 2010-07-29 16:32:22 +0200 (Do, 29 Jul 2010) | 1 line

  #9407: document configparser.Error.
........
  r83230 | georg.brandl | 2010-07-29 16:36:11 +0200 (Do, 29 Jul 2010) | 1 line

  Use correct directive and name.
........
  r83232 | georg.brandl | 2010-07-29 16:49:08 +0200 (Do, 29 Jul 2010) | 1 line

  #9388: remove ERA_YEAR which is never defined in the source code.
........
2010-08-01 21:06:46 +00:00
Georg Brandl e27d044769 Recorded merge of revisions 83444 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83444 | georg.brandl | 2010-08-01 22:51:02 +0200 (So, 01 Aug 2010) | 1 line

  Revert r83395, it introduces test failures and is not necessary anyway since we now have to nul-terminate the string anyway.
........
2010-08-01 20:54:30 +00:00
Georg Brandl 09f0d60f7c Merged revisions 83395 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83395 | georg.brandl | 2010-08-01 10:49:18 +0200 (So, 01 Aug 2010) | 1 line

  #8821: do not rely on Unicode strings being terminated with a \u0000, rather explicitly check range before looking for a second surrogate character.
........
2010-08-01 18:41:59 +00:00
Mark Dickinson aad57bd1bb Merged revisions 83400 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83400 | mark.dickinson | 2010-08-01 11:41:49 +0100 (Sun, 01 Aug 2010) | 7 lines

  Issue #9416: Fix some issues with complex formatting where the
  output with no type specifier failed to match the str output:

    - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
    - format(complex(0.0, 2.0), '-') included a sign and parentheses.
........
2010-08-01 10:45:15 +00:00
Georg Brandl 05f819b6e9 #9328: string format methods return strings. 2010-07-31 19:07:37 +00:00
Stefan Krah 0b9201fa1c Sub-issue of #9036: Fix incorrect use of Py_CHARMASK. 2010-07-19 18:06:46 +00:00
Antoine Pitrou 3266978300 Merged revisions 82814 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82814 | antoine.pitrou | 2010-07-11 14:12:00 +0200 (dim., 11 juil. 2010) | 4 lines

  Issue #7616: Fix copying of overlapping memoryview slices with the Intel
  compiler.
........
2010-07-11 12:14:05 +00:00
Senthil Kumaran 5261b10556 Merged revisions 82573 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82573 | senthil.kumaran | 2010-07-05 17:30:56 +0530 (Mon, 05 Jul 2010) | 3 lines

  Fix the docstrings of the capitalize method.
........
2010-07-05 12:04:07 +00:00
Benjamin Peterson cf76d1f0c7 add space 2010-07-02 19:41:39 +00:00
Benjamin Peterson 4c5bc4d7f8 remove unused last argument to property_copy 2010-06-28 02:58:25 +00:00
Ezio Melotti 2f06b78d61 Fix extra space. 2010-06-26 18:44:42 +00:00
Benjamin Peterson b91338960e remove INT_MAX assertions; they can fail with large Py_ssize_t #9058 2010-06-22 19:16:37 +00:00
Benjamin Peterson 8e5effaaa4 fix warning with ucs4 2010-06-12 17:47:06 +00:00
Antoine Pitrou cca3a3f396 Issue #8941: decoding big endian UTF-32 data in UCS-2 builds could crash
the interpreter with characters outside the Basic Multilingual Plane
(higher than 0x10000).
2010-06-11 21:42:26 +00:00
Antoine Pitrou 619f16e194 Issue #8930: fix some C code indentation 2010-06-09 16:24:00 +00:00
Benjamin Peterson 7dbe3e31c1 remove extra byte and fix comment 2010-06-07 22:32:44 +00:00
Benjamin Peterson 13e934acc0 correctly overflow when indexes are too large 2010-06-07 22:23:23 +00:00
Benjamin Peterson c4afe2950a locale grouping strings should end in '\0' 2010-06-07 21:37:09 +00:00
Ezio Melotti e57e50c8e7 Update PyUnicode_DecodeUTF8 from RFC 2279 to RFC 3629.
1) #8271: when a byte sequence is invalid, only the start byte and all the
   valid continuation bytes are now replaced by U+FFFD, instead of replacing
   the number of bytes specified by the start byte.
   See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (pages 94-95);
2) 5- and 6-bytes-long UTF-8 sequences are now considered invalid (no changes
   in behavior);
3) Add code and tests to reject surrogates (U+D800-U+DFFF) as defined in
   RFC 3629, but leave it commented out since it's not backward compatible;
4) Change the error messages "unexpected code byte" to "invalid start byte"
   and "invalid data" to "invalid continuation byte";
5) Add an extensive set of tests in test_unicode;
6) Fix test_codeccallbacks because it was failing after this change.
2010-06-05 17:51:07 +00:00
Mark Dickinson 77acee9567 Fix comment typo. 2010-06-05 12:51:21 +00:00
Mark Dickinson e4b83e013b Issue #8627: Fix "XXX undetected error" from unchecked PyErr_WarnPy3k return.
This is just a quick fix:  if the warning is turned into an exception, the
exception simply gets ignored.
2010-06-05 12:14:43 +00:00
Mark Dickinson 23f0d6b57b Issue #8627: remove out-of-date warning about overriding __cmp__ 2010-06-05 11:52:24 +00:00
Benjamin Peterson d5adb5d73d _PyObject_LookupSpecial returns a new reference 2010-06-05 02:07:01 +00:00
Benjamin Peterson 67783b1f71 fix ref counting 2010-06-05 01:00:10 +00:00
Benjamin Peterson 039c585805 implement object.__format__ with PyObject_Format 2010-06-05 00:56:46 +00:00
Benjamin Peterson 3a2acb5040 remove PyType_Ready call; float should be initialized in interpreter startup 2010-06-05 00:38:22 +00:00
Benjamin Peterson 2aa6c38237 properly lookup the __format__ special method 2010-06-05 00:32:50 +00:00
Mark Dickinson 4ca7c3c089 Issue #8748: Fix incorrect results from comparisons between an integer
and a complex instance.  Based on a patch by Meador Inge.
2010-05-30 13:18:10 +00:00
Mark Dickinson 4b3035d0b8 Remove declaration for unused variable. 2010-05-30 12:17:11 +00:00
Mark Dickinson 813363743d Issue #5211: Complete removal of implicit coercions for the complex
type.  Coercion for arithmetic operations was already removed in
r78280, but that commit didn't remove coercion for rich comparisons.
2010-05-30 12:12:25 +00:00
Georg Brandl 54d2898ef8 #8635: document enumerate() start parameter in docstring. 2010-05-22 11:43:25 +00:00
Antoine Pitrou 83137c2e16 Issue #7079: Fix a possible crash when closing a file object while using
it from another thread.  Patch by Daniel Stutzbach.
2010-05-17 19:56:59 +00:00
Mark Dickinson 43ca377e45 Wrap multiline macros in a 'do {} while(0)', for safety. 2010-05-09 20:42:09 +00:00
Mark Dickinson fda8d114ea Post-detabification cleanup: whitespace fixes and long line rewraps only. 2010-05-09 20:30:29 +00:00
Antoine Pitrou c83ea137d7 Untabify C files. Will watch buildbots. 2010-05-09 14:46:46 +00:00
Mark Dickinson 22ff664ff7 Issue #8659: Remove redundant ABS calls. Thanks Daniel Stutzbach. 2010-05-08 08:01:19 +00:00
Brett Cannon a8ac944924 Add back in a line that was unneeded which advanced a pointer, but commented
out as it is currently unneeded.

This effectively adds back in the line removed in r80809 as a comment.
2010-05-06 17:56:36 +00:00
Brett Cannon 8a478ced55 Remove an unneeded assignment.
Found using Clang's static analyzer.
2010-05-05 20:19:26 +00:00
Brett Cannon fee3acb082 Remove an unneeded variable assignment.
Found using Clang's static analyzer.
2010-05-05 20:18:23 +00:00
Brett Cannon eb3fef59b9 Remove an unneeded variable.
Found using Clang's static analyzer.
2010-05-05 20:16:50 +00:00
Brett Cannon 6f38175cbc Remove an unneeded variable increment.
Found using Clang's static analyzer.
2010-05-05 20:16:09 +00:00
Alexandre Vassalotti 268e4872d3 Issue #8404: Fix set operations on dictionary views. 2010-05-04 03:21:51 +00:00
Brett Cannon 0d8a859a85 Pull a NULL pointer check up to cover more cases in the function.
Found using Clang's static analyzer.
2010-05-04 01:23:36 +00:00
Brett Cannon a7f13ee3f5 Remove an unneeded variable and assignment.
Found using Clang's static analyzer.
2010-05-04 01:16:51 +00:00
Mark Dickinson 328284adcf Improve error message from nb_int returning a non-integer, in various PyInt_As* functions: 2010-05-02 09:38:43 +00:00
Raymond Hettinger 35b76027f9 Issue 8436: set.__init__ accepts keyword args 2010-04-18 22:57:57 +00:00
Benjamin Peterson ae530c2bab tiny simplification 2010-04-16 22:52:44 +00:00
Benjamin Peterson 821a8ea39f have a clear error when passing something > sys.maxsize to bytearray 2010-04-16 22:35:38 +00:00
Stefan Krah ef7590e943 Issue #8328: Silence Visual Studio warnings. 2010-04-07 08:24:44 +00:00
Mark Dickinson ea7e5510aa Silence a 'comparison between signed and unsigned integer expressions' gcc warning. 2010-04-06 18:58:54 +00:00
Mark Dickinson 3ec9b942b5 Issue #8259: Get rid of 'outrageous left shift count' error when
left-shifting an integer by more than 2**31 on a 64-bit machine.  Also
convert shift counts to a Py_ssize_t instead of a C long.
2010-04-06 16:46:09 +00:00
Mark Dickinson 56506a6ed2 Use a better NaN test in _Py_HashDouble as well. 2010-04-05 18:54:51 +00:00
Mark Dickinson 5e0c2748fb Use a more robust infinity check in _Py_HashDouble.
This fixes a test_decimal failure on FreeBSD 8.0.  (modf apparently
doesn't follow C99 Annex F on FreeBSD.)
2010-04-05 18:07:51 +00:00
Raymond Hettinger 30583e3f38 Silence a compiler warning. 2010-04-03 17:10:05 +00:00
Benjamin Peterson bea424af98 more _PyString_Resize error checking 2010-04-03 00:57:33 +00:00
Benjamin Peterson 6caf7ff505 always check _PyString_Resize for error
also normalize how this error is checked
2010-04-02 23:59:41 +00:00
Eric Smith d44b2fc87c Issue 7994: Make object.__format__ with a non-empty format string a PendingDecprecationWarning. Still need to remove uses of this from various tests. 2010-04-02 12:30:56 +00:00
Larry Hastings 5ac006dfd3 Capsule-related changes:
* PyCObject_AsVoidPtr() can now open capsules.  This addresses
  most of the remaining backwards-compatibility concerns about
  the conversion of Python 2.7 from CObjects to capsules.
* CObjects were marked Pending Deprecation.
* Documentation about this pending deprecation was added to
  cobject.h.
* The capsule source files were added to the legacy PC build
  processes.
2010-04-02 11:01:35 +00:00
Antoine Pitrou a57df2cf1d Issue #8268: Old-style classes (not just instances) now support weak
references.
2010-03-31 21:32:15 +00:00
Florent Xicluna 22b243809e #7643: Unicode codepoints VT (0x0B) and FF (0x0C) are linebreaks according to Unicode Standard Annex #14. 2010-03-30 08:24:06 +00:00
Larry Hastings 402b73fb8d Backported PyCapsule from 3.1, and converted most uses of
CObject to PyCapsule.
2010-03-25 00:54:54 +00:00
Victor Stinner 95affc4449 Issue #1583863: An unicode subclass can now override the __str__ method 2010-03-22 12:24:37 +00:00
Collin Winter 001a3952c9 Add support for weak references to code objects. This will be used by an optimization in the incoming Python 3 JIT.
Patch by Reid Kleckner!
2010-03-18 21:54:01 +00:00
Florent Xicluna 2e0a53fdf6 Issue #8024: Update the Unicode database to 5.2 2010-03-18 21:50:06 +00:00
Victor Stinner 17d905449d Issue #7818: set().test_c_api() doesn't expect a set('abc'), modify the set. 2010-03-13 00:13:22 +00:00
Ezio Melotti fb501123e3 #8030: more docstring fix for builtin types. 2010-02-28 23:59:00 +00:00
Georg Brandl b36e63a5ee The set types can also be called without arguments. 2010-02-28 18:26:37 +00:00
Georg Brandl bca1169e94 #8030: make builtin type docstrings more consistent: use "iterable" instead of "seq(uence)", use "new" to show that set() always returns a new object. 2010-02-28 18:19:17 +00:00
Ezio Melotti 321251567e #7649: "u'%c' % char" now behaves like "u'%s' % char" and raises a UnicodeDecodeError if 'char' is a byte string that can't be decoded using the default encoding. 2010-02-25 17:36:04 +00:00
Eric Smith 2d9856d6ce Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings. 2010-02-24 14:15:36 +00:00
Victor Stinner f20f9c299e Issue #7649: Fix u'%c' % char for character in range 0x80..0xFF
=> raise an UnicodeDecodeError. Patch written by Ezio Melotti.
2010-02-23 23:16:07 +00:00
Eric Smith 87bcb243ac Issue #6902: Fix problem with built-in types format incorrectly with 0 padding. 2010-02-23 00:11:16 +00:00
Andrew M. Kuchling 00b6a5c03d #7706: DONT_HAVE_ERRNO_H is no longer defined by configure (after rev.46819). 2010-02-22 23:10:52 +00:00
Eric Smith f32d4acead Issue #7988: Fix default alignment to be right aligned for complex.__format__. Now it matches other numeric types. 2010-02-22 18:33:47 +00:00
Ezio Melotti bce3e17bd2 #7482: clarify error message in case of division by zero of float and complex numbers. 2010-02-22 16:30:58 +00:00
Mark Dickinson 82b34c5dbe Issue #5211: Fix complex type to avoid implicit calls to
complex.__coerce__.  Thanks Meador Inge for the patch.
2010-02-21 12:57:35 +00:00
Mark Dickinson 2d7911eda4 Silence more compiler warnings; fix an instance of potential undefined behaviour from signed overflow. 2010-02-14 12:31:26 +00:00
Mark Dickinson ac5685eb67 Silence some 'comparison between signed and unsigned' compiler warnings. 2010-02-14 12:16:43 +00:00