diff --git a/nxdrive/utils.py b/nxdrive/utils.py index e77b318581..a31321992e 100644 --- a/nxdrive/utils.py +++ b/nxdrive/utils.py @@ -1300,7 +1300,7 @@ def get_current_locale() -> str: else: import locale - encoding = locale.getpreferredencoding(False) or "" + encoding = locale.getlocale()[1] or "" # Guess the current locale name if WINDOWS: @@ -1314,7 +1314,7 @@ def get_current_locale() -> str: l10n_code = NSLocale.currentLocale() l10n = NSLocale.localeIdentifier(l10n_code) else: - l10n = locale.getpreferredencoding(False) or "" + l10n = locale.getlocale()[1] or "" return ".".join([l10n, encoding]) diff --git a/tests/conftest.py b/tests/conftest.py index 8a2de4fb85..c08b9b0496 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -95,6 +95,10 @@ def no_warnings(recwarn): continue elif "Cryptography will be significantly faster" in message: continue + elif "The default datetime adapter is deprecated as of Python 3.12" in message: + continue + elif "datetime.datetime" in message: + continue warn = f"{warning.filename}:{warning.lineno} {message}" print(warn, file=sys.stderr)