Commit Graph

85 Commits

Author SHA1 Message Date
Nick Coghlan ab7bf2143e Close issue #6210: Implement PEP 409 2012-02-26 17:49:52 +10:00
Benjamin Peterson 23d7f12ffb use new generic __dict__ descriptor implementations 2012-02-19 20:02:57 -05:00
Benjamin Peterson 67e700697e merge 3.2 2012-02-10 08:47:04 -05:00
Benjamin Peterson efe7c9d4d7 this is only a borrowed ref in Brett's branch 2012-02-10 08:46:54 -05:00
Benjamin Peterson 9878b63c7c merge 3.2 2012-02-06 11:30:05 -05:00
Benjamin Peterson 2f9c71bbba bltinmod is borrowed, so it shouldn't be decrefed 2012-02-06 11:28:45 -05:00
Benjamin Peterson 951138c795 merge 3.2 2012-02-03 19:25:01 -05:00
Benjamin Peterson 90b13583bc put returns on their own lines 2012-02-03 19:22:31 -05:00
Antoine Pitrou ac456a1839 Fix some of the remaining test_capi leaks 2012-01-18 21:35:21 +01:00
Antoine Pitrou 8b0a74e936 Fix some of the remaining test_capi refleaks 2012-01-18 21:29:05 +01:00
Antoine Pitrou 84091bfa45 Fix some of the refleaks in test_capi (ported from 3.2) 2012-01-18 21:24:18 +01:00
Antoine Pitrou 55f217f22d Fix refleaks in test_capi
(this was easier than I thought!)
2012-01-18 21:23:13 +01:00
Antoine Pitrou bb5b92d324 Merge refleak fixes from 3.2 2012-01-18 16:19:19 +01:00
Antoine Pitrou 1c7ade5284 Fix leaking a RuntimeError objects when creating sub-interpreters 2012-01-18 16:13:31 +01:00
Nick Coghlan 1f7ce62bd6 Implement PEP 380 - 'yield from' (closes #11682) 2012-01-13 21:43:40 +10:00
Antoine Pitrou e0e2735f41 Fix OSError.__init__ and OSError.__new__ so that each of them can be
overriden and take additional arguments (followup to issue #12555).
2011-12-15 14:31:28 +01:00
Victor Stinner 9e30aa52fd Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
And PyUnicode_GetSize() => PyUnicode_GetLength()
2011-11-21 02:49:52 +01:00
Victor Stinner 53b33e767d UnicodeTranslateError uses the new Unicode API
The index is a character index, not a index in a Py_UNICODE* string.
2011-11-21 01:17:27 +01:00
Victor Stinner da1ddf37c6 UnicodeEncodeError uses the new Unicode API
The index is a character index, not a index in a Py_UNICODE* string.
2011-11-20 22:50:23 +01:00
Martin v. Löwis b09af03b8a Port error handlers from Py_UNICODE indexing to code point indexing. 2011-11-04 11:16:41 +01:00
Antoine Pitrou 6b4883dec0 PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy. 2011-10-12 02:54:14 +02:00
Victor Stinner 31392e741d Fix my_basename(): make the string ready 2011-10-05 20:14:23 +02:00
Martin v. Löwis d63a3b8beb Implement PEP 393. 2011-09-28 07:41:54 +02:00
Victor Stinner 92236e5651 SystemExit_init(): avoid an useless test
Make silent a false positive of the Clang Static Analyzer.
2011-05-26 14:25:54 +02:00
Antoine Pitrou 07e20ef50b Issue #5437: A preallocated MemoryError instance should not hold traceback
data (including local variables caught in the stack trace) alive infinitely.
2010-10-28 22:56:58 +00:00
Georg Brandl 08be72d0aa Add a new warning gategory, ResourceWarning, as discussed on python-dev. It is silent by default,
except when configured --with-pydebug.

Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
2010-10-24 15:11:22 +00:00
Benjamin Peterson 285a689c8f Merged revisions 82157 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82157 | benjamin.peterson | 2010-06-22 14:16:37 -0500 (Tue, 22 Jun 2010) | 1 line

  remove INT_MAX assertions; they can fail with large Py_ssize_t #9058
........
2010-06-22 19:21:52 +00:00
Victor Stinner 7eeb5b5e50 Issue #8848: U / U# formats of Py_BuildValue() are just alias to s / s# 2010-06-07 19:57:46 +00:00
Antoine Pitrou f95a1b3c53 Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
2010-05-09 15:52:27 +00:00
Victor Stinner 6237daf8c5 Don't decode/recode the unicode filename in SyntaxError_str()
* Rewrite my_basename() to use unicode
 * Use '%U' format
2010-04-28 17:26:19 +00:00
Benjamin Peterson c5f4e1ecfd plug reference leak 2010-02-25 01:22:28 +00:00
Eric Smith 0facd77015 Merged revisions 78418 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78418 | eric.smith | 2010-02-24 09:15:36 -0500 (Wed, 24 Feb 2010) | 1 line

  Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
........
2010-02-24 15:42:29 +00:00
Benjamin Peterson 78565b2216 Merged revisions 73376,73393,73398,73400,73404-73405,73409,73419-73421,73432,73457,73460,73485-73486,73488-73489,73501-73502,73513-73514 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73376 | benjamin.peterson | 2009-06-11 17:29:23 -0500 (Thu, 11 Jun 2009) | 1 line

  remove check for case handled in sub-function
........
  r73393 | alexandre.vassalotti | 2009-06-12 13:56:57 -0500 (Fri, 12 Jun 2009) | 2 lines

  Clear reference to the static PyExc_RecursionErrorInst in _PyExc_Fini.
........
  r73398 | alexandre.vassalotti | 2009-06-12 15:57:12 -0500 (Fri, 12 Jun 2009) | 3 lines

  Add const qualifier to PyErr_SetFromErrnoWithFilename and to
  PyErr_SetFromErrnoWithUnicodeFilename.
........
  r73400 | alexandre.vassalotti | 2009-06-12 16:43:47 -0500 (Fri, 12 Jun 2009) | 2 lines

  Delete outdated make file for building the parser with MSVC 6.
........
  r73404 | benjamin.peterson | 2009-06-12 20:40:00 -0500 (Fri, 12 Jun 2009) | 1 line

  keep the slice.step field as NULL if no step expression is given
........
  r73405 | benjamin.peterson | 2009-06-12 22:46:30 -0500 (Fri, 12 Jun 2009) | 1 line

  prevent import statements from assigning to None
........
  r73409 | benjamin.peterson | 2009-06-13 08:06:21 -0500 (Sat, 13 Jun 2009) | 1 line

  allow importing from a module named None if it has an 'as' clause
........
  r73419 | benjamin.peterson | 2009-06-13 11:19:19 -0500 (Sat, 13 Jun 2009) | 1 line

  set Print.values to NULL if there are no values
........
  r73420 | benjamin.peterson | 2009-06-13 12:08:53 -0500 (Sat, 13 Jun 2009) | 1 line

  give a better error message when deleting ()
........
  r73421 | benjamin.peterson | 2009-06-13 15:23:33 -0500 (Sat, 13 Jun 2009) | 1 line

  when no module is given in a 'from' relative import, make ImportFrom.module NULL
........
  r73432 | amaury.forgeotdarc | 2009-06-14 16:20:40 -0500 (Sun, 14 Jun 2009) | 3 lines

  #6227: Because of a wrong indentation, the test was not testing what it should.
  Ensure that the snippet in doctest_aliases actually contains aliases.
........
  r73457 | benjamin.peterson | 2009-06-16 18:13:09 -0500 (Tue, 16 Jun 2009) | 1 line

  add underscores
........
  r73460 | benjamin.peterson | 2009-06-16 22:23:04 -0500 (Tue, 16 Jun 2009) | 1 line

  remove unused 'encoding' member from the compiler struct
........
  r73485 | benjamin.peterson | 2009-06-19 17:07:47 -0500 (Fri, 19 Jun 2009) | 1 line

  remove duplicate test
........
  r73486 | benjamin.peterson | 2009-06-19 17:09:17 -0500 (Fri, 19 Jun 2009) | 1 line

  add missing assertion #6313
........
  r73488 | benjamin.peterson | 2009-06-19 17:16:28 -0500 (Fri, 19 Jun 2009) | 1 line

  show that this one isn't used
........
  r73489 | benjamin.peterson | 2009-06-19 17:21:12 -0500 (Fri, 19 Jun 2009) | 1 line

  use closures
........
  r73501 | benjamin.peterson | 2009-06-21 18:01:07 -0500 (Sun, 21 Jun 2009) | 1 line

  don't need to add the name 'lambda' as assigned
........
  r73502 | benjamin.peterson | 2009-06-21 18:03:36 -0500 (Sun, 21 Jun 2009) | 1 line

  remove tmpname support since it's no longer used
........
  r73513 | benjamin.peterson | 2009-06-22 20:18:57 -0500 (Mon, 22 Jun 2009) | 1 line

  fix grammar
........
  r73514 | benjamin.peterson | 2009-06-22 22:01:56 -0500 (Mon, 22 Jun 2009) | 1 line

  remove some unused symtable constants
........
2009-06-28 19:19:51 +00:00
Georg Brandl 2c8600446d Merged revisions 73447-73448 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73447 | georg.brandl | 2009-06-16 19:41:33 +0200 (Di, 16 Jun 2009) | 1 line

  Add tabularcolumns directive for tables with bullet lists in them.
........
  r73448 | georg.brandl | 2009-06-16 19:43:44 +0200 (Di, 16 Jun 2009) | 1 line

  Remove unused macro.
........
2009-06-16 19:24:38 +00:00
Georg Brandl ab6f2f6eb6 Fix segfaults when running test_exceptions with coverage tracing, caused by wrongly defining Exception.__context__ as a T_OBJECT structmember which does not set the member to NULL on None assignment, and generally does not do type checks. This could be used to crash the interpreter by setting any object to __context__. The same applies to __cause__. Also document the PyException_* functions. 2009-03-31 04:16:10 +00:00
Benjamin Peterson f91df0465d Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r69364 | kristjan.jonsson | 2009-02-06 04:17:34 -0600 (Fri, 06 Feb 2009) | 1 line

  Fix a number of Win32ErrorTests error cases.  chmod wasn't being tested.  'access' never raises an error.
........
  r69365 | armin.rigo | 2009-02-06 05:46:26 -0600 (Fri, 06 Feb 2009) | 2 lines

  Ivan on IRC in #twisted reported this crasher.
........
  r69409 | georg.brandl | 2009-02-07 06:21:17 -0600 (Sat, 07 Feb 2009) | 1 line

  #5174: fix wrong file closing in example.
........
  r69410 | neil.schemenauer | 2009-02-07 08:53:31 -0600 (Sat, 07 Feb 2009) | 4 lines

  Fix broken test in test_hotshot.  Treating the current directory as an
  empty file is sloppy and non-portable.  Use NamedTemporaryFile to make
  an empty file.
........
  r69413 | neil.schemenauer | 2009-02-07 12:35:16 -0600 (Sat, 07 Feb 2009) | 2 lines

  Add test for issue #999042, explict global statement works.
........
  r69417 | benjamin.peterson | 2009-02-07 17:01:19 -0600 (Sat, 07 Feb 2009) | 1 line

  document individual 2to3 fixers
........
  r69435 | benjamin.peterson | 2009-02-08 08:38:13 -0600 (Sun, 08 Feb 2009) | 1 line

  document numliterals fixer
........
  r69442 | benjamin.peterson | 2009-02-08 09:14:57 -0600 (Sun, 08 Feb 2009) | 1 line

  a few edits and typos
........
  r69447 | vinay.sajip | 2009-02-08 13:06:08 -0600 (Sun, 08 Feb 2009) | 2 lines

  Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5.
........
  r69495 | kristjan.jonsson | 2009-02-10 07:32:24 -0600 (Tue, 10 Feb 2009) | 1 line

  Issue 4804.  Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions.
........
  r69519 | gregory.p.smith | 2009-02-11 17:45:25 -0600 (Wed, 11 Feb 2009) | 3 lines

  Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even
  on LP64 platforms (most 64-bit Linux, bsd, unix systems).
........
  r69520 | benjamin.peterson | 2009-02-11 21:50:00 -0600 (Wed, 11 Feb 2009) | 1 line

  os.fsync() should be used to ensure that data is written to disk
........
  r69521 | benjamin.peterson | 2009-02-11 22:17:04 -0600 (Wed, 11 Feb 2009) | 1 line

  no need for this __bases__ trick anymore
........
2009-02-13 02:50:59 +00:00
Mark Dickinson e94c679df0 Issue #1717: rename tp_compare to tp_reserved. I'll change the
type of tp_compare in a separate commit, for ease of reversion
should things go wrong.
2009-02-02 20:36:42 +00:00
Benjamin Peterson b58dda7bdb Merged revisions 68633,68648,68667,68706,68718,68720-68721,68724-68727,68739 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68633 | thomas.heller | 2009-01-16 12:53:44 -0600 (Fri, 16 Jan 2009) | 3 lines

  Change an example in the docs to avoid a mistake when the code is copy
  pasted and changed afterwards.
........
  r68648 | benjamin.peterson | 2009-01-16 22:28:57 -0600 (Fri, 16 Jan 2009) | 1 line

  use enumerate
........
  r68667 | amaury.forgeotdarc | 2009-01-17 14:18:59 -0600 (Sat, 17 Jan 2009) | 3 lines

  #4077: No need to append \n when calling Py_FatalError
  + fix a declaration to make it match the one in pythonrun.h
........
  r68706 | benjamin.peterson | 2009-01-17 19:28:46 -0600 (Sat, 17 Jan 2009) | 1 line

  fix grammar
........
  r68718 | georg.brandl | 2009-01-18 04:42:35 -0600 (Sun, 18 Jan 2009) | 1 line

  #4976: union() and intersection() take multiple args, but talk about "the other".
........
  r68720 | georg.brandl | 2009-01-18 04:45:22 -0600 (Sun, 18 Jan 2009) | 1 line

  #4974: fix redundant mention of lists and tuples.
........
  r68721 | georg.brandl | 2009-01-18 04:48:16 -0600 (Sun, 18 Jan 2009) | 1 line

  #4914: trunc is in math.
........
  r68724 | georg.brandl | 2009-01-18 07:24:10 -0600 (Sun, 18 Jan 2009) | 1 line

  #4979: correct result range for some random functions.
........
  r68725 | georg.brandl | 2009-01-18 07:47:26 -0600 (Sun, 18 Jan 2009) | 1 line

  #4857: fix augmented assignment target spec.
........
  r68726 | georg.brandl | 2009-01-18 08:41:52 -0600 (Sun, 18 Jan 2009) | 1 line

  #4923: clarify what was added.
........
  r68727 | georg.brandl | 2009-01-18 12:25:30 -0600 (Sun, 18 Jan 2009) | 1 line

  #4986: augassigns are not expressions.
........
  r68739 | benjamin.peterson | 2009-01-18 15:11:38 -0600 (Sun, 18 Jan 2009) | 1 line

  fix test that wasn't working as expected #4990
........
2009-01-18 22:27:04 +00:00
Marc-André Lemburg 4cc0f24857 Rename PyUnicode_AsString -> _PyUnicode_AsString and
PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark
them for interpreter internal use only.

We'll have to rework these APIs or create new ones for the
purpose of accessing the UTF-8 representation of Unicode objects
for 3.1.
2008-08-07 18:54:33 +00:00
Benjamin Peterson 2b968d6187 #3295 actually define PyExc_BufferError 2008-07-05 23:38:30 +00:00
Martin v. Löwis 1a21451b1d Implement PEP 3121: new module initialization and finalization API. 2008-06-11 05:26:20 +00:00
Christian Heimes 72b710a596 Renamed PyString to PyBytes 2008-05-26 13:28:38 +00:00
Georg Brandl 7694100e4b Give with_traceback a docstring. 2008-05-05 21:38:47 +00:00
Christian Heimes 90aa7646af #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. 2007-12-19 02:45:37 +00:00
Martin v. Löwis d1a1d1ed80 Remove PyInt_CheckExact. Add PyLong_AsLongAndOverflow. 2007-12-04 22:10:37 +00:00
Christian Heimes cbf3b5cb76 Merged revisions 59275-59303 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NOTE: The merge does NOT contain the modified file Python/import.c from
      r59288. I can't get it running. Nick, please check in the PEP 366
      manually.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

........
  r59279 | georg.brandl | 2007-12-02 19:17:50 +0100 (Sun, 02 Dec 2007) | 2 lines

  Fix a sentence I missed before. Do not merge to 3k.
........
  r59281 | georg.brandl | 2007-12-02 22:58:54 +0100 (Sun, 02 Dec 2007) | 3 lines

  Add documentation for PySys_* functions.
  Written by Charlie Shepherd for GHOP. Also fixes #1245.
........
  r59288 | nick.coghlan | 2007-12-03 13:55:17 +0100 (Mon, 03 Dec 2007) | 1 line

  Implement PEP 366
........
  r59290 | christian.heimes | 2007-12-03 14:47:29 +0100 (Mon, 03 Dec 2007) | 3 lines

  Applied my patch #1455 with some extra fixes for VS 2005
  The new msvc9compiler module supports VS 2005 and VS 2008. I've also fixed build_ext to support PCbuild8 and PCbuild9 and backported my fix for xxmodule.c from py3k. The old code msvccompiler is still in place in case somebody likes to build an extension with VS 2003 or earlier.
  I've also updated the cygwin compiler module for VS 2005 and VS 2008. It works with VS 2005 but I'm unable to test it with VS 2008. We have to wait for a new version of cygwin.
........
  r59291 | christian.heimes | 2007-12-03 14:55:16 +0100 (Mon, 03 Dec 2007) | 1 line

  Added comment to Misc/NEWS for r59290
........
  r59292 | christian.heimes | 2007-12-03 15:28:04 +0100 (Mon, 03 Dec 2007) | 1 line

  I followed MA Lemberg's suggestion and added comments to the late initialization of the type slots.
........
  r59293 | facundo.batista | 2007-12-03 17:29:52 +0100 (Mon, 03 Dec 2007) | 3 lines


  Speedup and cleaning of __str__.  Thanks Mark Dickinson.
........
  r59294 | facundo.batista | 2007-12-03 18:55:00 +0100 (Mon, 03 Dec 2007) | 4 lines


  Faster _fix function, and some reordering for a more elegant
  coding. Thanks Mark Dickinson.
........
  r59295 | martin.v.loewis | 2007-12-03 20:20:02 +0100 (Mon, 03 Dec 2007) | 5 lines

  Issue #1727780: Support loading pickles of random.Random objects created
  on 32-bit systems on 64-bit systems, and vice versa. As a consequence
  of the change, Random pickles created by Python 2.6 cannot be loaded
  in Python 2.5.
........
  r59297 | facundo.batista | 2007-12-03 20:49:54 +0100 (Mon, 03 Dec 2007) | 3 lines


  Two small fixes. Issue 1547.
........
  r59299 | georg.brandl | 2007-12-03 20:57:02 +0100 (Mon, 03 Dec 2007) | 2 lines

  #1548: fix apostroph placement.
........
  r59300 | christian.heimes | 2007-12-03 21:01:02 +0100 (Mon, 03 Dec 2007) | 3 lines

  Patch #1537 from Chad Austin
  Change GeneratorExit's base class from Exception to BaseException
  (This time I'm applying the patch to the correct sandbox.)
........
  r59302 | georg.brandl | 2007-12-03 21:03:46 +0100 (Mon, 03 Dec 2007) | 3 lines

  Add examples to the xmlrpclib docs.
  Written for GHOP by Josip Dzolonga.
........
2007-12-03 21:02:03 +00:00
Christian Heimes f9290773fc Reverting last commit. I had some staled data from an attempted svnmerge in my local sandbox 2007-12-03 19:53:57 +00:00
Christian Heimes e69c320d48 Patch #1537 from Chad Austin
Change GeneratorExit's base class from Exception to BaseException
2007-12-03 19:47:54 +00:00
Christian Heimes 217cfd1c86 Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h 2007-12-02 14:31:20 +00:00
Georg Brandl 1a3284ed69 #1535: rename __builtin__ module to builtins. 2007-12-02 09:40:06 +00:00