In fact, very bad things(TM) happen. A user of TurboMail brought the issue to my attention, and now that I need to use sessions in my current project, I have also run into it. The problem is pretty simple: with sessions enabled, KID attempts to get the current locale from the session, even when the current request (and thus session) are not available. Adding the following two lines to the top of _get_locale in turbogears/i18n/utils.py fixes the problem:
My log and traceback:
Making the modification to my local copy of TG-1.0b1 makes TurboMail happy when using KID templates outside of a request with sessions enabled. Matthew Bevan, Systems Administrator Top Floor Computer Systems Ltd. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~--- |
- [TurboGears] i18n via CherryPy sessions, TurboMail threads, ... Matthew Bevan

