I did a patch. The globals.py change covers what Jason had which is
when cPickle.load fails. I wasn't 100% sure why another
session_file.close code branch did a del response.session_file but
included that in the addition in case the protocol with the class
depends on that somewhere else.

For main.py to make
try:
except:
finally:

work in Python < 2.5 the docs say use 2 try statements as in

try:
  try:
  except:
finally:

but I can't test this. :-(

In the finally there is a test for response not None, response has
attr session_file and then response.session_file is not None because
adding another try except block inside a finally would eat a previous
exception which is likely why this code is running in the first place
and I am sure everyone would rather have the real exception. I don't
see a way to attach files here so will send patch by email. The patch
is against hg_update at 10:30 PDT tonight after you released 1.86.3 so
it should be current. I don't think the patch to main.py is as likely
to be called upon to perform an actual close. I tested on both a dev
and apache wsgi install here but am on Python 2.6.5 Ubuntu 10.04.

This can be very tricky stuff to get right for all versions of Python
under all conditions so I hope this doesn't cause anyone any problems.
I leave it to your much greater experience to decide if it is right or
not.

Thanks for a great application server that is fun to work with. I am
an old guy (59) EE grad 1973 at UBC Vancouver BC, MASc 1976, one year
on a PhD in semiconductors, first language Fortran followed by many
assemblers, Basic, Pascal, C, C++, Java including JavaEE, PHP, and now
Python. I think Python is a great language to work in.

Ron

On Oct 6, 4:41 pm, mdipierro <[email protected]> wrote:
> I would take this patch but we have to be careful to make sure it
> works with python 2.4. Try prevents
>
> try:
> except:
> finally:
>
> and the user of "with".
>
> On Oct 6, 6:23 pm, ron_m <[email protected]> wrote:
>
>

Reply via email to