[neon/forks/pyqt5/Neon/unstable] debian/patches: set the default encoding to C when locale.getdefaultlocale() returns (None, None)

Georges Khaznadar null at kde.org
Mon Jan 16 04:06:46 GMT 2023


Git commit d009e9e44daeab330dd4c419da40a23c7186fb8a by Georges Khaznadar.
Committed on 02/10/2022 at 17:28.
Pushed by carlosdem into branch 'Neon/unstable'.

set the default encoding to C when locale.getdefaultlocale() returns (None, None)

A  +19   -0    debian/patches/getdefaultlocale.patch
A  +1    -0    debian/patches/series

https://invent.kde.org/neon/forks/pyqt5/commit/d009e9e44daeab330dd4c419da40a23c7186fb8a

diff --git a/debian/patches/getdefaultlocale.patch b/debian/patches/getdefaultlocale.patch
new file mode 100644
index 00000000..69fb4289
--- /dev/null
+++ b/debian/patches/getdefaultlocale.patch
@@ -0,0 +1,19 @@
+Default encoding set to "C", when locale.getdefaultlocale()
+returns (None, None)
+Index: pyqt5/pylupdate/pylupdate_main.py
+===================================================================
+--- pyqt5.orig/pylupdate/pylupdate_main.py
++++ pyqt5/pylupdate/pylupdate_main.py
+@@ -70,7 +70,11 @@ def updateTsFiles(fetchedTor, tsFileName
+ 
+ 
+ def _encoded_path(path):
+-    return path.encode(locale.getdefaultlocale()[1])
++    encoding = locale.getdefaultlocale()[1]
++    if encoding is None:
++        # fall back to the C encoding
++        encoding = "C"
++    return path.encode(encoding)
+ 
+ 
+ def main():
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000..5aefe304
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+getdefaultlocale.patch



More information about the Neon-commits mailing list