summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* SF patch 522961: Leak in Python/thread_nt.h, from Gerald S. Williams.Tim Peters2002-02-281-14/+1
| | | | | | | A file-static "threads" dict mapped thread IDs to Windows handles, but was never referenced, and entries never got removed. This gets rid of the YAGNI-dict entirely. Bugfix candidate.
* Add 2002 to PSF copyrights.Michael W. Hudson2002-02-271-1/+1
| | | | | Doc/README is odd; it assigns some copyright to the PSF in 2000, when I didn't think it existed...
* OS/2 EMX port changes (Python part of patch #450267):Andrew MacIntyre2002-02-264-3/+140
| | | | | | | | | Python/ dynload_shlib.c // EMX port emulates dlopen() etc. for DL extensions import.c // changes to support 8.3 DLL name limit (VACPP+EMX) // and case sensitive import semantics importdl.h thread_os2.h
* Move some opcodes to top of big eval_frame switch statement. SkipNeil Schemenauer2002-02-171-44/+45
| | | | | things_to_do block for a few common opcodes that don't do any real work. Closes SF patch #512256.
* LOAD_FAST: rearrange branches to favor the expected case, and getTim Peters2002-02-121-10/+7
| | | | rid of a redundant NULL-pointer check in the expected case.
* Removed a spurious }. (How did it get there in the first place??)Jack Jansen2002-02-111-2/+0
|
* Fix to the UTF-8 encoder: it failed on 0-length input strings.Marc-André Lemburg2002-02-071-1/+20
| | | | | | | | | | | | | | Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception.
* Got rid of an extra level of {} and funny formatting that was stillJack Jansen2002-02-011-58/+56
| | | | there because of the NeXT history.
* A new dynload_next, which actually only works on OSX but isn't renamed yet.Jack Jansen2002-02-011-112/+56
| | | | | | | | | | By default every module is imported in its own namespace, but this can be changed by defining USE_DYLD_GLOBAL_NAMESPACE. In a future version this define will be replaced by a runtime setting, but that needs a bit more thought. This code is largely based on code and feedback from Steven Majewski, Marcel Prastawa, Manoj Plakal and other on pythonmac-sig.
* Fix missing space between words. Bugfix candidate.Neal Norwitz2002-01-291-1/+1
|
* Fix spelling mistakes. Bugfix candidates.Neal Norwitz2002-01-292-4/+4
|
* Test for error status of shl_findsym. Fixes #505417. 2.2.1 candiate.Martin v. Löwis2002-01-261-1/+4
|
* Fix forMichael W. Hudson2002-01-231-2/+2
| | | | | | [ #496154 ] Typos in dynload_beos.c as suggested in the report. A little embarassing; 2.2.1 candidate for sure.
* Remove the unused & broken PyThread_*_sema() functions and related constants.Fred Drake2002-01-1910-550/+0
| | | | This closes SF patch #504215.
* A tentative fix for SF bug #503837 (Roeland Rengelink):Guido van Rossum2002-01-151-0/+3
| | | | | | | | | | | | | | | | type.__module__ problems (again?) This simply initializes the __module__ local in a class statement from the __name__ global. I'm not 100% sure that this is the correct fix, although it usually does the right thing. The problem is that if the class statement executes in a custom namespace, the __name__ global may be taken from __builtins__, in which case it would have the value __builtin__, or it may not exist at all (if the custom namespace also has a custom __builtins__), in which case the class statement will fail. Nevertheless, unless someone finds a better solution, this is a 2.2.1 bugfix too.
* Workaround for what is probably a problem in Apple's gcc: <pthread.h> failsJack Jansen2002-01-151-0/+6
| | | | | on a function pointer formal argument called "destructor", which is typedeffed as a different function pointer type in object.h.
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-128-32/+1
|
* Fixed "u#" parser marker to pass through Unicode objects as-is withoutMarc-André Lemburg2002-01-091-2/+6
| | | | | | going through the buffer interface API. Added tests for this to the _testcapi module and updated docs.
* Patch #494783: Rename cmp_op enumerators.Martin v. Löwis2002-01-012-29/+33
|
* Patch #497098: build support for GNU/Hurd.Martin v. Löwis2002-01-011-3/+15
|
* SF bug #496549 -Qnew and in-place division "/=".Tim Peters2001-12-251-11/+14
| | | | | | | | eval_frame(): Under -Qnew, INPLACE_DIVIDE wasn't getting handed off to INPLACE_TRUE_DIVIDE (like BINARY_DIVIDE was getting handed off to BINARY_TRUE_DIVIDE). Bugfix candidate.
* PyOS_vsnprintf(): Change PyMem_Malloc() call to PyMem_MALLOC() macro,Barry Warsaw2001-12-211-2/+2
| | | | | | | (ditto for PyMem_Free() -> PyMem_FREE()) to fix and close SF bug #495875 on systems that HAVE_SNPRINTF=0. Check in on both release-22 branch and trunk.
* SF bug #494668: PUSH() should assert-fail on overflow.Tim Peters2001-12-191-2/+4
| | | | | eval_frame(): Added asserts to the top of the eval loop, to verify that the eval stack pointer is in bounds, plus some comments.
* Patch #494384: Disable more Unicode API if Unicode is not used.Martin v. Löwis2001-12-181-0/+2
|
* _PyEval_SliceIndex(): explain why a NULL argument is allowed (thanksTim Peters2001-12-161-4/+4
| | | | to Guido for the revelation).
* _PyEval_SliceIndex(): Repaired the comments, and added XXX commentsTim Peters2001-12-161-6/+11
| | | | | about its dubious treatment of NULL (also opened a bug report on that, but don't want to risk changing it this late in the 2.2 game).
* Fix for SF bug [ #492403 ] exec() segfaults on closure's func_codeJeremy Hylton2001-12-133-5/+10
| | | | | | | | Based on the patch from Danny Yoo. The fix is in exec_statement() in ceval.c. There are also changes to introduce use of PyCode_GetNumFree() in several places.
* Add a comment explaining the st_symbols cache.Jeremy Hylton2001-12-101-1/+15
|
* PySymtableEntry_New(): I'm not sure what this routine is doing, but itTim Peters2001-12-081-0/+1
| | | | | | | | was obviously leaking an int object when whatever the heck it's looking for was found. Repaired that. This accounts for why entering function and class definitions at an interactive prompt leaked a reference to the integer 1 each time. Bugfix candidate.
* Missing DECREFs when exception is raised in sys.excepthook.Jeremy Hylton2001-12-071-0/+3
| | | | | | | Bug fix candidate for 2.1 branch. (I imagine the other recent leak patches are bug fix candidates, too, but I forgot to mark mine as such.)
* Don't fail on importing things with undefined references. Unfortunately weJack Jansen2001-12-061-1/+2
| | | | | | still fail on importing modules that link with libraries that fail their initialization code (such as windowing libraries when we don't have access to the window server) and that is what I really wanted to fix.
* Fix for SF bug #489671 (Neil Norwitz): memory leak in test_richcmp.Guido van Rossum2001-12-061-0/+8
| | | | | | Had nothing to do with rich comparisons -- some stack cleanup code was lost as a result of merging in Neil Schemenauer's generators patch. Reinserted the stack cleanup code, skipping it when yielding.
* Fix a typo (probably caused by autocompletion <blush>) that caused aGuido van Rossum2001-12-061-1/+1
| | | | | | leak when a class defined a __metaclass__. This fixes the problem reported on python-dev by Ping; I dunno if it's the same as SF bug #489669 (since that mentions Unicode).
* SF bug #488514: -Qnew needs workTim Peters2001-12-062-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Big Hammer to implement -Qnew as PEP 238 says it should work (a global option affecting all instances of "/"). pydebug.h, main.c, pythonrun.c: define a private _Py_QnewFlag flag, true iff -Qnew is passed on the command line. This should go away (as the comments say) when true division becomes The Rule. This is deliberately not exposed to runtime inspection or modification: it's a one-way one-shot switch to pretend you're using Python 3. ceval.c: when _Py_QnewFlag is set, treat BINARY_DIVIDE as BINARY_TRUE_DIVIDE. test_{descr, generators, zipfile}.py: fiddle so these pass under -Qnew too. This was just a matter of s!/!//! in test_generators and test_zipfile. test_descr was trickier, as testbinop() is passed assumptions that "/" is the same as calling a "__div__" method; put a temporary hack there to call "__truediv__" instead when the method name is "__div__" and 1/2 evaluates to 0.5. Three standard tests still fail under -Qnew (on Windows; somebody please try the Linux tests with -Qnew too! Linux runs a whole bunch of tests Windows doesn't): test_augassign test_class test_coercion I can't stay awake longer to stare at this (be my guest). Offhand cures weren't obvious, nor was it even obvious that cures are possible without major hackery. Question: when -Qnew is in effect, should calls to __div__ magically change into calls to __truediv__? See "major hackery" at tail end of last paragraph <wink>.
* Fix SF bug #486144: Uninitialized __slot__ vrbl is None.Guido van Rossum2001-12-041-1/+8
| | | | | | | There's now a new structmember code, T_OBJECT_EX, which is used for all __slot__ variables (except __weakref__, which has special behavior anyway). This new code raises AttributeError when the variable is NULL rather than converting NULL to None.
* SF bug #488687 reported by Neal NorwitzJeremy Hylton2001-12-042-1/+2
| | | | | | | | | The error for assignment to __debug__ used ste->ste_opt_lineno instead of n->n_lineno. The latter was at best incorrect; often the slot was uninitialized. Two fixes here: Use the correct lineno for the error. Initialize ste_opt_lineno in PySymtable_New(); while there are no current cases where it is referenced unless it has already been assigned to, there is no harm in initializing it.
* More sprintf -> PyOS_snprintf.Tim Peters2001-12-041-1/+1
|
* Fix the final two issues in Armin Rigo's SF bug #488477: apply_slice()Guido van Rossum2001-12-031-4/+10
| | | | | and assign_slice() weren't properly DECREF'ing the temporary slice object they created. (Shame on me. :-)
* unpack_iterable(): Add a missing DECREF in an error case. Reported byGuido van Rossum2001-12-031-0/+1
| | | | | Armin Rigo (SF bug #488477). Added a testcase to test_unpack_iter() in test_iter.py.
* mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, toTim Peters2001-12-033-89/+78
| | | | | | | | | | | | | | | use wrappers on all platforms, to make this as consistent as possible x- platform (in particular, make sure there's at least one \0 byte in the output buffer). Also document more of the truth about what these do. getargs.c, seterror(): Three computations of remaining buffer size were backwards, thus telling PyOS_snprintf the buffer is larger than it actually is. This matters a lot now that PyOS_snprintf ensures there's a trailing \0 byte (because it didn't get the truth about the buffer size, it was storing \0 beyond the true end of the buffer). sysmodule.c, mywrite(): Simplify, now that PyOS_vsnprintf guarantees to produce a \0 byte.
* mywrite(): The test for trouble in PyOS_vsnprintf was wrong on bothTim Peters2001-12-021-3/+10
| | | | | ends. Also, when there is trouble, ensure the buffer has a traiing 0 byte.
* When the number of bytes written to the malloc'ed buffer is largerGuido van Rossum2001-12-011-5/+5
| | | | | | than the argument string size, copy as many bytes as will fit (including a terminating '\0'), rather than not copying anything. This to make it satisfy the C99 spec.
* SF bug 486278 SystemError: Python/getargs.c:1086: bad.Tim Peters2001-11-291-7/+10
| | | | | | | | | | vgetargskeywords(): Now that this routine is checking for bad input (rather than dump core in some cases), some bad calls are raising errors that previously "worked". This patch makes the error strings more revealing, and changes the exceptions from SystemError to RuntimeError (under the theory that SystemError is more of a "can't happen!" assert- like thing, and so inappropriate for bad arguments to a public C API function).
* Two screwups fixed for sizeof(char *) instead of sizeof(char []).Jeremy Hylton2001-11-281-77/+82
| | | | | Also change all the helper functions to pass along the size of the msgbuf and use PyOS_snprintf() when writing into the buffer.
* More sprintf -> PyOS_snprintf.Tim Peters2001-11-281-2/+3
|
* Use PyOS_snprintf() at some cost even though it was correct before.Jeremy Hylton2001-11-281-6/+7
| | | | | | seterror() uses a char array and a pointer to the current position in that array. Use snprintf() and compute the amount of space left in the buffer based on the current pointer position.
* Use PyOS_vsnprintf() and check its return value.Jeremy Hylton2001-11-281-2/+9
| | | | | | If it returns -1 (which indicates overflow on old Linux platforms and perhaps on Windows) or size greater than buffer, write a message indicating that the previous message was truncated.
* ste_repr(): Conversion of sprintf() to PyOS_snprintf() for bufferBarry Warsaw2001-11-281-4/+5
| | | | overrun avoidance.
* aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for bufferBarry Warsaw2001-11-281-1/+1
| | | | overrun avoidance.
* code_repr(), com_addop_varname(), com_list_comprehension(),Barry Warsaw2001-11-281-32/+42
| | | | | | | | com_arglist(), symtable_check_unoptimized(), symtable_params(), symtable_global(), symtable_list_comprehension(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance.