Gregory P. Smith [Mon, 21 Jan 2008 07:11:11 +0000 (07:11 +0000)]
Provide a sanity check during PyThreadState_DeleteCurrent() and
PyThreadState_Delete() to avoid an infinite loop when the tstate list
is messed up and has somehow becomes circular and does not contain the
current thread.
I don't know how this happens but it does, *very* rarely. On more than
one hardware platform. I have not been able to reproduce it manually.
Attaching to a process where its happening: it has always been in an
infinite loop over a single element tstate list that is not the tstate
we're looking to delete. It has been in t_bootstrap()'s call to
PyThreadState_DeleteCurrent() as a pthread is exiting.
Georg Brandl [Sun, 20 Jan 2008 12:18:17 +0000 (12:18 +0000)]
#1664522: in urllib, don't read non-existing directories in ftp mode,
returning a 0-byte file -- raise an IOError instead.
Original patch from Phil Knirsch.
Georg Brandl [Sun, 20 Jan 2008 12:05:43 +0000 (12:05 +0000)]
#856047: respect the ``no_proxy`` env var when checking for proxies
in urllib and using the other ``_proxy`` env vars.
Original patch by Donovan Baarda.
Gregory P. Smith [Sun, 20 Jan 2008 01:32:00 +0000 (01:32 +0000)]
Document that zipfile decryption is insanely slow and fix a typo and
blatant lie in a docstring (it is not useful for security regardless of
how you spell it).
Gregory P. Smith [Sun, 20 Jan 2008 01:21:03 +0000 (01:21 +0000)]
Fix zipfile decryption. The check for validity only worked on one
type of encrypted zip files. Files using extended local headers
needed to compare the check byte against different values. (according
to reading the infozip unzip crypt.c source code)
Gregory P. Smith [Sat, 19 Jan 2008 20:57:59 +0000 (20:57 +0000)]
Fixes issue1336 - a race condition could occur when forking if the gc
kicked in during the critical section. solution: disable gc during
that section. Patch contributed by jpa and updated by me to cover the
race condition still existing what therve from twistedmatrix pointed
out (already seen and fixed in twisted's own subprocess code).
Patch #1019808 from Federico Schwindt: Return correct socket error when
a default timeout has been set, by using getsockopt() to get the error
condition (instead of trying another connect() call, which seems to be
a Linuxism).
2.5 bugfix candidate, assuming no one reports any problems with this change.
Georg Brandl [Sat, 19 Jan 2008 20:22:13 +0000 (20:22 +0000)]
#1663329: add os.closerange() to close a range of fds,
ignoring errors, and use this in subprocess to speed up
subprocess creation in close_fds mode. Patch by Mike Klaas.
Christian Heimes [Sat, 19 Jan 2008 16:39:27 +0000 (16:39 +0000)]
Disabled test_xmlrpc:test_404. It's causing lots of false alarms.
I also disabled a test in test_ssl which requires network access to svn.python.org. This fixes a bug Skip has reported a while ago.
Patch #742598 from Michael Pomraning: add .timeout attribute to SocketServer that will call
.handle_timeout() method when no requests are received within the timeout period.
Christian Heimes [Sat, 19 Jan 2008 13:46:06 +0000 (13:46 +0000)]
Added unit test to verify that threading.local doesn't cause ref leaks. It seems that the thread local storage always keeps the storage of the last stopped thread alive. Can anybody comment on it, please?
Jeffrey Yasskin [Sat, 19 Jan 2008 09:56:06 +0000 (09:56 +0000)]
Several tweaks: add construction from strings and .from_decimal(), change
__init__ to __new__ to enforce immutability, and remove "rational." from repr
and the parens from str.
Vinay Sajip [Fri, 18 Jan 2008 15:55:57 +0000 (15:55 +0000)]
Added LoggerAdapter class, changed copyright dates, made check for extra parameter passed to logging methods explicitly against None rather than a truth value.
Christian Heimes [Fri, 18 Jan 2008 08:47:59 +0000 (08:47 +0000)]
Coverity issue CID #169
local_ptr_assign_local: Assigning address of stack variable "namebuf" to pointer "filename"
out_of_scope: Variable "namebuf" goes out of scope
use_invalid: Used "filename" pointing to out-of-scope variable "namebuf"
Christian Heimes [Fri, 18 Jan 2008 07:45:30 +0000 (07:45 +0000)]
Coverity issue CID #167
Event alloc_fn: Called allocation function "metacompile" [model]
Event var_assign: Assigned variable "gr" to storage returned from "metacompile"
gr = metacompile(n);
Event pass_arg: Variable "gr" not freed or pointed-to in function "maketables" [model]
g = maketables(gr);
translatelabels(g);
addfirstsets(g);
Event leaked_storage: Returned without freeing storage "gr"
return g;
Christian Heimes [Fri, 18 Jan 2008 07:30:20 +0000 (07:30 +0000)]
Coverity issue CID #197
var_decl: Declared variable "stm" without initializer
ninit_use_in_call: Using uninitialized value "stm" (field "stm".tm_zone uninitialized) in call to function "mktime"