Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Open an empty directory 2. run `$ python2 -msphinx -M html . _build` 3. watch output Actual results: Fails in gettext (which is part of python2-libs and thus the python2 package) with this traceback: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/sphinx/__main__.py", line 14, in <module> sys.exit(main(sys.argv)) File "/usr/lib/python2.7/site-packages/sphinx/__init__.py", line 66, in main sys.exit(build_main(argv)) File "/usr/lib/python2.7/site-packages/sphinx/__init__.py", line 76, in build_main from sphinx import cmdline File "/usr/lib/python2.7/site-packages/sphinx/cmdline.py", line 14, in <module> import optparse File "/usr/lib64/python2.7/optparse.py", line 419, in <module> _builtin_cvt = { "int" : (_parse_int, _("integer")), File "/usr/lib64/python2.7/gettext.py", line 644, in gettext return dgettext(_current_domain, message) File "/usr/lib64/python2.7/gettext.py", line 608, in dgettext codeset=_localecodesets.get(domain)) File "/usr/lib64/python2.7/gettext.py", line 543, in translation mofiles = find(domain, localedir, languages, all=1) File "/usr/lib64/python2.7/gettext.py", line 515, in find for nelang in _expand_lang(lang): File "/usr/lib64/python2.7/gettext.py", line 206, in _expand_lang from locale import normalize ImportError: cannot import name normalize Expected results: No traceback. If python2-libs requires a module, it must either provide the module itself, have a Requires: on a package providing this module or provide a fallback to work without that module. Additional info: python2-libs-2.7.13-12.fc26.x86_64
That's weird -- both the gettext and locale modules should be provided by python2-libs. To debug, could run these commands and post the output here? rpm --verify python2-libs python2 -c 'import locale; print(locale)' python2 -c 'import sys; print(sys.path)'
Also, is this reproducible on your system with just: $ python2 -c 'from locale import normalize' ?
(In reply to Petr Viktorin from comment #1) > […] $ rpm --verify python2-libs $ echo $? 0 $ python2 -c 'import locale; print(locale)' <module 'locale' from '/usr/lib64/python2.7/locale.pyc'> $ echo $? 0 $ python2 -c 'import sys; print(sys.path)'['', '/usr/lib/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/home/username/.local/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages'] $ echo $? 0 (In reply to Miro Hrončok from comment #2) > Also, is this reproducible on your system with just: $ python2 -c 'from locale import normalize' $ echo $? 0
Is the pwd truly empty when you run step 2? I can only reproduce this by creating a fake (i.e. empty) locale module in pwd. (You clearly said it's an empty directory, I'm just trying to be double sure.)
(In reply to Miro Hrončok from comment #4) > Is the pwd truly empty when you run step 2? I can only reproduce this by > creating a fake (i.e. empty) locale module in pwd. (You clearly said it's an > empty directory, I'm just trying to be double sure.) It doesn't matter whether pwd is empty in this step or not, I'm getting the same backtrace in either case. I just wrote that the directory should be empty to make the steps easier to reproduce.
Could any of you reproduce the backtrace with the steps in comment #0? This issue is also affecting python3-sphinx, i.e. it can also be reproduced by executing $ python3 -msphinx -M html . _build in an empty directory, so it might be a bug in sphinx too. Because of that, I'm adding the sphinx maintainers too.
Note that I can't reproduce this issue on a different machine with Fedora 27 installed, but otherwise very similar setup.
Oh! I see now. And I can finally reproduce. Looks like a bug in Sphinx. Sphinx has: /usr/lib/python2.7/site-packages/sphinx/locale/__init__.py and in python2, when running "-m sphinx", importing "locale" from anywhere gives you Sphinx's locale package. I'm not sure how to best fix this :(
Let me know if I can help from the Python side. The semantics of python2 are quite unfortunate.
(In reply to Christian Stadelmann from comment #7) > Note that I can't reproduce this issue on a different machine with Fedora 27 > installed, but otherwise very similar setup. I think this issue has been fixed upstream already. Updating python-sphinx (see bug #1508237 for that) might be enough to get rid of this bug.
The builds from `pip install --user sphinx` work fine too after uninstalling the python2-spinx package from Fedora 26.
(In reply to Christian Stadelmann from comment #10) > (In reply to Christian Stadelmann from comment #7) > > Note that I can't reproduce this issue on a different machine with Fedora 27 > > installed, but otherwise very similar setup. > > I think this issue has been fixed upstream already. Updating python-sphinx > (see bug #1508237 for that) might be enough to get rid of this bug. Will take care of updating sphinx, however versions 1.6+ is only on F27+ since it introduces breaking changes. F26 currently is on 1.5.2 while the current upstream version from that branch is 1.5.5. Christian would you be able to test the 1.5.5 version to see if the issue is fixed there? If not I can try to bisect the issue and backport the fix to F26.
Tested it myself in a mock chroot and I was able to verify that the issue is indeed fixed by version 1.5.5. Will push an update.
python-sphinx-1.5.5-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-00050526e6
python-sphinx-1.5.5-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.