From fa4a5a67bb0ad80643cf73ff05138a2c197f5bc4 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 10 Apr 2024 18:39:03 -0600 Subject: [PATCH] Default locale logical compatibility with Python 3.12 (#1054) --- .github/workflows/tests.yml | 3 +++ apprise/AppriseLocale.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b9cc224..917fd56b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,6 +63,8 @@ jobs: python-version: "3.10" - os: "ubuntu-latest" python-version: "3.11" + - os: "ubuntu-latest" + python-version: "3.12" defaults: run: @@ -117,6 +119,7 @@ jobs: # and run project-specific tasks. - name: Setup project run: | + python -m pip install --upgrade pip setuptools wheel pip install --editable=. python setup.py compile_catalog diff --git a/apprise/AppriseLocale.py b/apprise/AppriseLocale.py index cb9512e5..e900ce5b 100644 --- a/apprise/AppriseLocale.py +++ b/apprise/AppriseLocale.py @@ -219,6 +219,9 @@ class AppriseLocale: try: # Acquire our locale lang = locale.getlocale()[0] + # Compatibility for Python >= 3.12 + if lang == 'C': + lang = AppriseLocale._default_language except (ValueError, TypeError) as e: # This occurs when an invalid locale was parsed from the