Commit Graph

671 Commits

Author SHA1 Message Date
Serhiy Storchaka 1009bf18b3 Issue #23501: Argumen Clinic now generates code into separate files by default. 2015-04-03 23:53:51 +03:00
Victor Stinner 0c39b1b970 Initialize variables to prevent GCC warnings 2015-03-18 15:02:06 +01:00
Serhiy Storchaka 3dd3e26680 Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
and PyObject_AsWriteBuffer().
2015-02-03 01:25:42 +02:00
Serhiy Storchaka 4fdb68491e Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
and PyObject_AsWriteBuffer().
2015-02-03 01:21:08 +02:00
Serhiy Storchaka d8a1447c99 Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
2014-09-06 20:07:17 +03:00
Nick Coghlan f9e227e5a9 Issue #20184: Add signature introspection for 30 of the builtins
Also adds a test to test_inspect to track progress on builtin
introspection support, to ensure it doesn't regress in the future.
2014-08-17 14:01:19 +10:00
Victor Stinner 98ea54c35c Issue #22156: Fix "comparison between signed and unsigned integers" compiler
warnings in the Python/ subdirectory.
2014-08-15 23:30:40 +02:00
Zachary Ware 9b33872812 Issue #22146: Fix typo in __build_class__ error message 2014-08-05 14:01:10 -05:00
Terry Jan Reedy f2fb73f675 Issue #19362: Tweek len() doc and docstring to expand the indicated range of
arguments. Original patch by Gareth Rees.
2014-06-16 03:05:37 -04:00
Raymond Hettinger 2a54582d72 Issue 20620: Update the min()/max() docs for the new default argument.
Patch provided by Berker Peksag.
2014-05-19 22:20:52 +01:00
Benjamin Peterson 5edbb7b7a4 correct len signature in docstring (closes #21294) 2014-04-18 01:03:59 -04:00
Larry Hastings 5c66189e88 Issue #20189: Four additional builtin types (PyTypeObject,
PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type)
have been modified to provide introspection information for builtins.
Also: many additional Lib, test suite, and Argument Clinic fixes.
2014-01-24 06:17:25 -08:00
Benjamin Peterson d45a46b60d merge 3.3 (#19910) 2013-12-06 20:12:51 -05:00
Benjamin Peterson 933142a8f2 document that compile() can take bytes (closes #19910) 2013-12-06 20:12:39 -05:00
Zachary Ware a4b7a7548c Issue #3158: doctest can now find doctests in functions and methods
written in C.

As a part of this, a few doctests have been added to the builtins module
(on hex(), oct(), and bin()), a doctest has been fixed (hopefully on all
platforms) on float, and test_builtins now runs doctests in builtins.
2013-11-24 01:19:09 -06:00
Victor Stinner bd303c165b Issue #19512, #19515: remove shared identifiers, move identifiers where they
are used.

Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
2013-11-07 23:07:29 +01:00
Victor Stinner eaa2883d15 Issue #19512: builtin print() function uses an identifier instead of literal
string "flush" to call the flush method
2013-11-07 00:01:51 +01:00
Victor Stinner ae9f161b43 Issue #19512: __build_class() builtin now uses an identifier for the "metaclass" string 2013-11-06 22:46:51 +01:00
Victor Stinner 090543736f Issue #19512: add some common identifiers to only create common strings once,
instead of creating temporary Unicode string objects

Add also more identifiers in pythonrun.c to avoid temporary Unicode string
objets for the interactive interpreter.
2013-11-06 22:41:44 +01:00
Victor Stinner b44562b6b9 Issue #19512: eval() and exec() now use an identifier for "__builtins__" string 2013-11-06 19:03:11 +01:00
Victor Stinner 41bb43a71e Issue #18408: Add a new PyFrame_FastToLocalsWithError() function to handle
exceptions when merging fast locals into f_locals of a frame.
PyEval_GetLocals() now raises an exception and return NULL on failure.
2013-10-29 01:19:37 +01:00
Serhiy Storchaka c679227e31 Issue #1772673: The type of `char*` arguments now changed to `const char*`. 2013-10-19 21:03:34 +03:00
Serhiy Storchaka 46e1ce214b Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
2013-08-27 20:17:03 +03:00
Serhiy Storchaka 9594942716 Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
2013-08-27 19:40:23 +03:00
Victor Stinner 14e461d5b9 Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
2013-08-26 22:28:21 +02:00
Christian Heimes 4ebf6d7c3c Issue #18560: Fix potential NULL pointer dereference in sum() 2013-07-26 22:50:01 +02:00
Christian Heimes 704e2d374f Issue #18560: Fix potential NULL pointer dereference in sum() 2013-07-26 22:49:26 +02:00
Victor Stinner 1e53bbaced Issue #18408: handle PySys_GetObject() failure, raise a RuntimeError 2013-07-16 22:26:05 +02:00
R David Murray acb362e29f Merge: #18424: PEP8ify the tense of the sum docstring. 2013-07-10 16:22:59 -04:00
R David Murray 87ead1138d #18424: PEP8ify the tense of the sum docstring. 2013-07-10 16:22:14 -04:00
Raymond Hettinger 4d6018fe45 Issue 18111: Add a default argument to min() and max() 2013-06-24 22:43:02 -07:00
Benjamin Peterson e8e14591eb rather than passing locals to the class body, just execute the class body in the proper environment 2013-05-16 14:37:25 -05:00
Benjamin Peterson 214a7d2674 properly lookup the __round__ special method (closes #17722) 2013-04-13 17:19:01 -04:00
Serhiy Storchaka ee57f159af Revert a premature patch for issue #14010 (changeset 846bd418aee5). 2013-04-06 22:55:12 +03:00
Serhiy Storchaka 278d03bd66 Revert a premature patch for issue #14010 (changeset aaaf36026511). 2013-04-06 22:52:34 +03:00
Serhiy Storchaka aac81e2780 Issue #14010: Fix a crash when iterating or deleting deeply nested filters
(builting and in itertools module, i.e. map(), itertools.chain(), etc).
2013-04-06 21:20:30 +03:00
Serhiy Storchaka e8f706eda7 Issue #14010: Fix a crash when iterating or deleting deeply nested filters
(builting and in itertools module, i.e. map(), itertools.chain(), etc).
2013-04-06 21:14:43 +03:00
Richard Oudkerk eea1f5c2e4 Merge 2013-04-03 13:49:36 +01:00
Richard Oudkerk 614c578dec Issue #17619: Make input() check for Ctrl-C correctly on Windows. 2013-04-03 13:44:50 +01:00
Ezio Melotti 178e6fef9e #17178: merge with 3.3. 2013-02-15 23:38:23 +02:00
Ezio Melotti 293ab9728a #17178: merge with 3.2. 2013-02-15 23:38:05 +02:00
Ezio Melotti b19ed57d8d #17178: update any()/all() docstrings to document their behavior with empty iterables. Patch by Ankur Ankan. 2013-02-15 23:35:14 +02:00
Philip Jenvey f76f0eea5c compile doesn't accept code objects 2012-12-13 15:44:18 -08:00
Benjamin Peterson 42124a727d initialize map/filter/zip in _PyBuiltin_Init rather than the catch-all function 2012-10-30 23:41:54 -04:00
Stefan Krah 66d1eb23d4 Merge 3.2. 2012-08-20 17:20:46 +02:00
Stefan Krah 07795df683 Issue #15741: Fix potential NULL dereference. Found by Coverity. 2012-08-20 17:19:50 +02:00
Antoine Pitrou 721738fbee Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:20:39 +02:00
Antoine Pitrou 6f430e4963 Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:18:25 +02:00
Senthil Kumaran e9175bd0af Fix issue #15607: Update the print builtin function docstring with the new flush keyword.
Patch contributed by Daniel Ellis.
2012-08-10 13:53:45 -07:00
Brett Cannon cb4996afe4 Issue #15471: Don't use mutable object as default values for the
parameters of importlib.__import__().
2012-08-06 16:34:44 -04:00
Brett Cannon 722d3aec2e Issue #15508: Fix the docstring for __import__ to not mention negative
'level' values and set its document default value to 0.

Thanks to Arfrever Frehtes Taifersar Arahesis for filing the bug.
2012-07-30 17:45:54 -04:00
Ezio Melotti 3c76aa6b23 Remove unused variabile "plain" in builtin_exec. 2012-11-21 18:36:08 +02:00
Antoine Pitrou edc601855d Remove outdated statement 2012-06-23 14:19:58 +02:00
Benjamin Peterson 3a37b8393c merge 3.2 2012-06-01 23:57:50 -07:00
Benjamin Peterson 8e8fbeae27 don't leak if the __class__ closure is set 2012-06-01 23:57:36 -07:00
Brett Cannon fd0741555b Issue #2377: Make importlib the implementation of __import__().
importlib._bootstrap is now frozen into Python/importlib.h and stored
as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen
code along with sys and imp and then uses _frozen_importlib._install()
to set builtins.__import__() w/ _frozen_importlib.__import__().
2012-04-14 14:10:13 -04:00
Kristján Valur Jónsson 31668b8f7a Issue #14288: Serialization support for builtin iterators. 2012-04-03 10:49:41 +00:00
Benjamin Peterson 0010256de4 fold into one if statement 2012-01-11 21:00:16 -05:00
Benjamin Peterson a12d5c62f7 fix formatting 2012-01-03 16:47:22 -06:00
Georg Brandl bc3b682923 Closes #13761: add a "flush" keyword argument to print(). 2012-01-13 19:41:25 +01:00
Benjamin Peterson 0ab2a26865 merge 3.2 2012-01-11 21:00:48 -05:00
Benjamin Peterson 332503db07 merge 3.2 2012-01-03 16:48:14 -06:00
Victor Stinner 63ab875cfe Remove "#ifdef Py_UNICODE_WIDE": Python is now always wide 2011-11-22 03:31:20 +01:00
Philip Jenvey 50add04836 quote the type name for improved readability 2011-11-06 16:37:52 -08:00
Antoine Pitrou 5ee9d8a8a2 Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
error handler in interactive mode (when calling into PyOS_Readline()).
2011-11-06 00:38:45 +01:00
Antoine Pitrou 0d776b1ce8 Issue #13342: input() used to ignore sys.stdin's and sys.stdout's unicode
error handler in interactive mode (when calling into PyOS_Readline()).
2011-11-06 00:34:26 +01:00
Florent Xicluna 4d46c2a722 Remove unused variable. 2011-10-28 15:00:50 +02:00
Nick Coghlan de31b191e5 Issue 1294232: Fix errors in metaclass calculation affecting some cases of metaclass inheritance. Patch by Daniel Urban. 2011-10-23 22:04:16 +10:00
Florent Xicluna 908ae24b06 Merge 3.2 (linked to issue #1294232) 2011-10-28 15:06:13 +02:00
Nick Coghlan 9715d26305 Merge issue 1294232 patch from 3.2 2011-10-23 22:36:42 +10:00
Martin v. Löwis bd928fef42 Rename _Py_identifier to _Py_IDENTIFIER. 2011-10-14 10:20:37 +02:00
Martin v. Löwis 1ee1b6fe0d Use identifier API for PyObject_GetAttrString. 2011-10-10 18:11:30 +02:00
Martin v. Löwis afe55bba33 Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
2011-10-09 10:38:36 +02:00
Martin v. Löwis d63a3b8beb Implement PEP 393. 2011-09-28 07:41:54 +02:00
Benjamin Peterson ea281a54f3 include header with PyAST_Validate 2011-08-12 23:10:50 -05:00
Benjamin Peterson 832bfe2ebd add a AST validator (closes #12575) 2011-08-09 16:15:04 -05:00
Benjamin Peterson 405f32c14c plug refleak 2011-07-29 22:43:45 -05:00
Benjamin Peterson 4f921c2e06 bytes -> bytearray 2011-07-29 14:24:29 -05:00
Benjamin Peterson ce071ca4e7 bytes should be verboten in sum() (fixes #12654) 2011-07-29 14:23:47 -05:00
Victor Stinner 99b9538636 Issue #9642: Uniformize the tests on the availability of the mbcs codec
Add a new HAVE_MBCS define.
2011-07-04 14:23:54 +02:00
Victor Stinner d64e8a75e5 Issue #9642: Fix filesystem encoding initialization: use the ANSI code page on
Windows if the mbcs codec is not available, and fail with a fatal error if we
cannot get the locale encoding (if nl_langinfo(CODESET) is not available)
instead of using UTF-8.
2011-07-04 13:48:30 +02:00
Alexander Belopolsky 0df80926c9 Removed 'or long integer' from bin, oct, and hex docstrings. 2011-04-07 00:16:22 -04:00
Alexander Belopolsky 12338ab10b Removed 'or long integer' from bin, oct, and hex docstrings. 2011-04-07 00:15:33 -04:00
Victor Stinner fe93faf98c Issue #3080: Add PyImport_ImportModuleLevelObject() function
Use it for the builtin __import__ function.
2011-03-14 15:54:52 -04:00
Victor Stinner f3fd733f92 Remove useless argument of _PyUnicode_AsDefaultEncodedString() 2011-03-02 01:03:11 +00:00
Victor Stinner 02bfdb3f79 Merged revisions 88530 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88530 | victor.stinner | 2011-02-23 13:07:37 +0100 (mer., 23 févr. 2011) | 4 lines

  Issue #11272: Fix input() and sys.stdin for Windows newline

  On Windows, input() strips '\r' (and not only '\n'), and sys.stdin uses
  universal newline (replace '\r\n' by '\n').
........
2011-02-23 12:10:23 +00:00
Victor Stinner c0f1a1afae Issue #11272: Fix input() and sys.stdin for Windows newline
On Windows, input() strips '\r' (and not only '\n'), and sys.stdin uses
universal newline (replace '\r\n' by '\n').
2011-02-23 12:07:37 +00:00
Brett Cannon b94767ff44 Issue #8914: fix various warnings from the Clang static analyzer v254. 2011-02-22 20:15:44 +00:00
Georg Brandl 8334fd9285 Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile. 2010-12-04 10:26:46 +00:00
Martin v. Löwis 4d0d471a80 Merge branches/pep-0384. 2010-12-03 20:14:31 +00:00
Georg Brandl e5b99f0fb3 Remove redundant includes of headers that are already included by Python.h. 2010-11-30 09:41:01 +00:00
Antoine Pitrou e71362d3de Issue #10518: Bring back the callable() builtin.
Approved by Guido (BDFL) and Georg (RM).
2010-11-27 22:00:11 +00:00
Benjamin Peterson 8f67d0893f make hashes always the size of pointers; introduce Py_hash_t #9778 2010-10-17 20:54:53 +00:00
Victor Stinner 4c7c8c3023 Issue #9713, #10114: Parser functions (eg. PyParser_ASTFromFile) expects
filenames encoded to the filesystem encoding with surrogateescape error handler
(to support undecodable bytes), instead of UTF-8 in strict mode.
2010-10-16 13:14:10 +00:00
Brett Cannon 5305a998d5 Since __import__ is not designed for general use, have its docstring point
people towards importlib.import_module().

Closes issue #7397.
2010-09-27 21:08:38 +00:00
Victor Stinner 5b519e0201 Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
2010-09-10 21:57:59 +00:00
Benjamin Peterson 17689991e6 only catch AttributeError in hasattr() #9666 2010-08-24 03:26:23 +00:00
Victor Stinner 306f0100f3 Issue #6697: Fix a crash if sys.stdin or sys.stdout encoding contain a surrogate
This is *very* unlikely :-)
2010-05-19 01:06:22 +00:00
Victor Stinner b744ba1d14 Issue #8610: Load file system codec at startup, and display a fatal error on
failure. Set the file system encoding to utf-8 (instead of None) if getting
the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
2010-05-15 12:27:16 +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 120c21227a Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
is unknown.
2010-03-25 00:30:28 +00:00
Benjamin Peterson 09259e2043 check PyDict_New() for error 2010-02-27 17:41:13 +00:00
Benjamin Peterson 23e018ab98 only accept AttributeError as indicating no __prepare__ attribute on a metaclass, allowing lookup errors to propogate 2010-02-27 17:40:01 +00:00
Mark Dickinson 480e8e38a0 Fix typo (reported by terlop on IRC) 2009-12-19 21:19:35 +00:00
Benjamin Peterson 97dd987ae2 Merged revisions 76534,76538,76628,76701,76774 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76534 | martin.v.loewis | 2009-11-26 02:42:05 -0600 (Thu, 26 Nov 2009) | 2 lines

  Fix typo.
........
  r76538 | georg.brandl | 2009-11-26 14:48:25 -0600 (Thu, 26 Nov 2009) | 1 line

  #7400: typo.
........
  r76628 | andrew.kuchling | 2009-12-02 08:27:11 -0600 (Wed, 02 Dec 2009) | 1 line

  Markup fixes
........
  r76701 | andrew.kuchling | 2009-12-07 20:37:05 -0600 (Mon, 07 Dec 2009) | 1 line

  Typo fix; grammar fix
........
  r76774 | benjamin.peterson | 2009-12-12 18:54:15 -0600 (Sat, 12 Dec 2009) | 1 line

  account for PyObject_IsInstance's new ability to fail
........
2009-12-13 01:23:39 +00:00
Mark Dickinson 9acadc54e0 Merged revisions 75714 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75714 | mark.dickinson | 2009-10-26 14:18:44 +0000 (Mon, 26 Oct 2009) | 1 line

  Warn against replacing PyNumber_Add with PyNumber_InPlaceAdd in sum
........
2009-10-26 14:19:42 +00:00
Skip Montanaro ba1e0f46ab Issue 7147 - remove ability to attempt to build Python without complex number support (was broken anyway) 2009-10-18 14:25:35 +00:00
Benjamin Peterson c963731bb6 refactor logic a little when no sep or end is passed 2009-07-02 18:25:26 +00:00
Benjamin Peterson 8bc5b68159 these builtins have to be initialized 2009-05-09 18:10:51 +00:00
Benjamin Peterson f5b52246ed ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626 2009-03-02 23:31:26 +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
Mark Dickinson f02e0aaafd Issue #1717: remove the cmp builtin function, the C-API functions
PyObject_Cmp, PyObject_Compare, and various support functions.
2009-02-01 12:13:56 +00:00
Mark Dickinson 1124e71368 Issue #4707: round(x, n) now returns an integer when x is an integer.
Previously it returned a float.
2009-01-28 21:25:58 +00:00
Amaury Forgeot d'Arc f343e01c17 Merged revisions 68560 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68560 | amaury.forgeotdarc | 2009-01-13 00:36:55 +0100 (mar., 13 janv. 2009) | 6 lines

  #3720: Interpreter crashes when an evil iterator removes its own next function.

  Now the slot is filled with a function that always raises.

  Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
........
2009-01-12 23:58:21 +00:00
Raymond Hettinger 5d1ff00bc0 Mini-optimization: use pack/unpack functions for argument tuples. 2009-01-06 09:37:13 +00:00
Benjamin Peterson 3809026a72 #4826 exec() doesn't take a file object anymore 2009-01-04 15:30:39 +00:00
Georg Brandl ced51db8cf #4513: remove traces of zip() docstring from when it was izip(). 2008-12-04 18:28:38 +00:00
Christian Heimes 6a27efa2d3 Issue 3723: Fixed initialization of subinterpreters
The patch fixes several issues with Py_NewInterpreter as well as the demo for multiple subinterpreters.
Most of the patch was written by MvL with help from Benjamin, Amaury and me. Graham Dumpleton has verified that this patch fixes an issue with mod_wsgi.
2008-10-30 21:48:26 +00:00
Martin v. Löwis 04dc25c537 Issue #3187: Add sys.setfilesystemencoding. 2008-10-03 16:09:28 +00:00
Amaury Forgeot d'Arc d0db98fcd8 #1688: On Windows, the input() prompt was not correctly displayed if it
contains non-ascii characters.

Reviewed by Benjamin Peterson.
2008-09-21 21:49:01 +00:00
Georg Brandl 2cabc56296 #3706: fix error message for wrong exec() argument type. R=Guido. 2008-08-28 07:57:16 +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
Amaury Forgeot d'Arc 7888d0803d Merged revisions 65339-65340,65342 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65339 | amaury.forgeotdarc | 2008-07-31 23:28:03 +0200 (jeu., 31 juil. 2008) | 5 lines

  #3479: unichr(2**32) used to return u'\x00'.
  The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int.

  (why doesn't gcc issue a truncation warning in this case?)
........
  r65340 | amaury.forgeotdarc | 2008-07-31 23:35:03 +0200 (jeu., 31 juil. 2008) | 2 lines

  Remove a dummy test that was checked in by mistake
........
  r65342 | amaury.forgeotdarc | 2008-08-01 01:39:05 +0200 (ven., 01 août 2008) | 8 lines

  Correct a crash when two successive unicode allocations fail with a MemoryError:
  the freelist contained half-initialized objects with freed pointers.

  The comment
  /* XXX UNREF/NEWREF interface should be more symmetrical */
  was copied from tupleobject.c, and appears in some other places.
  I sign the petition.
........
2008-08-01 01:06:32 +00:00
Mark Dickinson 0d748c2fa4 Docstring typo 2008-07-05 11:29:03 +00:00
Georg Brandl 809ddaaafb #3191: fix round() docs and docstring. 2008-07-01 20:39:59 +00:00
Georg Brandl 559e5d7f4d #2630: Implement PEP 3138.
The repr() of a string now contains printable Unicode characters unescaped.
The new ascii() builtin can be used to get a repr() with only ASCII characters in it.

PEP and patch were written by Atsuo Ishimoto.
2008-06-11 18:37:52 +00:00
Martin v. Löwis 1a21451b1d Implement PEP 3121: new module initialization and finalization API. 2008-06-11 05:26:20 +00:00
Georg Brandl f08a9ddcb7 Merged revisions 63724,63726,63732,63744,63754-63755,63757-63758,63760,63775,63781-63782,63787,63805-63808,63818-63819,63823-63824 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63724 | gregory.p.smith | 2008-05-26 22:22:14 +0200 (Mon, 26 May 2008) | 6 lines

  Fixes issue2791: subprocess.Popen.communicate leaked a file descripton until
  the last reference to the Popen instance was dropped.  Adding explicit
  close() calls fixes it.

  Candidate for backport to release25-maint.
........
  r63726 | benjamin.peterson | 2008-05-26 22:43:24 +0200 (Mon, 26 May 2008) | 2 lines

  fix minor grammar typo
........
  r63732 | benjamin.peterson | 2008-05-26 23:44:26 +0200 (Mon, 26 May 2008) | 2 lines

  remove duplication in test module
........
  r63744 | lars.gustaebel | 2008-05-27 14:39:23 +0200 (Tue, 27 May 2008) | 3 lines

  Do not close external file objects passed to tarfile.open(mode='w:bz2')
  when the TarFile is closed.
........
  r63754 | benjamin.peterson | 2008-05-28 03:12:35 +0200 (Wed, 28 May 2008) | 2 lines

  update tutorial function with more appropiate one from Eric Smith
........
  r63755 | mark.hammond | 2008-05-28 03:54:55 +0200 (Wed, 28 May 2008) | 2 lines

  bdist_wininst now works correctly when both --skip-build and --plat-name are specified.
........
  r63757 | georg.brandl | 2008-05-28 13:21:39 +0200 (Wed, 28 May 2008) | 2 lines

  #2989: add PyType_Modified().
........
  r63758 | benjamin.peterson | 2008-05-28 13:51:41 +0200 (Wed, 28 May 2008) | 2 lines

  fix spelling
........
  r63760 | georg.brandl | 2008-05-28 17:41:36 +0200 (Wed, 28 May 2008) | 2 lines

  #2990: prevent inconsistent state while updating method cache.
........
  r63775 | georg.brandl | 2008-05-29 09:18:17 +0200 (Thu, 29 May 2008) | 2 lines

  Two fixes in bytearray docs.
........
  r63781 | georg.brandl | 2008-05-29 09:38:37 +0200 (Thu, 29 May 2008) | 2 lines

  #2988: add note about catching CookieError when parsing untrusted cookie data.
........
  r63782 | georg.brandl | 2008-05-29 09:45:26 +0200 (Thu, 29 May 2008) | 2 lines

  #2985: allow i8 in XMLRPC responses.
........
  r63787 | georg.brandl | 2008-05-29 16:35:39 +0200 (Thu, 29 May 2008) | 2 lines

  Revert #2990 patch; it's not necessary as Armin showed.
........
  r63805 | raymond.hettinger | 2008-05-30 08:37:27 +0200 (Fri, 30 May 2008) | 1 line

  Issue 2784: fix leaks in exception exit.
........
  r63806 | raymond.hettinger | 2008-05-30 08:49:47 +0200 (Fri, 30 May 2008) | 1 line

  Issue 2855: Fix obscure crasher by slowing down the entire module.  Mimics what was done to dictionaries in r59223.
........
  r63807 | raymond.hettinger | 2008-05-30 09:16:53 +0200 (Fri, 30 May 2008) | 1 line

  Issue 2903:  Add __name__ in globals for namedtuple namespace.
........
  r63808 | georg.brandl | 2008-05-30 09:54:16 +0200 (Fri, 30 May 2008) | 2 lines

  #2999: fix name of third parameter in unicode.replace()'s docstring.
........
  r63818 | georg.brandl | 2008-05-30 21:12:13 +0200 (Fri, 30 May 2008) | 2 lines

  getloadavg() is not available on Windows.
........
  r63819 | georg.brandl | 2008-05-30 21:17:29 +0200 (Fri, 30 May 2008) | 2 lines

  Better quote with single quotes.
........
  r63823 | benjamin.peterson | 2008-05-30 22:44:39 +0200 (Fri, 30 May 2008) | 2 lines

  fix grammar
........
  r63824 | marc-andre.lemburg | 2008-05-30 22:52:18 +0200 (Fri, 30 May 2008) | 5 lines

  Update the locale module alias table.

  Closes #3011.
........
2008-06-10 16:57:31 +00:00
Georg Brandl a26f8ca668 Revert r63934 -- it was mixing two patches. 2008-06-04 13:01:30 +00:00
Georg Brandl f954c4b9fb Remove meaning of -ttt, but still accept -t option on cmdline for compatibility. 2008-06-04 11:41:32 +00:00
Christian Heimes 72b710a596 Renamed PyString to PyBytes 2008-05-26 13:28:38 +00:00
Christian Heimes 9c4756ea26 Renamed PyBytes to PyByteArray 2008-05-26 13:22:05 +00:00
Georg Brandl d11ae5d6ec Rename enumerate() kw argument name to "iterable" and fix "sequence"->"iterable" in some docstrings. 2008-05-16 13:27:32 +00:00
Alexandre Vassalotti eca20b6114 Merged revisions 63119-63128,63130-63131,63133,63135-63144,63146-63148,63151-63152,63155-63165,63167-63176,63181-63186,63188-63189 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63119 | benjamin.peterson | 2008-05-11 20:41:23 -0400 (Sun, 11 May 2008) | 2 lines

  #2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate
........
  r63122 | benjamin.peterson | 2008-05-11 20:46:49 -0400 (Sun, 11 May 2008) | 2 lines

  make message slightly more informative, so there's no chance of misunderstanding it
........
  r63158 | ronald.oussoren | 2008-05-12 07:24:33 -0400 (Mon, 12 May 2008) | 5 lines

  Remove references to platform 'mac'

  The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port,
  which is no longer supported (as of Python 2.4 IIRC).
........
  r63159 | ronald.oussoren | 2008-05-12 07:31:05 -0400 (Mon, 12 May 2008) | 8 lines

  MacOSX: remove dependency on Carbon package for urllib

  This patch removes the dependency on the Carbon package from urllib.
  The mac-specific code for getting proxy configuration is now writting in
  Python using ctypes and uses the SystemConfiguration framework instead of
  InternetConfig. Also provides a mac-specific implementation of proxy_bypass.
........
  r63162 | eric.smith | 2008-05-12 10:00:01 -0400 (Mon, 12 May 2008) | 1 line

  Added 'n' presentation type for integers.
........
  r63164 | georg.brandl | 2008-05-12 12:26:52 -0400 (Mon, 12 May 2008) | 2 lines

  #1713041: fix pprint's handling of maximum depth.
........
  r63170 | georg.brandl | 2008-05-12 12:53:42 -0400 (Mon, 12 May 2008) | 2 lines

  Fix parameter name for enumerate().
........
  r63173 | georg.brandl | 2008-05-12 13:01:58 -0400 (Mon, 12 May 2008) | 2 lines

  #2766: remove code without effect.
........
  r63174 | georg.brandl | 2008-05-12 13:04:10 -0400 (Mon, 12 May 2008) | 3 lines

  #2767: don't clear globs in run() call, since they could be needed in tearDown,
  which clears them at the end.
........
  r63175 | georg.brandl | 2008-05-12 13:14:51 -0400 (Mon, 12 May 2008) | 2 lines

  #1760: try-except-finally is one statement since PEP 341.
........
  r63186 | amaury.forgeotdarc | 2008-05-12 17:30:24 -0400 (Mon, 12 May 2008) | 2 lines

  Sync code with documentation, and remove Win95 support in winsound module.
........
  r63189 | amaury.forgeotdarc | 2008-05-12 18:21:39 -0400 (Mon, 12 May 2008) | 3 lines

  Adapt test_pyclbr to the new version of urllib.py:
  The new mac-specific functions must be ignored.
........
2008-05-16 02:54:33 +00:00
Georg Brandl aaa6392a12 Fix nits in builtin next(). 2008-04-30 19:47:01 +00:00
Neal Norwitz db4115ffc0 Merged revisions 62039-62042 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r62039 | georg.brandl | 2008-03-29 06:24:23 -0700 (Sat, 29 Mar 2008) | 3 lines

  Properly check for consistency with the third argument of
  compile() when compiling an AST node.
........
  r62040 | amaury.forgeotdarc | 2008-03-29 06:47:05 -0700 (Sat, 29 Mar 2008) | 5 lines

  The buildbot "x86 W2k8 trunk" seems to hang in test_socket.
  http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0

  Temporarily increase verbosity of this test.
........
  r62042 | amaury.forgeotdarc | 2008-03-29 07:53:05 -0700 (Sat, 29 Mar 2008) | 3 lines

  Still investigating on the hanging test_socket.
  the test itself doesn't do anything on windows, focus on setUp and tearDown.
........
2008-03-31 04:20:05 +00:00
Martin v. Löwis 618dc5e064 Merged revisions 62004 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r62004 | georg.brandl | 2008-03-28 13:11:56 +0100 (Fr, 28 Mär 2008) | 4 lines

  Patch #1810 by Thomas Lee, reviewed by myself:
  allow compiling Python AST objects into code objects
  in compile().
........
2008-03-30 20:03:44 +00:00
Raymond Hettinger 736c0ab428 Move itertools izip() code to builtins as zip(). Complete the renaming. 2008-03-13 02:09:15 +00:00
Raymond Hettinger a6c6037f88 Issues 2186 and 2187. Move map() from itertools to builtins. 2008-03-13 01:26:19 +00:00
Raymond Hettinger 17301e9fab Issue 2186 and 2187. Move filter from itertools to builtins. 2008-03-13 00:19:26 +00:00
Eric Smith 8fd3eba050 Fixes for shared 2.6 code that implements PEP 3101, advanced string
formatting.

Includes:
 - Modifying tests for basic types to use __format__ methods, instead
   of builtin "format".
 - Adding PyObject_Format.
 - General str/unicode cleanup discovered when backporting to 2.6.
 - Removing datetimemodule.c's time_format, since it was identical
   to date_format.

The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k.  Any changes from here on should be made to trunk, and
changes will propogate to py3k).
2008-02-17 19:48:00 +00:00
Georg Brandl cd5da7d51b Make print docstring consistent with its docs. 2008-02-01 15:47:37 +00:00
Christian Heimes 400adb030a Merged revisions 60475-60479,60481-60488 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60482 | raymond.hettinger | 2008-01-31 23:07:16 +0100 (Thu, 31 Jan 2008) | 1 line

  Minor wordsmithing on docstring
........
  r60483 | mark.dickinson | 2008-01-31 23:17:37 +0100 (Thu, 31 Jan 2008) | 5 lines

  Issue #1678380.  Fix a bug that identifies 0j and -0j when they appear
  in the same code unit. The fix is essentially the same as the fix for a
  previous bug identifying 0. and -0.
........
  r60484 | christian.heimes | 2008-02-01 00:08:23 +0100 (Fri, 01 Feb 2008) | 1 line

  Fixed bug #1983: Return from fork() is pid_t, not int
........
  r60486 | jeffrey.yasskin | 2008-02-01 07:22:46 +0100 (Fri, 01 Feb 2008) | 4 lines

  Move __builtins__.trunc() to math.trunc() per
  http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue
  1965.
........
  r60487 | jeffrey.yasskin | 2008-02-01 08:05:46 +0100 (Fri, 01 Feb 2008) | 3 lines

  Roll back r60248. It's useful to encourage users not to change Rational
  instances.
........
  r60488 | neal.norwitz | 2008-02-01 08:22:59 +0100 (Fri, 01 Feb 2008) | 1 line

  Fix refleak
........
2008-02-01 08:12:03 +00:00
Raymond Hettinger 70b64fce96 Issue #1771: Remove cmp parameter from list.sort() and builtin.sorted(). 2008-01-30 20:15:17 +00:00
Christian Heimes fe82e774ea Merged revisions 60379-60382 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60381 | christian.heimes | 2008-01-28 03:07:53 +0100 (Mon, 28 Jan 2008) | 1 line

  static PyObject* variables should use PyString_InternFromString() instead of PyObject_FromString() to store a python string in a function level static var.
........
2008-01-28 02:38:20 +00:00
Christian Heimes bbffeb61e1 Merged revisions 60210-60233 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60213 | christian.heimes | 2008-01-23 15:00:25 +0100 (Wed, 23 Jan 2008) | 1 line

  Use Py_TYPE() instead of ->ob_type
........
  r60214 | armin.rigo | 2008-01-23 15:07:13 +0100 (Wed, 23 Jan 2008) | 3 lines

  patch 1754489 by vlahan:
  improve portability of address length calculation for AF_UNIX sockets
........
  r60216 | christian.heimes | 2008-01-23 15:20:50 +0100 (Wed, 23 Jan 2008) | 1 line

  Fixed bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support.
........
  r60221 | christian.heimes | 2008-01-23 18:15:06 +0100 (Wed, 23 Jan 2008) | 2 lines

  Applied #1069410
  The "can't load dll" message box on Windows is suppressed while an extension is loaded by calling SetErrorMode in dynload_win.c. The error is still reported properly.
........
  r60224 | guido.van.rossum | 2008-01-23 21:19:01 +0100 (Wed, 23 Jan 2008) | 2 lines

  Fix two crashers.
........
  r60225 | kurt.kaiser | 2008-01-23 23:19:23 +0100 (Wed, 23 Jan 2008) | 3 lines

  Could not open files in .idlerc directory if latter was hidden on Windows.
  Issue 1743, Issue 1862.
........
  r60226 | guido.van.rossum | 2008-01-23 23:43:27 +0100 (Wed, 23 Jan 2008) | 2 lines

  Fix misleading comment reported in issue #1917.
........
  r60227 | kurt.kaiser | 2008-01-23 23:55:26 +0100 (Wed, 23 Jan 2008) | 2 lines

  There was an error on exit if no sys.exitfunc was defined. Issue 1647.
........
  r60228 | guido.van.rossum | 2008-01-24 00:23:43 +0100 (Thu, 24 Jan 2008) | 2 lines

  Turn three recently fixed crashers into regular tests.
........
  r60229 | raymond.hettinger | 2008-01-24 01:54:21 +0100 (Thu, 24 Jan 2008) | 1 line

  Add first-cut at an approximation function (still needs rounding tweaks).  Add continued fraction conversions.
........
  r60230 | raymond.hettinger | 2008-01-24 03:00:25 +0100 (Thu, 24 Jan 2008) | 1 line

  Minor clean-up and more tests.
........
  r60231 | raymond.hettinger | 2008-01-24 03:05:06 +0100 (Thu, 24 Jan 2008) | 1 line

  Cleanup
........
  r60232 | neal.norwitz | 2008-01-24 05:14:50 +0100 (Thu, 24 Jan 2008) | 1 line

  Fix the tests by restoring __import__.  I think the test is still valid.
........
  r60233 | neal.norwitz | 2008-01-24 08:40:51 +0100 (Thu, 24 Jan 2008) | 4 lines

  Fix the test_urllib2net failures that were caused by r58067.
  I'm not sure this is the correct fix, but at least the test passes
  now and should be closer to correct.
........
2008-01-24 09:42:52 +00:00
Raymond Hettinger 1dfde1ddc0 Replace map(None, *iterables) with zip(*iterables). 2008-01-22 23:25:35 +00:00
Christian Heimes 819b8bf403 More PyImport_ImportModule -> PyImport_ImportModuleNoBlock 2008-01-03 23:05:47 +00:00
Christian Heimes 5fb7c2ad0b Merged revisions 59565-59594 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59568 | facundo.batista | 2007-12-19 13:53:01 +0100 (Wed, 19 Dec 2007) | 3 lines


  Some minor cleanups.  Thanks Mark Dickinson.
........
  r59573 | raymond.hettinger | 2007-12-19 19:13:31 +0100 (Wed, 19 Dec 2007) | 1 line

  Fix issue 1661: Flags argument silently ignored in re functions with compiled regexes.
........
  r59574 | guido.van.rossum | 2007-12-19 20:41:06 +0100 (Wed, 19 Dec 2007) | 7 lines

  Patch #1583 by Adam Olsen.

  This adds signal.set_wakeup_fd(fd) which sets a file descriptor to
  which a zero byte will be written whenever a C exception handler runs.

  I added a simple C API as well, PySignal_SetWakeupFd(fd).
........
  r59575 | raymond.hettinger | 2007-12-19 23:14:34 +0100 (Wed, 19 Dec 2007) | 1 line

  Bigger range for non-extended opargs.
........
  r59576 | guido.van.rossum | 2007-12-19 23:51:13 +0100 (Wed, 19 Dec 2007) | 5 lines

  Patch #1549 by Thomas Herve.
  This changes the rules for when __hash__ is inherited slightly,
  by allowing it to be inherited when one or more of __lt__, __le__,
  __gt__, __ge__ are overridden, as long as __eq__ and __ne__ aren't.
........
  r59577 | raymond.hettinger | 2007-12-20 02:25:05 +0100 (Thu, 20 Dec 2007) | 1 line

  Add comments
........
  r59578 | brett.cannon | 2007-12-20 11:09:52 +0100 (Thu, 20 Dec 2007) | 3 lines

  Add tests for the warnings module; specifically formatwarning and showwarning.
  Still need tests for warn_explicit and simplefilter.
........
  r59582 | guido.van.rossum | 2007-12-20 18:28:10 +0100 (Thu, 20 Dec 2007) | 2 lines

  Patch #1672 by Joseph Armbruster.  Use tempdir() to get a temporary directory.
........
  r59584 | georg.brandl | 2007-12-20 22:03:02 +0100 (Thu, 20 Dec 2007) | 2 lines

  Fix refleak introduced in r59576.
........
  r59586 | guido.van.rossum | 2007-12-21 00:48:28 +0100 (Fri, 21 Dec 2007) | 4 lines

  Improve performance of built-in any()/all() by avoiding PyIter_Next() --
  using a trick found in ifilter().
  Feel free to backport to 2.5.
........
  r59591 | andrew.kuchling | 2007-12-22 18:27:02 +0100 (Sat, 22 Dec 2007) | 1 line

  Add item
........
2007-12-24 08:52:31 +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