File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
2020- Metadata length validation is buggy for unicode strings #158
2121- Pillow 10.4.0 reveals improper type hints for image probing functions #177
22+ - Enhance error when locale fails to setup #157
2223
2324## [ 3.4.0] - 2024-06-21
2425
Original file line number Diff line number Diff line change @@ -56,7 +56,13 @@ def setlocale(root_dir: pathlib.Path, locale_name: str):
5656 """set the desired locale for gettext.
5757
5858 call this early"""
59- return Locale .setup (root_dir / "locale" , locale_name )
59+ try :
60+ return Locale .setup (root_dir / "locale" , locale_name )
61+ except locale .Error as exc :
62+ raise locale .Error (
63+ f"Failed to setup '{ locale_name } ' locale. If this locale is not installed "
64+ "on this system, please install it first."
65+ ) from exc
6066
6167
6268def get_iso_lang_data (lang : str ) -> tuple [dict , dict | None ]:
You can’t perform that action at this time.
0 commit comments