Opened 17 years ago

Closed 15 years ago

#6609 closed (wontfix)

pysco clears the stack - causes delayed_loader to fail

Reported by: pcoles@… Owned by: nobody
Component: Internationalization Version: dev
Severity: Keywords: psyco, delayed_loader, stack
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The delayed_loader method (in django.utils.translation.init.py) will throw exceptions when an application has imported a module that uses psyco and psyco has managed to clear the stack. The explicit call that fails is:

caller = traceback.extract_stack(limit=2)[0][2]

If the exception is caught and the following code is run, it will show an empty list:

import traceback
raise Exception(traceback.extract_stack())

I am having trouble reproducing this - since psyco seems to only clear the stack in special cases, but I have seen it in multiple cases where one module is using psyco and a separate module is performing stack introspection. This bug has existed in django-users and been unreported for almost a year.

The django-users examples are:

http://groups.google.com/group/django-users/browse_thread/thread/4eb598a52fee2d14/49cd8b7eae6bd72e
http://groups.google.com/group/django-users/browse_thread/thread/8fadc9dd544a9c37/d21ba2996c184560

Change History (3)

comment:1 by Malcolm Tredinnick, 17 years ago

Component: TranslationsInternationalization
Triage Stage: UnreviewedAccepted

comment:2 by Hystrix, 16 years ago

I've just upgraded from 0.96 to 1.0 and got bitten by this bug. Maybe there should be some footnote in the upgrade guide becuase is not easy to know where it comes from when you first see it.

comment:3 by Ramiro Morales, 15 years ago

Resolution: wontfix
Status: newclosed

It seems (as per the multiple problems documented PsycoMiddleware and the Psyco documentation itself) the first thing a (experienced, that's a requiremente for using Psyco in the first place) developer should do when seeing weird problems is to deactivate it to see if it is the piece that is introducing them.

Django itself dropped support for Psyco on r3877.

Because of this I don't think the Django documentation is the place where a note about this should be added. Closing the ticket as wontfix.

Note: See TracTickets for help on using tickets.
Back to Top