Skip to content
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

sphinx-quickstart fails when $LC_ALL is empty #5724

Closed
cocoatomo opened this issue Dec 4, 2018 · 2 comments
Closed

sphinx-quickstart fails when $LC_ALL is empty #5724

cocoatomo opened this issue Dec 4, 2018 · 2 comments

Comments

@cocoatomo
Copy link
Contributor

Subject: sphinx-quickstart fails when $LC_ALL is empty

Problem

  • sphinx-quickstart fails when $LC_ALL is empty

Procedure to reproduce the problem

$ python3.7 -m venv venv
$ . venv/bin/activate
(venv) $ pip install sphinx
(venv) $ export LC_ALL=
(venv) $ sphinx-quickstart

Error logs / results

Traceback (most recent call last):
  File "/private/tmp/issue/venv/bin/sphinx-quickstart", line 11, in <module>
    sys.exit(main())
  File "/private/tmp/issue/venv/lib/python3.7/site-packages/sphinx/cmd/quickstart.py", line 616, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/locale.py", line 604, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Expected results

sphinx-quickstart do not raise exception

Reproducible project / your project

  • Nothing (this issue occurs before having a project created)

Environment info

  • OS: macOS 10.14.1
  • Python version: 3.7
  • Sphinx version: 1.8.2
@tk0miya tk0miya added this to the 1.8.3 milestone Dec 15, 2018
@ghost
Copy link

ghost commented Dec 15, 2018

I don't believe this is a Sphinx bug specifically. The idiom of locale.setlocale(locale.LC_ALL, '') works on Windows/Linux even if LC_ALL is empty. From research it seems to be a problem specific to Mac:

https://bugs.python.org/issue18378#msg215215

@tk0miya
Copy link
Member

tk0miya commented Dec 17, 2018

@remyabel Thank you for comment.

I understand the error has been filed on bugs.python.org. I just made a workaround for the bug at #5829.
I believe it helps users on Mac OS.

tk0miya added a commit that referenced this issue Dec 18, 2018
Fix #5724: quickstart: sphinx-quickstart fails when $LC_ALL is empty
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants