Re: xmlrpc, httplib and SSL

From: Roger Binns (rogerb_at_rogerbinns.com)
Date: 03/29/04


Date: Sun, 28 Mar 2004 17:52:12 -0800
To: <python-list@python.org>

Skip Montanaro wrote:
> Can you submit a patch to SF which abstracts that into its own method
> ("end_request" or something similar?) which can be overridden.
[snip]
> That sounds like the main problem. Sounds like getting the shutdown() call
> into its own overridable method would help a lot.

That doesn't help. Basically what has happened is due to a defect
in Python (IMHO). Because objects that include a destructor (__del__)
won't necessarily have the destructor called, and file/socket
handles are real operating system resources, the code has to manually
call close everywhere to ensure they aren't leaked (very reminiscent
of C memory management). The calling of close() everywhere was
easiest done by assuming that there will be one transaction per
connection. Add in the 'dup' behaviour I talked about in an
earlier message and it is really hard to fix all this. Basically
there is manual handle management going on that really should
be handled correctly by the garbage collection system. Additionally
M2Crypto does not support dup'ing a file handle. Nor does
the SSL builtin to Python 2.3, so the latter builds yet another
layer of reference counting framework. IMHO it may require
new classes with new semantics, just as happened between
Python 1.5 and 2.0.

I *am not* volunteering to fix this. I can't even test fixes
unless they test the whole thing since fixes in one small area
don't do me any good. I also have the constraint of having to
work on 2.2 as well as 2.3.

However if someone wants to fix the *whole thing*, and not just
a call here or there, I will provide moral support and the
lessons I learnt the hard way.

Roger



Relevant Pages

  • Re: mutable default parameter problem [Prothon]
    ... I love Python dearly. ... So far you have only shown me an idiom that many say should not be used. ... If I also might make a general argument for the fix then let me continue. ... Dynamic var scoping fixed another Python gotcha which doesn't break ...
    (comp.lang.python)
  • Re: New Python 3.0 string formatting - really necessary?
    ... but this was his first exposure to python. ... He got really hung up on the % syntax. ... how about making a suggestion to fix it? ...
    (comp.lang.python)
  • Python startup speed fixed :-)
    ... I'm pleased to announced that the python startup speed problem is fixed. ... Using Python 2.3.5 with the fix: ... Accounting information (delta values): ... Elapsed CPU time: 0 00:00:03.86 ...
    (comp.os.vms)
  • Re: "no variable or argument declarations are necessary."
    ... Thiat in fact happens to me all the time and is an annoying aspect of ... If I forget to declare several variables in C, ... gives me several warning messages and I fix them in one edit. ... forget to initialize several variables in Python, ...
    (comp.lang.python)