summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
AgeCommit message (Collapse)AuthorLines
2010-12-04Add an "optimize" parameter to compile() to control the optimization level, ↵Georg Brandl-6/+13
and provide an interface to it in py_compile, compileall and PyZipFile.
2010-12-03Merge branches/pep-0384.Martin v. Löwis-2/+2
2010-11-30Remove redundant includes of headers that are already included by Python.h.Georg Brandl-1/+0
2010-11-27Issue #10518: Bring back the callable() builtin.Antoine Pitrou-0/+15
Approved by Guido (BDFL) and Georg (RM).
2010-10-17make hashes always the size of pointers; introduce Py_hash_t #9778Benjamin Peterson-2/+2
2010-10-16Issue #9713, #10114: Parser functions (eg. PyParser_ASTFromFile) expectsVictor Stinner-11/+22
filenames encoded to the filesystem encoding with surrogateescape error handler (to support undecodable bytes), instead of UTF-8 in strict mode.
2010-09-27Since __import__ is not designed for general use, have its docstring pointBrett Cannon-2/+6
people towards importlib.import_module(). Closes issue #7397.
2010-09-10Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODINGVictor Stinner-23/+0
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-08-24only catch AttributeError in hasattr() #9666Benjamin Peterson-8/+5
2010-05-19Issue #6697: Fix a crash if sys.stdin or sys.stdout encoding contain a surrogateVictor Stinner-7/+16
This is *very* unlikely :-)
2010-05-15Issue #8610: Load file system codec at startup, and display a fatal error onVictor Stinner-2/+9
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-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-1549/+1549
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-03-25Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encodingVictor Stinner-1/+5
is unknown.
2010-02-27check PyDict_New() for errorBenjamin Peterson-6/+6
2010-02-27only accept AttributeError as indicating no __prepare__ attribute on a ↵Benjamin Peterson-2/+10
metaclass, allowing lookup errors to propogate
2009-12-19Fix typo (reported by terlop on IRC)Mark Dickinson-1/+1
2009-12-13Merged revisions 76534,76538,76628,76701,76774 via svnmerge fromBenjamin Peterson-1/+5
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-10-26Merged revisions 75714 via svnmerge fromMark Dickinson-0/+9
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-18Issue 7147 - remove ability to attempt to build Python without complex ↵Skip Montanaro-2/+0
number support (was broken anyway)
2009-07-02refactor logic a little when no sep or end is passedBenjamin Peterson-4/+10
2009-05-09these builtins have to be initializedBenjamin Peterson-6/+0
2009-03-02ignore the coding cookie in compile(), exec(), and eval() if the source is a ↵Benjamin Peterson-7/+9
string #4626
2009-02-02Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson-3/+3
type of tp_compare in a separate commit, for ease of reversion should things go wrong.
2009-02-01Issue #1717: remove the cmp builtin function, the C-API functionsMark Dickinson-20/+0
PyObject_Cmp, PyObject_Compare, and various support functions.
2009-01-28Issue #4707: round(x, n) now returns an integer when x is an integer.Mark Dickinson-10/+8
Previously it returned a float.
2009-01-12Merged revisions 68560 via svnmerge fromAmaury Forgeot d'Arc-3/+0
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-06Mini-optimization: use pack/unpack functions for argument tuples.Raymond Hettinger-3/+3
2009-01-04#4826 exec() doesn't take a file object anymoreBenjamin Peterson-2/+2
2008-12-04#4513: remove traces of zip() docstring from when it was izip().Georg Brandl-3/+1
2008-10-30Issue 3723: Fixed initialization of subinterpretersChristian Heimes-1/+1
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-03Issue #3187: Add sys.setfilesystemencoding.Martin v. Löwis-3/+22
2008-09-21#1688: On Windows, the input() prompt was not correctly displayed if itAmaury Forgeot d'Arc-2/+19
contains non-ascii characters. Reviewed by Benjamin Peterson.
2008-08-28#3706: fix error message for wrong exec() argument type. R=Guido.Georg Brandl-13/+9
2008-08-07Rename PyUnicode_AsString -> _PyUnicode_AsString andMarc-André Lemburg-2/+2
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-01Merged revisions 65339-65340,65342 via svnmerge fromAmaury Forgeot d'Arc-2/+2
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-07-05Docstring typoMark Dickinson-1/+1
2008-07-01#3191: fix round() docs and docstring.Georg Brandl-2/+2
2008-06-11#2630: Implement PEP 3138.Georg Brandl-0/+15
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-11Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis-3/+14
2008-06-10Merged revisions ↵Georg Brandl-2/+2
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-04Revert r63934 -- it was mixing two patches.Georg Brandl-33/+0
2008-06-04Remove meaning of -ttt, but still accept -t option on cmdline for compatibility.Georg Brandl-0/+33
2008-05-26Renamed PyString to PyBytesChristian Heimes-4/+4
2008-05-26Renamed PyBytes to PyByteArrayChristian Heimes-5/+5
2008-05-16Rename enumerate() kw argument name to "iterable" and fix ↵Georg Brandl-6/+6
"sequence"->"iterable" in some docstrings.
2008-05-16Merged revisions ↵Alexandre Vassalotti-3/+7
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-04-30Fix nits in builtin next().Georg Brandl-13/+14
2008-03-31Merged revisions 62039-62042 via svnmerge fromNeal Norwitz-17/+16
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-30Merged revisions 62004 via svnmerge fromMartin v. Löwis-13/+40
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-13Move itertools izip() code to builtins as zip(). Complete the renaming.Raymond Hettinger-9/+173