mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge branch 'master' into logs_handlers
This commit is contained in:
commit
9d10b20976
3 changed files with 11 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ repos:
|
|||
- id: forbid-new-submodules
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.1.5
|
||||
rev: v0.1.15
|
||||
hooks:
|
||||
- id: ruff
|
||||
- id: ruff-format
|
||||
|
|
|
|||
|
|
@ -132,6 +132,10 @@ class DateFormatter:
|
|||
|
||||
def __init__(self) -> None:
|
||||
self.locale = locale.setlocale(locale.LC_TIME)
|
||||
# python has issue with Turkish_Türkiye.1254 locale, replace it to
|
||||
# something accepted: Turkish
|
||||
if self.locale == "Turkish_Türkiye.1254":
|
||||
self.locale = "Turkish"
|
||||
|
||||
def __call__(self, date: datetime.datetime, date_format: str) -> str:
|
||||
# on OSX, encoding from LC_CTYPE determines the unicode output in PY3
|
||||
|
|
@ -922,6 +926,10 @@ def temporary_locale(
|
|||
class to use the C locale.
|
||||
"""
|
||||
orig_locale = locale.setlocale(lc_category)
|
||||
# python has issue with Turkish_Türkiye.1254 locale, replace it to
|
||||
# something accepted: Turkish
|
||||
if orig_locale == "Turkish_Türkiye.1254":
|
||||
orig_locale = "Turkish"
|
||||
if temp_locale:
|
||||
locale.setlocale(lc_category, temp_locale)
|
||||
yield
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ changelog-header = "###############"
|
|||
version-header = "="
|
||||
|
||||
[tool.pdm]
|
||||
ignore_package_warnings = ["sphinx"]
|
||||
|
||||
[tool.pdm.scripts]
|
||||
docbuild = "invoke docbuild"
|
||||
|
|
@ -95,7 +96,7 @@ dev = [
|
|||
"pytest-xdist>=3.4.0",
|
||||
"tox>=4.11.3",
|
||||
"invoke>=2.2.0",
|
||||
"ruff>=0.1.5,<0.2.0",
|
||||
"ruff>=0.1.15,<0.2.0",
|
||||
"tomli>=2.0.1; python_version < \"3.11\"",
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue