Code

Opened 6 years ago

Closed 4 years ago

#6609 closed (wontfix)

pysco clears the stack - causes delayed_loader to fail

Reported by: pcoles@… Owned by: nobody
Component: Internationalization Version: master
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: UI/UX:

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

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by mtredinnick

  • Component changed from Translations to Internationalization
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by Hystrix

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 Changed 4 years ago by ramiro

  • Resolution set to wontfix
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.