Jack Jansen [Tue, 7 Feb 2006 22:28:09 +0000 (22:28 +0000)]
Fixed an oversight and a misunderstanding of PEP253:
- Call tp_dealloc on the static baseclass, not dynamic (which leads to
infinite loops with more than one baseclass)
- Call tp_new and tp_init on baseclasses (overridable)
-This line, and those below, will be ignored--
Neal Norwitz [Tue, 7 Feb 2006 07:04:46 +0000 (07:04 +0000)]
Bug #876637, prevent stack corruption when socket descriptor
is larger than FD_SETSIZE.
This can only be acheived with ulimit -n SOME_NUMBER_BIGGER_THAN_FD_SETSIZE
which is typically only available to root. Since this wouldn't normally
be run in a test (ie, run as root), it doesn't seem too worthwhile to
add a normal test. The bug report has one version of a test. I've
written another. Not sure what the best thing to do is.
Do the check before calling internal_select() because we can't set
an error in between Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS.
This seemed the clearest solution, ie handle before calling internal_select()
rather than inside. Plus there is at least one place outside
of internal_select() that needed to be handled.
Neal Norwitz [Sun, 5 Feb 2006 08:21:08 +0000 (08:21 +0000)]
Get test_logging to not hang when running under regrtest.py -R ::
Not sure why/how _handlers/_handlerList is out of sync. This could
indicate a deeper problem.
In test_logging, the only absolutely necessary change to get working
was tcpserver.abort = 1. But we don't want to wait infinitely
to join the threads, so give a 2.0 second timeout.
There doesn't appear to be a need for a local abort variable
in serve_until_stopped, so just use the instance member.
Neal Norwitz [Sun, 5 Feb 2006 05:45:43 +0000 (05:45 +0000)]
Patch #1407135, bug #1424041, make mmap.mmap(-1, length) work the same
on both Unix (SVR4 and BSD) and Windows. Restores behaviour of passing -1
for anonymous memory on Unix. Use MAP_ANONYMOUS instead of _ANON since
the latter is deprecated according to Linux (gentoo) man pages.
Should we continue to allow mmap.mmap(0, length) to work on Windows?
0 is a valid fd.
Thomas Wouters [Wed, 1 Feb 2006 21:32:04 +0000 (21:32 +0000)]
As discussed on python-dev, silence three gcc-4.0.x warnings, using assert()
to protect against actual uninitialized usage.
Objects/longobject.c: In function ‘PyLong_AsDouble’:
Objects/longobject.c:655: warning: ‘e’ may be used uninitialized in this function
Objects/longobject.c: In function ‘long_true_divide’:
Objects/longobject.c:2263: warning: ‘aexp’ may be used uninitialized in this function
Objects/longobject.c:2263: warning: ‘bexp’ may be used uninitialized in this function
Gustavo Niemeyer [Tue, 31 Jan 2006 18:34:13 +0000 (18:34 +0000)]
Patch #1413711: Certain patterns of differences were making difflib
touch the recursion limit. The applied patch inlines the recursive
__helper method in a non-recursive way.
Thomas Wouters [Sat, 28 Jan 2006 12:05:54 +0000 (12:05 +0000)]
Work around a Solaris peculiarity that caused test_pty to sometimes fail: a
tty opened by os.openpty() isn't always a tty according to os.isatty(), when
it's tested inside the process that opened it. Doesn't affect actual
functionality, as using a tty this way is rarely, if ever, useful. Ignoring
the failure allows the test for actual functionality to continue.
Jeremy Hylton [Fri, 27 Jan 2006 15:18:39 +0000 (15:18 +0000)]
Improved handling of syntax errors.
Expand set of errors caught in set_context(). Some new errors, some
old error messages changed for consistency.
Fixed error checking in generator expression code. The first set of
tests were impossible condition given the grammar. In general, the
ast code uses REQ() for those sanity checks.
Fix some error handling for augmented assignments. As comments in the
code explain, set_context() ought to work here, but I got unexpected
crashes when I tried it. Should come back to this.
Add note to Grammar that yield expression is a special case.
Add doctest cases for SyntaxErrors raised by ast.c.
Neal Norwitz [Wed, 25 Jan 2006 08:39:35 +0000 (08:39 +0000)]
There was a race condition where the connector would try to connect
before the listener was ready (on gentoo x86 buildslave). This
caused the listener to not exit normally since nobody connected to it
(waited in accept()). The exception was raised in the other thread
and the test failed.
This fix doesn't completely eliminate the race, but should make it
near impossible to trigger. Hopefully it's good enough.
Martin v. Löwis [Tue, 24 Jan 2006 15:51:21 +0000 (15:51 +0000)]
Patch #1349118: urllib2 now supports user:pass@ style proxy
specifications, raises IOErrors when proxies for unsupported protocols
are defined, and uses the https proxy on https redirections.
Otherwise the compiled code is gibberish, possibly leading at
least to wrong results or (as reported on c.l.py) internal
sre errors at match time.
I'm not sure how to test this. SRE_CODE is a 2-byte type on
my box, and it's easy to create a regexp that causes the new
exception to trigger here. But it may be a 4-byte type on
other boxes, and creating a regexp large enough to trigger
problems there would be pretty crazy.