You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to take this moment to point out that distutils' command mangling code is byzantine and strange, especially if one is used to modernities like click, argparse or even optparse... :)
2.3.3 changed that particular parsing code to do things differently to have the pybabel commands work correctly with multiple keywords (your issue #384), but unfortunately broke support for distutils arguments. In short
versions 2.3.0..2.3.2 break multiple -k/--keywords arguments for pybabel extract
version 2.3.3 breaks the single -k/--keywords argument accepted by distutils extract_messages
I'll try and get a bugfix in asap. Honestly I'm a little embarrassed by these.
@ajaeger: Would you be able to test that all of Openstack's usecases (since apparently some of your processes use pybabel as evident from #384 and others use the distutils-based commands as evident here) work with the code in #389?
Activity
[-]Babel 2.3.3 breaks[/-][+]no-default-keywords has no effect in 2.3.3[/+]ajaeger commentedon Apr 13, 2016
To reproduce:
git clone git.openstack.org/openstack/cinder
cd cinder
python setup.py extract_messages --no-default-keywords --keyword _LW --input-dirs cinder --output-file test233.pot
ajaeger commentedon Apr 13, 2016
Sorry, couldn't come up with a self contained test quickly.
akx commentedon Apr 13, 2016
@ajaeger: Can you see if it has an effect if you run via
pybabeland not via distutils commands? Just to help narrow down the scope of the issue.ajaeger commentedon Apr 13, 2016
For smaller testcase:
$ mkdir test
$ cp cinder/service.py test/
$ python setup.py extract_messages --no-default-keywords --keyword _LW --input-dirs test --output-file test233.pot
Note that it does not include the _LW strings at all, only the default _
ajaeger commentedon Apr 13, 2016
@akx
pybabel extract --no-default-keywords -k '_LW' test -o test233.pot
Works fine for me, the content is as expected. Only _LW is extracted
akx commentedon Apr 13, 2016
@ajaeger Okiedoke, thanks.
I'd like to take this moment to point out that distutils' command mangling code is byzantine and strange, especially if one is used to modernities like click, argparse or even optparse... :)
ajaeger commentedon Apr 13, 2016
@akx, just tested that Babel 2.3.2 handles this case fine.
ajaeger commentedon Apr 13, 2016
@akx, thanks for looking into this nevertheless!
akx commentedon Apr 13, 2016
Ah, the bug is actually not in
--no-default-keywordsbeing disrespected, it's in how the keyword string gets parsed.I instrumented the extraction function to parse the args and die, and I get
[-]no-default-keywords has no effect in 2.3.3[/-][+]2.3.3 distutils extract_messages misparses --keywords[/+]ajaeger commentedon Apr 13, 2016
How did it work in 2.3.2 and earlier?
akx commentedon Apr 13, 2016
2.3.3 changed that particular parsing code to do things differently to have the
pybabelcommands work correctly with multiple keywords (your issue #384), but unfortunately broke support fordistutilsarguments. In short-k/--keywordsarguments forpybabel extract-k/--keywordsargument accepted by distutilsextract_messagesI'll try and get a bugfix in asap. Honestly I'm a little embarrassed by these.
2 remaining items
Blacklist broken Babel releases
Updated openstack/openstack
Harmonize extraction keyword parsing between distutils and standalone…
akx commentedon Apr 14, 2016
@ajaeger: Would you be able to test that all of Openstack's usecases (since apparently some of your processes use
pybabelas evident from #384 and others use the distutils-based commands as evident here) work with the code in #389?ajaeger commentedon Apr 14, 2016
@akx I can test the common two use cases, just tell me if you have something to test.
I've wrote also a patch to use only pybabel in OpenStack infra scripts - one issue less to test. Let's see what the reviewers think.
ajaeger commentedon Apr 15, 2016
Sorry, misread your notice, @akx. You already told me what to test. I did some testing and it looks fine to me. Thanks!
Harmonize extraction keyword parsing between distutils and standalone…
Fix CLI regressions (see below for details)
Fix CLI regressions (see below for details)
Fix CLI regressions (see below for details)
Blacklist broken Babel releases
Blacklist broken Babel releases
Blacklist broken Babel releases
Update patch set 1