-
Notifications
You must be signed in to change notification settings - Fork 50
Further problems with locale #519
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
Comments
To understand what is going on, it would be useful to print the value that is causing the error. Do you think you could modify the build so it prints that out? |
from @SciTools/peloton: AFAIK: For locale, setting LC_ALL=C should set sensible defaults for all the local settings...(such as LC_NUMERIC) |
@ESadek-MO I am actually doing that in here ESMValGroup/ESMValCore#2706 and that doesn't really help much; note that we are seeing flakiness in this fail, it's about 80% fail 20% pass |
also note these rather relevant Sphinx issues: sphinx-doc/sphinx#13485 (very recent) and sphinx-doc/sphinx#11739 (probably marginally related) |
woop: actually setting |
From @SciTools/peloton: We got this info from @ukmo-ccbunney who isn't available right now. Locale stuff is a bit of a mystery to us, but we're happy that this workaround "just works". |
@stephenworsley it'd be rather useful uf we could fibd out if something in iris is changing the locale settings. My hunch is it's nothing in iris though, since a) it started happening (to us, at least) all of a sudden, and b) others are reporting similar issues to Sphinx. |
We know that it's not Not sure how to progress or investigate this ... |
If you could print out the value of Somehow |
@bjlittle some info from ESMValGroup/ESMValCore#2706 (comment) - I tested with cf-units==3.3.0 and all is fine, unless one has iris>=3.11 and Python==3.13.3, there was that change in 3.13.3 that I quote in the comment; we don't see any issues with Python<3.13.3; there may be multiple problems playing up at the same time, but whatever it hits us in the docs build is not happening without iris>=3.11 and Python==3.13.3 🍺 |
also, as a kluge we found out that by resetting the
that fixes the problem, but the cause is yet to be identified |
Some further debugging results of the recent issue: restoring the locale to the previous setting works fine with Python 3.13.2 but does not work anymore with Python 3.13.3. Possibly this is caused by the changes in python/cpython#129647. Python 3.13.3 example:
Python 3.13.2 example:
|
Opened python/cpython#133967 to ask if this is a bug or intended behaviour. |
Uh oh!
There was an error while loading. Please reload this page.
As reported here in the context of iris-esmf-regrid,
the current save - modify - restore code for the locale setting it seems does not always work correctly.
This was reported in #435, fixed by #436, introduced in v3.3.0
Not clear yet what is actually wrong, but for iris-esmf-regrid it seems to occur specifically in readthedocs builds.
The case given should hopefully point to it.
Detail
ReadTheDocs log captured here from a ReadTheDocs build test (i.e. its error log) on commit SciTools/iris-esmf-regrid@b5edcd7 , in SciTools/iris-esmf-regrid#431.
Since we can't expect that record to persist
python -m sphinx -T -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html Running Sphinx v8.1.3
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/esmf_regrid-0.12.dev0-py3.10.egg/esmf_regrid/init.py", line 11, in
import iris.mesh as _imesh
ModuleNotFoundError: No module named 'iris.mesh'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/config.py", line 529, in eval_config_file
exec(code, namespace) # NoQA: S102
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/checkouts/431/docs/src/conf.py", line 34, in
from esmf_regrid import version as esmf_r_version
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/esmf_regrid-0.12.dev0-py3.10.egg/esmf_regrid/init.py", line 14, in
import iris.experimental.ugrid as _imesh
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/experimental/ugrid/init.py", line 18, in
from .load import PARSE_UGRID_ON_LOAD, load_mesh, load_meshes
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/experimental/ugrid/load.py", line 22, in
from ...coords import AuxCoord
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/coords.py", line 23, in
from iris.common import (
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/common/init.py", line 9, in
from .mixin import *
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/common/mixin.py", line 10, in
import cf_units
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/cf_units/init.py", line 198, in
with suppress_errors(), c_locale():
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/contextlib.py", line 142, in exit
next(self.gen)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/cf_units/init.py", line 191, in c_locale
locale.setlocale(locale.LC_NUMERIC, lc_numeric)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/locale.py", line 620, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/cmd/build.py", line 496, in build_main
app = Sphinx(
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/application.py", line 238, in init
self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/config.py", line 316, in read
namespace = eval_config_file(filename, tags)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/config.py", line 542, in eval_config_file
raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/esmf_regrid-0.12.dev0-py3.10.egg/esmf_regrid/init.py", line 11, in
import iris.mesh as _imesh
ModuleNotFoundError: No module named 'iris.mesh'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/config.py", line 529, in eval_config_file
exec(code, namespace) # NoQA: S102
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/checkouts/431/docs/src/conf.py", line 34, in
from esmf_regrid import version as esmf_r_version
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/esmf_regrid-0.12.dev0-py3.10.egg/esmf_regrid/init.py", line 14, in
import iris.experimental.ugrid as _imesh
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/experimental/ugrid/init.py", line 18, in
from .load import PARSE_UGRID_ON_LOAD, load_mesh, load_meshes
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/experimental/ugrid/load.py", line 22, in
from ...coords import AuxCoord
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/coords.py", line 23, in
from iris.common import (
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/common/init.py", line 9, in
from .mixin import *
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/common/mixin.py", line 10, in
import cf_units
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/cf_units/init.py", line 198, in
with suppress_errors(), c_locale():
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/contextlib.py", line 142, in exit
next(self.gen)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/cf_units/init.py", line 191, in c_locale
locale.setlocale(locale.LC_NUMERIC, lc_numeric)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/locale.py", line 620, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/esmf_regrid-0.12.dev0-py3.10.egg/esmf_regrid/init.py", line 11, in
import iris.mesh as _imesh
ModuleNotFoundError: No module named 'iris.mesh'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/sphinx/config.py", line 529, in eval_config_file
exec(code, namespace) # NoQA: S102
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/checkouts/431/docs/src/conf.py", line 34, in
from esmf_regrid import version as esmf_r_version
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/esmf_regrid-0.12.dev0-py3.10.egg/esmf_regrid/init.py", line 14, in
import iris.experimental.ugrid as _imesh
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/experimental/ugrid/init.py", line 18, in
from .load import PARSE_UGRID_ON_LOAD, load_mesh, load_meshes
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/experimental/ugrid/load.py", line 22, in
from ...coords import AuxCoord
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/coords.py", line 23, in
from iris.common import (
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/common/init.py", line 9, in
from .mixin import *
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/iris/common/mixin.py", line 10, in
import cf_units
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/cf_units/init.py", line 198, in
with suppress_errors(), c_locale():
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/contextlib.py", line 142, in exit
next(self.gen)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/site-packages/cf_units/init.py", line 191, in c_locale
locale.setlocale(locale.LC_NUMERIC, lc_numeric)
File "/home/docs/checkouts/readthedocs.org/user_builds/iris-esmf-regrid/conda/431/lib/python3.10/locale.py", line 620, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
The text was updated successfully, but these errors were encountered: