summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Add os.path.supports_unicode_filenames for all platforms,Mark Hammond2002-10-081-0/+37
| | | | | | sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink> version), and fix test_pep277.py in a few minor ways. Including doc and NEWS entries.
* s/_alloca/alloca/g; Windows doesn't need the former, at least not unlessTim Peters2002-10-051-2/+2
| | | | __STDC__ is defined (or something like that ...).
* Patch #618347: Work around Solaris 2.6 pthread.h bug. Will backport to 2.2.Martin v. Löwis2002-10-041-2/+2
|
* Fix [ 616716 ] Bug in PyErr_SetExcFromWindowsMark Hammond2002-10-041-9/+28
| | | | | | Ensure that even if FormatMessage fails we (a) don't crash, and (b) provide something useful. Bugfix candidate.
* Fix errors to pep277 checkin identified by Neal Norwitz.Mark Hammond2002-10-041-3/+3
|
* One last tweak to the tracing machinery: this actually computes what I intendedMichael W. Hudson2002-10-031-1/+3
| | | | | | | all along. Before instr_lb tended to be too high. I don't think this actually makes any difference, given what the compiler produces, but it makes me a bit happier.
* Clamp code objects' tp_compare result to [-1, 1].Michael W. Hudson2002-10-031-3/+3
| | | | Bugfix candidate.
* Patch 594001: PEP 277 - Unicode file name support for Windows NT.Mark Hammond2002-10-031-10/+82
|
* Fix for the recursion_level bug Armin Rigo reported in sfMichael W. Hudson2002-10-021-0/+4
| | | | | | | patch #617312, both on the trunk and the 22-maint branch. Also added a test case, and ported the test_trace I wrote for HEAD to 2.2.2 (with all those horrible extra 'line' events ;-).
* Add encoding name in LookupError. Fixes #615013. Will backport to 2.2.Martin v. Löwis2002-09-261-2/+2
|
* Two more cases of switch(PySequence_Size()) without checking for case -1.Neal Norwitz2002-09-181-0/+7
| | | | | | | (Same problem as last checkin for SF bug 610610) Need to clear the error and proceed. Backport candidate
* Fix SF bug 610610 (reported by Martijn Pieters, diagnosed by Neal Norwitz).Guido van Rossum2002-09-181-0/+3
| | | | | | | | The switch in Exception__str__ didn't clear the error if PySequence_Size() raised an exception. Added a case -1 which clears the error and falls through to the default case. Definite backport candidate (this dates all the way to Python 2.0).
* A slight change to SET_LINENO-less tracing.Michael W. Hudson2002-09-111-5/+18
| | | | | This makes things a touch more like 2.2. Read the comments in Python/ceval.c for more details.
* missed this one on the previous multi-file checkin - seeSkip Montanaro2002-09-031-2/+0
| | | | http://python.org/sf/602191
* Add a custom __str__ method to KeyError that applies repr() to theGuido van Rossum2002-09-031-2/+40
| | | | | missing key. (Also added a guard to SyntaxError__str__ to prevent calling PyString_Check(NULL).)
* Bump default check interval to 100 instructions. Computers are much fasterSkip Montanaro2002-09-031-2/+2
| | | | | | than when this interval was first established. Checking too frequently just adds needless overhead because most of the time there is nothing to do and no other threads ready to run.
* replace thread state objects' ticker and checkinterval fields with twoSkip Montanaro2002-09-032-4/+9
| | | | | | | | | | globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the test in the main loop to only test a single value. The gory details are at http://python.org/sf/602191
* expose PYTHON_API_VERSION macro as sys.api_version. Closes patch # 601456.Skip Montanaro2002-09-031-0/+3
|
* Check string for NULL before using it to format the error message.Walter Dörwald2002-09-021-3/+6
| | | | (Spotted by Neal Norwitz)
* Removed bogus PyUnicodeTranslateError_GetEncoding, asWalter Dörwald2002-09-021-5/+0
| | | | | UnicodeTranslateError doesn't have an encoding attribute. (Spotted by Neal Norwitz)
* Limit the length of attribute names in exception messagesWalter Dörwald2002-09-021-3/+3
| | | | to prevent buffer overflows (spotted by Neal Norwitz).
* PEP 293 implemention (from SF patch http://www.python.org/sf/432401)Walter Dörwald2002-09-022-0/+1002
|
* Because MWH changed the bytecode again, moved the magic number *back*Guido van Rossum2002-08-311-1/+6
| | | | | to 62011. This should get the snake-farm to throw away its old .pyc files, amongst others.
* Further SET_LINENO reomval fixes. See comments in patch #587933.Michael W. Hudson2002-08-302-37/+32
| | | | | | | | | | Use a slightly different strategy to determine when not to call the line trace function. This removes the need for the RETURN_NONE opcode, so that's gone again. Update docs and comments to match. Thanks to Neal and Armin! Also add a test suite. This should have come with the original patch...
* execfile should call PyErr_SetFromErrnoWithFilename instead ofPeter Schneider-Kamp2002-08-271-1/+1
| | | | | | simply PyErr_SetFromErrno This closes bug 599163.
* Fix a couple of whitespace consistency nits.Fred Drake2002-08-261-2/+2
|
* Simplify, and avoid PyModule_GetDict() while we're at it.Fred Drake2002-08-261-5/+2
|
* The error messages in err_args() -- which is only called when theGuido van Rossum2002-08-231-2/+2
| | | | | | required number of args is 0 or 1 -- were reversed. Also change "1" into "exactly one", the same words as used elsewhere for this condition.
* Comment typo repair.Michael W. Hudson2002-08-201-1/+1
|
* My patch #597221. Use f_lasti more consistently.Michael W. Hudson2002-08-201-9/+9
|
* Add a warning comment to the LOAD_GLOBAL inline code.Guido van Rossum2002-08-191-1/+3
|
* Another ugly inlining hack, expanding the two PyDict_GetItem() callsGuido van Rossum2002-08-191-1/+25
| | | | | | | | | | | | | | | in LOAD_GLOBAL. Besides saving a C function call, it saves checks whether f_globals and f_builtins are dicts, and extracting and testing the string object's hash code is done only once. We bail out of the inlining if the name is not exactly a string, or when its hash is -1; because of interning, neither should ever happen. I believe interning guarantees that the hash code is set, and I believe that the 'names' tuple of a code object always contains interned strings, but I'm not assuming that -- I'm simply testing hash != -1. On my home machine, this makes a pystone variant with new-style classes and slots run at the same speed as classic pystone! (With new-style classes but without slots, it is still a lot slower.)
* Inline fast_cfunction() in new call_function().Jeremy Hylton2002-08-161-55/+33
| | | | | | | | | Also, don't handle METH_OLDARGS on the fast path. All the interesting builtins have been converted to use METH_NOARGS, METH_O, or METH_VARARGS. Result is another 1-2% speedup. If I can cobble together 10 of these, it might make a difference.
* Move body of CALL_FUNCTION opcode into helper function.Jeremy Hylton2002-08-161-54/+56
| | | | | | | This makes the code much easier to ready, because it is at a sane indentation level. On my box this shows a 1-2% speedup, which means nothing, except that I'm not going to worry about the performance effects of the change.
* Streamline the fast track for CFunction calls a bit more: there wasGuido van Rossum2002-08-161-5/+2
| | | | | | | nothing special done if keyword arguments were present, so test for that earlier and fall through to the normal case if there are any. This ought to slow down CFunction calls with keyword args, but I don't care; it's a tiny (1%) improvement for pystone.
* A nice little speed-up for filter():Guido van Rossum2002-08-161-13/+17
| | | | | | | | | | - Use PyObject_Call() instead of PyEval_CallObject(), saves several layers of calls and checks. - Pre-allocate the argument tuple rather than calling Py_BuildValue() each time round the loop. - For filter(None, seq), avoid an INCREF and a DECREF.
* Add warnings for arguments named None. All set. (I could add aGuido van Rossum2002-08-161-1/+9
| | | | | | warning for 'global None', but that's either accompanied by an assignment to None, which will trigger a warning, or not, in which case it's harmless. :-)
* Add warning for None used as keyword argument name in function call.Guido van Rossum2002-08-161-0/+1
| | | | | Still to do: function definition arguments (including *None and **None).
* Add warnings for assignment or deletion of variables and attributesGuido van Rossum2002-08-161-0/+27
| | | | | named 'None'. Still to do: function definition parameter lists, and function call keyword arguments.
* Minor cleanup of parsename() and parsestr(): the 'struct compiling *'Guido van Rossum2002-08-161-13/+13
| | | | | | argument should be called 'c', like everywhere else. Renamed a complex variable 'c' to 'z' and moved it inside the only scope where it's used.
* This is my patchMichael W. Hudson2002-08-155-78/+199
| | | | | | | | [ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
* provide less mysterious error messages when seeing end-of-line inSkip Montanaro2002-08-151-0/+6
| | | | | single-quoted strings or end-of-file in triple-quoted strings. closes patch 586561.
* Py_InitModule4(): Accept NULL for the 'methods' argument. This makesFred Drake2002-08-141-14/+16
| | | | | sense now that extension types can support __init__ directly rather than requiring function constructors.
* Added a FutureWarning for constructs that will change semantically inBarry Warsaw2002-08-142-2/+10
| | | | | the future. Changed PEP 237 hex constant warnings from DeprecationWarning to FutureWarning. Updated the documentation.
* Patch #550192: Set softspace to 0 in raw_input().Martin v. Löwis2002-08-141-18/+22
|
* Patch #505705: Remove eval in pickle and cPickle.Martin v. Löwis2002-08-141-98/+5
|
* Use PyErr_WarnExplicit() to warn about hex/oct constants, so theGuido van Rossum2002-08-121-4/+9
| | | | correct filename and line number are reported.
* Reset errno to zero after calling PyErr_Warn(). It can potentially doGuido van Rossum2002-08-111-0/+1
| | | | | a lot of work, including I/O (e.g. to import warnings.py), which might affect errno.
* Add C API PyUnicode_FromOrdinal() which exposes unichr() at C level.Marc-André Lemburg2002-08-111-34/+1
| | | | | | | u'%c' will now raise a ValueError in case the argument is an integer outside the valid range of Unicode code point ordinals. Closes SF bug #593581.
* Implement stage B0 of PEP 237: add warnings for operations thatGuido van Rossum2002-08-111-1/+9
| | | | | | | | | | currently return inconsistent results for ints and longs; in particular: hex/oct/%u/%o/%x/%X of negative short ints, and x<<n that either loses bits or changes sign. (No warnings for repr() of a long, though that will also change to lose the trailing 'L' eventually.) This introduces some warnings in the test suite; I'll take care of those later.