summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().Neal Norwitz2006-07-301-2/+13
| | | | | | This provides the proper warning for struct.pack(). PyErr_Warn() is now deprecated in favor of PyErr_WarnEx(). As mentioned by Tim Peters on python-dev.
* Patch #1531113: Fix augmented assignment with yield expressions.Neal Norwitz2006-07-302-9/+12
| | | | Also fix a SystemError when trying to assign to yield expressions.
* Bug #1529871: The speed enhancement patch #921466 broke Python's compliancePhillip J. Eby2006-07-281-34/+132
| | | | | | with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is used in ``sys.path_importer_cache`` to cache non-directory paths and avoid excessive filesystem operations during imports.
* Bug #1521947: possible bug in mystrtol.c with recent gcc.Tim Peters2006-07-271-9/+21
| | | | | | | | | | | | | | | | | | | | | In general, C doesn't define anything about what happens when an operation on a signed integral type overflows, and PyOS_strtol() did several formally undefined things of that nature on signed longs. Some version of gcc apparently tries to exploit that now, and PyOS_strtol() could fail to detect overflow then. Tried to repair all that, although it seems at least as likely to me that we'll get screwed by bad platform definitions for LONG_MIN and/or LONG_MAX now. For that reason, I don't recommend backporting this. Note that I have no box on which this makes a lick of difference -- can't really test it, except to note that it didn't break anything on my boxes. Silent change: PyOS_strtol() used to return the hard-coded 0x7fffffff in case of overflow. Now it returns LONG_MAX. They're the same only on 32-bit boxes (although C doesn't guarantee that either ...).
* Part of bug #1523610: fix miscalculation of buffer length.Georg Brandl2006-07-261-2/+10
| | | | | Also add a guard against NULL in converttuple and add a test case (that previously would have crashed).
* bugfix: PyThread_start_new_thread() returns the thread ID, not a flag;Andrew MacIntyre2006-07-231-7/+4
| | | | will backport.
* If the for loop isn't entered, entryblock will be NULL. If passedNeal Norwitz2006-07-231-0/+2
| | | | | | to stackdepth_walk it will be dereffed. Not sure if I found with failmalloc or Klockwork #55.
* Handle more mem alloc issues found with failmallocNeal Norwitz2006-07-232-1/+5
|
* Fix more memory allocation issues found with failmalloc.Neal Norwitz2006-07-224-24/+45
|
* Handle more memory allocation failures without crashing.Neal Norwitz2006-07-215-8/+38
|
* Speel initialise write. Tanks Anthony.Neal Norwitz2006-07-211-1/+1
|
* Handle allocation failures gracefully. Found with failmalloc.Neal Norwitz2006-07-213-41/+45
| | | | Many (all?) of these could be backported.
* SF bug 1524317: configure --without-threads fails to buildTim Peters2006-07-191-48/+47
| | | | | | | | | | | | | | | | | | Moved the code for _PyThread_CurrentFrames() up, so it's no longer in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in one). Changed test_sys's test_current_frames() so it passes with or without thread supported compiled in. Note that test_sys fails when Python is compiled without threads, but for an unrelated reason (the old test_exit() fails with an indirect ImportError on the `thread` module). There are also other unrelated compilation failures without threads, in extension modules (like ctypes); at least the core compiles again. Do we really support --without-threads? If so, there are several problems remaining.
* Reported by Klocwork #151.Neal Norwitz2006-07-171-2/+13
| | | | | | v2 can be NULL if exception2 is NULL. I don't think that condition can happen, but I'm not sure it can't either. Now the code will protect against either being NULL.
* Fix memory leak under some conditions.Neal Norwitz2006-07-161-7/+9
| | | | Reported by Klocwork, #98.
* Bug #1512814, Fix incorrect lineno's when code within a functionNeal Norwitz2006-07-161-5/+6
| | | | had more than 255 blank lines. Byte codes need to go first, line #s second.
* Accept long options "--help" and "--version".Georg Brandl2006-07-121-4/+27
|
* Actually change the MAGIC #. Create a new section for 2.5c1 and mention the ↵Neal Norwitz2006-07-121-1/+1
| | | | impact of changing the MAGIC #.
* Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again.Neal Norwitz2006-07-122-2/+7
|
* Add missing Py_DECREFs.Thomas Heller2006-07-111-1/+2
|
* After approval from Anthony, merge the tim-current_framesTim Peters2006-07-102-3/+68
| | | | | | branch into the trunk. This adds a new sys._current_frames() function, which returns a dict mapping thread id to topmost thread stack frame.
* Bug #1512814, Fix incorrect lineno's when code at module scopeNeal Norwitz2006-07-101-1/+9
| | | | started after line 256.
* On 64 bit systems, int literals that use less than 64 bits are now intsNeal Norwitz2006-07-091-0/+11
| | | | rather than longs. This also fixes the test for eval(-sys.maxint - 1).
* Fix SF bug 1441486: bad unary minus folding in compiler.Neil Schemenauer2006-07-091-20/+53
|
* Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.Neil Schemenauer2006-07-092-3/+5
|
* Fix SF bug #1519018: 'as' is now validated properly in import statementsNeal Norwitz2006-07-081-1/+12
|
* Fix refleaks reported by Shane Hathaway in SF patch #1515361. This changeNeal Norwitz2006-07-061-2/+4
| | | | contains only the changes related to leaking the copy variable.
* Bug #1417699: Reject locale-specific decimal point in float()Martin v. Löwis2006-07-031-0/+7
| | | | and atof().
* Bug #1511381: codec_getstreamcodec() in codec.c is corrected toHye-Shik Chang2006-06-231-3/+6
| | | | | | omit a default "error" argument for NULL pointer. This allows the parser to take a codec from cjkcodecs again. (Reported by Taewook Kang and reviewed by Walter Doerwald)
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-134-5/+163
| | | | | | | | | | Heavily revised, comprising revisions: 46640 - original trunk revision (backed out in r46655) 46647 - markup fix (backed out in r46655) 46692:46918 merged from branch aimacintyre-sf1454481 branch tested on buildbots (Windows buildbots had problems not related to these changes).
* i and j are initialized below when used. No need to do it twiceNeal Norwitz2006-06-121-1/+1
|
* Get rid of f_restricted too. Doc the other 4 ints that were already removedNeal Norwitz2006-06-121-1/+1
| | | | at the NeedForSpeed sprint.
* Fix indentation of case and a Py_ssize_t issue.Neal Norwitz2006-06-121-2/+2
|
* Patch #1495999: Part two of Windows CE changes.Martin v. Löwis2006-06-106-3/+9
| | | | | | - update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
* Argh. "integer" is a very confusing word ;)Georg Brandl2006-06-081-2/+2
| | | | | Actually, checking for INT_MAX and INT_MIN is correct since the format code explicitly handles a C "int".
* Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds ↵Georg Brandl2006-06-081-2/+2
| | | | checking.
* _PySys_Init(): It's rarely a good idea to size a buffer to theTim Peters2006-06-061-1/+1
| | | | | | | | exact maximum size someone guesses is needed. In this case, if we're really worried about extreme integers, then "cp%d" can actually need 14 bytes (2 for "cp" + 1 for \0 at the end + 11 for -(2**31-1)). So reserve 128 bytes instead -- nothing is actually saved by making a stack-local buffer tiny.
* Add 3 more bytes to a buffer to cover constants in string and null byte on ↵Brett Cannon2006-06-051-1/+1
| | | | | | top of 10 possible digits for an int. Closes bug #1501223.
* Revert revisions:Tim Peters2006-06-044-170/+4
| | | | | | | | | | | | | | | | 46640 Patch #1454481: Make thread stack size runtime tunable. 46647 Markup fix The first is causing many buildbots to fail test runs, and there are multiple causes with seemingly no immediate prospects for repairing them. See python-dev discussion. Note that a branch can (and should) be created for resolving these problems, like svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH followed by merging rev 46647 to the new branch.
* Patch #1346214: correctly optimize away "if 0"-style stmtsGeorg Brandl2006-06-042-15/+49
| | | | (thanks to Neal for review)
* clean up function declarations to conform to PEP-7 style.Andrew MacIntyre2006-06-043-22/+44
|
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-044-4/+170
|
* [ 1497053 ] Let dicts propagate the exceptions in user __eq__().Armin Rigo2006-06-011-2/+13
| | | | [ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
* Convert more modules to METH_VARARGS.Georg Brandl2006-05-291-5/+3
|
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-2/+2
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* Fix compiler warning.Georg Brandl2006-05-291-1/+1
|
* Handle PyMem_Malloc failure in pystrtod.c. Closes #1494671.Georg Brandl2006-05-291-0/+7
|
* Fix #1494605.Georg Brandl2006-05-291-1/+2
|
* Correct None refcount issue in Mac modules. (Are theyGeorg Brandl2006-05-281-1/+1
| | | | still used?)
* The empty string is a valid import path.Georg Brandl2006-05-281-2/+4
| | | | (fixes #1496539)