| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Closes SF bug #523473.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
if co_stacksize was > 32767 (the maximum value
which can be stored in 16 bits (signed)),
the PyCodeObject would be written wrong.
So on the second import (reading the .pyc)
would cause a crash.
Since we can't change the PYC magic, we
go on (silently), but don't write the file.
This means everything will work, but
a .pyc will not be written and the file will need
to be parsed on each import.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Repair widespread misuse of _PyString_Resize. Since it's clear people
don't understand how this function works, also beefed up the docs. The
most common usage error is of this form (often spread out across gotos):
if (_PyString_Resize(&s, n) < 0) {
Py_DECREF(s);
s = NULL;
goto outtahere;
}
The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL. So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s): s is already
NULL! A correct way to write the above is the simpler (and intended)
if (_PyString_Resize(&s, n) < 0)
goto outtahere;
Bugfix candidate.
Original patch(es):
python/dist/src/Python/bltinmodule.c:2.253
|
| |
|
|
|
|
|
|
|
|
|
|
| |
frameobject.c: make sure free and cell vars make it into locals, which
makes eval work.
bltinmodule.c & ceval.c: make sure a code object with free variables
that is passed to exec or eval raises an exception.
Also duplicate the current trunk test suite in the 2.1 branch, except
for certain necessary changes: different warnings raised by 2.1, need
for __future__.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this is what Zope 2 will be using in the foreseeable future).
Fix an issue that was reported in but unrelated to the main problem of
SF bug 535905 (Evil Trashcan and GC interaction).
The SETLOCAL() macro should not DECREF the local variable in-place and
then store the new value; it should copy the old value to a temporary
value, then store the new value, and then DECREF the temporary value.
This is because it is possible that during the DECREF the frame is
accessed by other code (e.g. a __del__ method or gc.collect()) and the
variable would be pointing to already-freed memory.
BUGFIX CANDIDATE!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SF patch #471839: Bug when extensions import extensions (Shane Hathaway)
When an extension imports another extension in its
initXXX() function, the variable _Py_PackageContext is
prematurely reset to NULL. If the outer extension then
calls Py_InitModule(), the extension is installed in
sys.modules without its package name. The
manifestation of this bug is a "SystemError:
_PyImport_FixupExtension: module <package>.<extension>
not loaded".
To fix this, importdl.c just needs to retain the old
value of _Py_PackageContext and restore it after the
initXXX() method is called. The attached patch does this.
This patch applies to Python 2.1.1 and the current CVS.
|
| |
|
|
| |
2002!). Does anyone know of a copyright blurb I missed?
|
| |
|
|
|
|
|
|
| |
sent with empty message.
sheesh. Lucky I decided it was worth doing last minute complete compile
tests. cvs merge stupid on my part fixed that made solaris builds totally
fail.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve threading on Solaris, according to SF patch #460269, submitted
by bbrox@bbrox.org / lionel.ulmer@free.fr.
This adds a configure check and if all goes well turns on the
PTHREAD_SCOPE_SYSTEM thread attribute for new threads.
This should remove the need to add tiny sleeps at the start of threads
to allow other threads to be scheduled.
This is a semi-feature, but makes such a huge difference to the
performance of Zope on Solaris that it's worthwhile (well, imho).
|
| |
|
|
|
|
|
|
| |
SF bug 485175: buffer overflow in
traceback.c. Bugfix candidate. tb_displayline(): the sprintf
format was choking off the file name, but used plain %s for the
function name (which can be arbitrarily long). Limit both to 500
chars max.
|
| |
|
|
| |
Missing DECREFs when exception is raised in sys.excepthook.
|
| |
|
|
|
|
|
|
| |
PySymtableEntry_New(): I'm not sure what this
routine is doing, but it 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.
|
| |
|
|
|
|
|
|
|
| |
Py_Initialize(): Apply patch by Jürgen Hermann to call
_PyImport_FixupExtension() on the exceptions module. Now
reload(exceptions) acts just like reload(sys) instead of raising
an ImportError.
This closes SF bug #422004.
|
| |
|
|
| |
Add checks for stack underflow and overflow.
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix for SF bug [ #471928 ] global made w/nested list comprehensions
. Initially I was going to just rip out the bits of this that fixed this
bug, but the rest of the code looks (after a fair amount of staring at
it) like it's ok - variable renames, that sort of thing.
flames and "hey, no way!" to me, or to python-dev.
It felt safer to just go with the full patch, rather than butchering
it.
|
| |
|
|
|
| |
. SF bug [#467265] Compile errors on SuSe Linux on IBM/s390.
- errors.c, PyErr_Format: add a va_end() to balance the va_start().
|
| |
|
|
|
| |
. Always pass a full path name to LoadLibraryEx(). Fixes some Windows 9x
problems. As discussed on python-dev
|
| |
|
|
|
|
|
|
| |
. Patch #455231: Support ELF properly on OpenBSD.
. Patch to bug #472202: Correctly recognize NetBSD before 199712.
. Move dlfcn.h block out of NetBSD block, assuming that NetBSD before
199712 didn't have dlfcn.h, or that it wouldn't conflict with the other
stuff defined.
|
| |
|
|
|
|
|
|
|
| |
Patch by Jonathan Wight (slightly reformatted) to forestall loading the
same module twice, which apparently crashes Python. I could not test the
error condition, but in normal life it seems to have no adverse effects.
Also removed an unsued variable, and corrected 2 glaring errors (missing
'case' in front of a label).
|
| |
|
|
| |
improved error message-- names the type of the unexpected object
|
| |
|
|
|
| |
Patch number #422106 by Greg Ball, to fix segmentation
fault in sys.displayhook.
|
| |
|
|
| |
Fixes very obscure and nasty bug.
|
| |
|
|
|
|
|
|
|
|
|
| |
SF bug #438295: [Windows] __init__.py cause strange behavior
Probable fix (the bug report doesn't have enough info to say for sure).
find_init_module(): Insist on a case-sensitive match for __init__ files.
Given __INIT__.PY instead, find_init_module() thought that was fine, but
the later attempt to do find_module("__INIT__.PY") didn't and its caller
silently suppressed the resulting ImportError. Now find_init_module()
refuses to accept __INIT__.PY to begin with.
|
| |
|
|
|
|
| |
SF bug 433228: repr(list) woes when len(list) big
call_object: If the object isn't callable, display its type in the error
msg rather than its repr.
|
| |
|
|
|
|
|
|
| |
SF bug 430991: wrong co_lnotab
Armin Rigo pointed out that the way the line-# table got built didn't work
for lines generating more than 255 bytes of bytecode. Fixed as he
suggested, plus corresponding changes to pyassem.py, plus added some long
overdue docs about this subtle table to compile.c.
|
| |
|
|
|
|
| |
vgetargs1() and vgetargskeywords(): Replace uses of PyTuple_Size() and
PyTuple_GetItem() with PyTuple_GET_SIZE() and PyTuple_GET_ITEM().
The code has already done a PyTuple_Check().
|
| |
|
|
|
|
|
|
| |
Add a second special case to the inline function call code in eval_code2().
If we have a PyCFunction (builtin) and it is METH_VARARGS only, load
the args and dispatch to call_cfunction() directly. This provides a
small speedup for perhaps the most common function calls -- builtins.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SF bug #417093: Case sensitive import: dir and .py file w/ same name
Directory containing
Spam.py
spam/__init__.py
Then "import Spam" caused a SystemError, because code checking for
the existence of "Spam/__init__.py" finds it on a case-insensitive
filesystem, but then bails because the directory it finds it in
doesn't match case, and then old code assumed that was still an error
even though it isn't anymore. Changed the code to just continue
looking in this case (instead of calling it an error). So
import Spam
and
import spam
both work now.
|
| |
|
|
|
|
|
|
|
| |
Fix buglet reported on c.l.py: map(fnc, file.xreadlines()) blows up.
Took away map()'s insistence that sequences support __len__, and cleaned
up the convoluted code that made it *look* like it really cared about
__len__ (in fact the old ->len field was only *used* as a flag bit, as
the main loop only looked at its sign bit, setting the field to -1 when
IndexError got raised; renamed the field to ->saw_IndexError instead).
|
| |
|
|
|
|
|
|
|
|
| |
Fix 2.1 nested scopes crash reported by Evan Simpson
The new test case demonstrates the bug. Be more careful in
symtable_resolve_free() to add a var to cells or frees only if it
won't be added under some other rule.
XXX Add new assertion that will catch this bug.
|
| |
|
|
| |
'release21-maint'.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
now raises NameError instead of UnboundLocalError, because the var in
question is definitely not local. (This affects test_scope.py)
Also update the recent fix by Ping using get_func_name(). Replace
tests of get_func_name() return value with call to get_func_desc() to
match all the other uses.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Calling an unbound method on a C extension class without providing
an instance can yield a segfault. Try "Exception.__init__()" or
"ValueError.__init__()".
This is a simple fix. The error-reporting bits in call_method
mistakenly treat the misleadingly-named variable "func" as a
function, when in fact it is a method.
If we let get_func_name take care of the work, all is fine.
|
| |
|
|
| |
CNRI copyright should be updated to include 2001.
|
| | |
|
| |
|
|
|
|
|
|
| |
Fix based on patch #414750 by Michael Hudson.
New functions get_func_name() and get_func_desc() return reasonable
names and descriptions for all objects. XXX Even objects that aren't
actually callable.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
pickle.py
The code implicitly assumed that all ints fit in 4 bytes, causing all
sorts of mischief (from nonsense results to corrupted pickles).
Repaired that.
marshal.c
The int marshaling code assumed that right shifts of signed longs
sign-extend. Repaired that.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Jeffery Collins pointed out that filterstring decrefs a character object
before it's done using it. This works by accident today because another
module always happens to have an active reference too at the time. The
accident doesn't work after his Pippy modifications, and since it *is*
an accident even in the mainline Python, it should work by design there too.
The patch accomplishes that.
|
| |
|
|
|
| |
using nested scopes to compile its argument. Pass compiler flags
through to underlying compile call.
|
| |
|
|
|
|
|
|
| |
but apparently he had to go to school, so I am checking it in for him.
This makes PyRun_HandleSystemExit() a static instead, called
handle_system_exit(), and let it use the current exception rather than
passing in an exception. This slightly simplifies the code.
|
| | |
|
| |
|
|
| |
sys.exitfunc gets the last word on the exit status of the program.
|
| | |
|
| |
|
|
|
| |
inside a piece of code that was deemed reduntant; the DECREF was
unfortunately *not* redundant!)
|
| |
|
|
|
|
|
|
| |
Update docstring and library reference section on 'sys' module.
New API PyErr_Display, just for displaying errors, called by excepthook.
Uncaught exceptions now call sys.excepthook; if that fails, we fall back
to calling PyErr_Display directly.
Also comes with sys.__excepthook__ and sys.__displayhook__.
|