summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Issue #8838, #8339: Remove codecs.charbuffer_encode() and "t#" parsing formatVictor Stinner2010-06-081-40/+1
| | | | | Remove last references to the "char buffer" of the buffer protocol from Python3.
* PyArg_Parse*("Z#") raises an error for unknown typeVictor Stinner2010-06-081-3/+4
| | | | | | | instead of ignoring the error and leave the pointer to the string and the size unchanged (not initialized). Fix also the type in the error message of "Z", "Z#" and "Y" formats.
* Py_FatalError(): don't sys sys.last_xxx variablesVictor Stinner2010-06-081-1/+1
| | | | | | Call PyErr_PrintEx(0) instead of PyErr_Print() to avoid a crash if Py_FatalError() is called in an early stage of Python initialization (if PySys is not yet initialized).
* sys_pyfile_write() does nothing if file is NULLVictor Stinner2010-06-081-0/+3
| | | | | | mywrite() falls back to the C file object if sys_pyfile_write() returns an error. This patch fixes a segfault is Py_FatalError() is called in an early stage of Python initialization.
* Issue #8848: U / U# formats of Py_BuildValue() are just alias to s / s#Victor Stinner2010-06-074-36/+4
|
* convertsimple(): call PyErr_NoMemory() on PyMem_NEW() failureVictor Stinner2010-06-061-0/+2
| | | | Raise a more revelant error (MemoryError instead of TypeError)
* Simplify getbuffer(): convertbuffer() fails anyway if bf_getbuffer is NULLVictor Stinner2010-06-061-19/+11
|
* use atomic structures in non-thread versionBenjamin Peterson2010-05-301-1/+1
|
* Remove dead codeVictor Stinner2010-05-291-12/+1
|
* Issue #8837: Remove "O?" format of PyArg_Parse*() functions. The format is noVictor Stinner2010-05-281-11/+0
| | | | used anymore and it was never documented.
* Issue #8188: Introduce a new scheme for computing hashes of numbersMark Dickinson2010-05-231-0/+56
| | | | | | (instances of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it easy to maintain the invariant that hash(x) == hash(y) whenever x and y have equal value.
* Issue #3798: sys.exit(message) writes the message to sys.stderr file, insteadVictor Stinner2010-05-211-4/+6
| | | | of the C file stderr, to use stderr encoding and error handler
* Merged revisions 81398 via svnmerge fromAntoine Pitrou2010-05-211-2/+8
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81398 | antoine.pitrou | 2010-05-21 19:12:38 +0200 (ven., 21 mai 2010) | 6 lines Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allows embedders of the interpreter to set sys.argv without also modifying sys.path. This helps fix `CVE-2008-5983 <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_. ........
* Issue #8766: Initialize _warnings module before importing the first module.Victor Stinner2010-05-192-2/+4
| | | | Fix a crash if an empty directory called "encodings" exists in sys.path.
* Issue #8589: Decode PYTHONWARNINGS environment variable with the file systemVictor Stinner2010-05-191-8/+13
| | | | | encoding and surrogateespace error handler instead of the locale encoding to be consistent with os.environ. Add PySys_AddWarnOptionUnicode() function.
* Issue #6697: Fix a crash if sys.stdin or sys.stdout encoding contain a surrogateVictor Stinner2010-05-191-7/+16
| | | | This is *very* unlikely :-)
* Issue #6697: Fix a crash if a keyword contains a surrogateVictor Stinner2010-05-191-6/+9
|
* Issue #6697: Check that _PyUnicode_AsString() result is not NULLVictor Stinner2010-05-191-5/+21
|
* handle_system_exit() flushs files to warranty the output orderVictor Stinner2010-05-171-0/+4
| | | | | | PyObject_Print() writes into the C object stderr, whereas PySys_WriteStderr() writes into the Python object sys.stderr. Each object has its own buffer, so call sys.stderr.flush() and fflush(stderr).
* Merged revisions 81220 via svnmerge fromVictor Stinner2010-05-151-1227/+1227
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81220 | victor.stinner | 2010-05-16 00:55:28 +0200 (dim., 16 mai 2010) | 4 lines Use 4-spaces for indentation (instead of tabs) in pgen outputs Regenerate (reindent) Python/graminit.c ........
* Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a UnicodeVictor Stinner2010-05-151-10/+2
| | | | | | object to Py_FileSystemDefaultEncoding with the "surrogateescape" error handler, return a bytes object. If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
* Issue #8610: Load file system codec at startup, and display a fatal error onVictor Stinner2010-05-152-22/+51
| | | | | 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.
* Issue #4653: fix typo in flush_std_files()Victor Stinner2010-05-141-1/+1
| | | | | Don't call sys.stderr.flush() if sys has no stderr attribute or if sys.stderr==None.
* Make PyErr_Occurred return NULL if there is no current thread. Previously itJeffrey Yasskin2010-05-131-3/+8
| | | | | | | would Py_FatalError, which called PyErr_Occurred, resulting in a semi-infinite recursion. Fixes issue 3605.
* Remove unnecessary assignments.Mark Dickinson2010-05-131-4/+1
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-0951-25045/+25045
| | | | | | | | | | 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. ........
* Merged revisions 81007 via svnmerge fromJean-Paul Calderone2010-05-091-0/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81007 | jean-paul.calderone | 2010-05-08 16:06:02 -0400 (Sat, 08 May 2010) | 1 line Skip signal handler re-installation if it is not necessary. Issue 8354. ........
* PyErr_SetFromErrnoWithFilename() decodes the filename usingVictor Stinner2010-05-081-1/+1
| | | | PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
* err_input(): don't encode/decode the unicode messageVictor Stinner2010-05-081-13/+12
|
* read eval_breaker with atomic api with computed gotosBenjamin Peterson2010-05-031-1/+1
|
* Make (most of) Python's tests pass under Thread Sanitizer.Jeffrey Yasskin2010-05-035-55/+253
| | | | | | | | | | | | | | | | | | http://code.google.com/p/data-race-test/wiki/ThreadSanitizer is a dynamic data race detector that runs on top of valgrind. With this patch, the binaries at http://code.google.com/p/data-race-test/wiki/ThreadSanitizer#Binaries pass many but not all of the Python tests. All of regrtest still passes outside of tsan. I've implemented part of the C1x atomic types so that we can explicitly mark variables that are used across threads, and get defined behavior as compilers advance. I've added tsan's client header and implementation to the codebase in dynamic_annotations.{h,c} (docs at http://code.google.com/p/data-race-test/wiki/DynamicAnnotations). Unfortunately, I haven't been able to get helgrind and drd to give sensible error messages, even when I use their client annotations, so I'm not supporting them.
* prevent the dict constructor from accepting non-string keyword args #8419Benjamin Peterson2010-04-241-0/+15
| | | | | This adds PyArg_ValidateKeywordArguments, which checks that keyword arguments are all strings, using an optimized method if possible.
* Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't executeVictor Stinner2010-04-231-2/+45
| | | | | indirectly Python signal handlers anymore because mywrite() ignores exceptions (KeyboardInterrupt).
* Merged revisions 80325 via svnmerge fromAntoine Pitrou2010-04-211-16/+4
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80325 | antoine.pitrou | 2010-04-22 00:53:29 +0200 (jeu., 22 avril 2010) | 6 lines Issue #7332: Remove the 16KB stack-based buffer in PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit compared to the dynamic memory allocation fallback. Patch by Charles-François Natali. ........
* PEP 3147Barry Warsaw2010-04-172-28/+365
|
* Issue #7316: the acquire() method of lock objects in the :mod:`threading`Antoine Pitrou2010-04-142-27/+107
| | | | | | module now takes an optional timeout argument in seconds. Timeout support relies on the system threading library, so as to avoid a semi-busy wait loop.
* Merged revisions 79837 via svnmerge fromAntoine Pitrou2010-04-061-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79837 | antoine.pitrou | 2010-04-06 17:38:25 +0200 (mar., 06 avril 2010) | 19 lines 14 years later, we still don't know what it's for. Spotted by the PyPy developers. Original commit is: branch: trunk user: guido date: Mon Aug 19 21:32:04 1996 +0200 files: Python/getargs.c description: [svn r6499] Support for keyword arguments (PyArg_ParseTupleAndKeywords) donated by Geoff Philbrick <philbric@delphi.hks.com> (slightly changed by me). Also a little change to make the file acceptable to K&R C compilers (HPUX, SunOS 4.x). ........
* Merged revisions 79763 via svnmerge fromBenjamin Peterson2010-04-041-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79763 | benjamin.peterson | 2010-04-04 18:03:22 -0500 (Sun, 04 Apr 2010) | 1 line fix tabs ........
* Merged revisions 79642,79644 via svnmerge fromBenjamin Peterson2010-04-031-1/+5
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79642 | benjamin.peterson | 2010-04-02 20:08:34 -0500 (Fri, 02 Apr 2010) | 1 line split out large test function ........ r79644 | benjamin.peterson | 2010-04-02 20:28:57 -0500 (Fri, 02 Apr 2010) | 1 line give TypeError when trying to set T_STRING_INPLACE ........
* Merged revisions 79555 via svnmerge fromAntoine Pitrou2010-04-011-12/+1
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79555 | antoine.pitrou | 2010-04-01 18:42:11 +0200 (jeu., 01 avril 2010) | 5 lines Issue #8276: PyEval_CallObject() is now only available in macro form. The function declaration, which was kept for backwards compatibility reasons, is now removed (the macro was introduced in 1997!). ........
* Merged revisions 79428 via svnmerge fromBenjamin Peterson2010-03-251-2/+2
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79428 | benjamin.peterson | 2010-03-25 18:27:16 -0500 (Thu, 25 Mar 2010) | 1 line make naming convention consistent ........
* Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encodingVictor Stinner2010-03-251-1/+5
| | | | is unknown.
* nest if for clarityBenjamin Peterson2010-03-211-8/+8
|
* count keyword only arguments as part of the totalBenjamin Peterson2010-03-211-2/+2
|
* Merged revisions 78028 via svnmerge fromBenjamin Peterson2010-03-211-3/+0
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78028 | benjamin.peterson | 2010-02-06 13:40:18 -0600 (Sat, 06 Feb 2010) | 1 line remove pointless error checking ........
* cleanup a bitBenjamin Peterson2010-03-211-24/+15
|
* Merged revisions 79205,79219,79228,79230,79232-79233,79235,79237 via ↵Benjamin Peterson2010-03-211-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r79205 | benjamin.peterson | 2010-03-21 12:34:54 -0500 (Sun, 21 Mar 2010) | 1 line rewrite a bit ........ r79219 | benjamin.peterson | 2010-03-21 14:24:08 -0500 (Sun, 21 Mar 2010) | 1 line flatten condition ........ r79228 | benjamin.peterson | 2010-03-21 14:35:39 -0500 (Sun, 21 Mar 2010) | 1 line remove pointless condition ........ r79230 | benjamin.peterson | 2010-03-21 14:39:52 -0500 (Sun, 21 Mar 2010) | 1 line co_varnames is certainly a tuple, so let's not waste time finding out ........ r79232 | benjamin.peterson | 2010-03-21 14:54:56 -0500 (Sun, 21 Mar 2010) | 1 line fix import ........ r79233 | benjamin.peterson | 2010-03-21 14:56:37 -0500 (Sun, 21 Mar 2010) | 1 line don't write duplicate tests ........ r79235 | benjamin.peterson | 2010-03-21 15:21:00 -0500 (Sun, 21 Mar 2010) | 4 lines improve error message from passing inadequate number of keyword arguments #6474 Note this removes the "non-keyword" or "keyword" phrases from these messages. ........ r79237 | benjamin.peterson | 2010-03-21 15:30:30 -0500 (Sun, 21 Mar 2010) | 1 line take into account keyword arguments when passing too many args ........
* Merged revisions 79034 via svnmerge fromBenjamin Peterson2010-03-171-0/+5
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79034 | benjamin.peterson | 2010-03-17 15:41:42 -0500 (Wed, 17 Mar 2010) | 1 line prevent lambda functions from having docstrings #8164 ........
* * Replaces the internals of the subprocess module from fork through exec onGregory P. Smith2010-03-141-0/+26
| | | | | | | | | | | | | | | POSIX systems with a C extension module. This is required in order for the subprocess module to be made thread safe. The pure python implementation is retained so that it can continue to be used if for some reason the _posixsubprocess extension module is not available. The unittest executes tests on both code paths to guarantee compatibility. * Moves PyLong_FromPid and PyLong_AsPid from posixmodule.c into longobject.h. Code reviewed by jeffrey.yasskin at http://codereview.appspot.com/223077/show
* Issue #8014: Fix incorrect error checks in structmember.c, and re-enableMark Dickinson2010-03-131-3/+4
| | | | previously failing test_structmember.py tests.