Opened 17 years ago

Closed 17 years ago

#4813 closed (fixed)

Strange behaviour on locale using fastcgi and method=prefork

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

Description

During using manage.py runfcgi method=prefork there is a strange behaviour, propably connected with gettext cache - random requests serve untranslated string. With method=threaded everything is ok. I hacked utils/translation/trans_real.py file for my own needed and it works:

def gettext(message):
    """
    This function will be patched into the builtins module to provide the _
    helper function. It will use the current thread as a discriminator to find
    the translation object to use. If no current translation is activated, the
    message will be run through the default translation object.
    """


    from django.conf import settings
    _default = translation(settings.LANGUAGE_CODE)
    return _default.gettext(message)

Change History (6)

comment:1 by Malcolm Tredinnick, 17 years ago

Version: 0.96SVN

Looking at the comment and the use of _default, this isn't version 0.96 code at all. It's something more recent. Changing the version string.

The above change won't work in general, since it assumes you only ever want to use settings.LANGUAGE_CODE. It also wallpapers over whatever the real problem might be. I have no idea what the root cause is at the moment, though. Needs more investigation.

comment:2 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Malcolm Tredinnick, 17 years ago

I wonder if this is a symptom of the same problem as #4796? Not sure they're dupes yet, but problems in the i18n code not being applied uniformly is a common feature.

comment:4 by Malcolm Tredinnick, 17 years ago

Can you please check if this problem has been fixed by [6446], which is the fix for #4796.

comment:5 by Malcolm Tredinnick, 17 years ago

Might also be a dupe of #3539.

comment:6 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

Given the lack of response or confirmation in over four months, I'm going to close this. Can be reopened if somebody can repeat the problem with a recent subversion checkout.

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