Skip to content

inter-thread force_locale interference #117

@rnd0101

Description

@rnd0101

There seems to be a problem with Flask-Babel==0.11.1 in multithreaded Flask app.
It can be revealed (even in threaded werkzeug, but first encountered in mod_wsgi env) by adding debug point to https://github.com/python-babel/flask-babel/blob/master/flask_babel/__init__.py#L337 (just after "temporarily" changing babel's locale_selector_func). Then application, accessed from another thread, is stuck with lambda: locale, whatever locale happened to be.

If it's not easy to fix, it should be properly indicated, that context manager in question is not thread-safe.

Flask is 0.10.1.

(also:
http://stackoverflow.com/questions/43470984/flask-babel-not-thread-safe
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions