-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locale from strategyfile will always be overwritten #78
Comments
Thank you for this report (and fix!) this is a case of building for one set of defaults and then setting a different bunch of values in the CLI, and not really accounting for either 😅 oops. There's definitely other places this can happen that are due an update but locale is the first one to actually get overriden, so it makes sense! I'll pick up on your PR. |
seeing as this patches some broken behaviour i'm going to package as patch |
lovely, thanks! |
I've released v1.21.1 which should contain this fix. If you could take a look and report/close this issue if it's resolved, that would be fantastic 😇 |
Describe the bug
You can't set the locale via the strategyfile because it will always be overwritten by the fallback locale
To Reproduce
Steps to reproduce the behavior:
de_DE
state
--fake-locale
argument but enable verbose to see that the locale will fall back toen_GB
Expected behavior
settings the locale in the strategyfile results in that locale being used by pynonmizer.
Additional context
The issue seemingly lies in pynonymizer/pynonymize.py:47
fake_locale will never be
None
beyond this point, it's either a value specified by the CLI argument/environment variable or the fallbacken_GB
the
parse_config
method relies onlocal_override
to beNone
to use the value set in the strategyfile.pynonymizer/strategy/parser.py:162
I'd suggest to put the fallback to
en_GB
into the line where the locale is being read from the strategyfile instead of the fallback logic from pynonymizer/pynonymize.py:47.I've created a pull request with the suggested changes: #79
The text was updated successfully, but these errors were encountered: