This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.fahlgren
Recipients Anthony Sottile, bethard, eric.fahlgren
Date 2019-01-19.22:44:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547937885.98.0.456507474313.issue35785@roundup.psfhosted.org>
In-reply-to
Content
After a bit more digging, it's a side effect of having the locale set with 'Plural-Forms'.  I've attached the resulting .mo file, but since it's a binary, I'm not sure it will work cross-platform, so here's how to recreate it.

> cat en_US/LC_MESSAGES/foo.po
msgid ""
msgstr "Plural-Forms: nplurals=2; plural=(n != 1);\n"

> python /Python37/Tools/i18n/msgfmt.py en_US/LC_MESSAGES/foo.po
> ll en_US/LC_MESSAGES/
-rwx------+ 1 efahlgren Domain Users 89 2019-01-19 14:36 foo.mo*
-rw-r--r--+ 1 efahlgren Domain Users 69 2019-01-19 14:34 foo.po

Then you can reproduce with some setup in your script:

import os
import gettext
import argparse

os.putenv('LANG', 'en_US')  # Just to make sure.
gettext.bindtextdomain('foo', '.')
gettext.textdomain('foo')

p = argparse.ArgumentParser()
p.add_argument('--foo', nargs=None)
p.parse_args()
History
Date User Action Args
2019-01-19 22:44:46eric.fahlgrensetrecipients: + eric.fahlgren, bethard, Anthony Sottile
2019-01-19 22:44:45eric.fahlgrensetmessageid: <1547937885.98.0.456507474313.issue35785@roundup.psfhosted.org>
2019-01-19 22:44:45eric.fahlgrenlinkissue35785 messages
2019-01-19 22:44:45eric.fahlgrencreate