File: getdefaultlocale.patch

package info (click to toggle)
pyqt5 5.15.11%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,044 kB
  • sloc: python: 92,840; cpp: 22,066; javascript: 721; xml: 285; makefile: 79; sh: 29
file content (19 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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():