marrow / WebCore

WebCore, the super tiny and blazingly fast modular Python web nanoframework.
MIT License
94 stars 10 forks source link

Thread locals cleaned up too early. #166

Closed amcgregor closed 8 years ago

amcgregor commented 8 years ago

Translation tools may require the current request or detected language from the context, but notably with cinje templates, template generation and iteration happens after we have called the after extension callbacks. This means the _ and D_ translation tools are unable to identify the active language tag (context.lang) during rendering.

This is less impactful within cinje templates themselves, which are generally passed the context with its bound context.lang._ and context.lang.D_ versions, but is a huge problem within __str__ and other argument-free methods.