File locale-test_float_with_commad.patch of Package python3.41795

---
 Lib/locale.py |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: Python-3.4.10/Lib/locale.py
===================================================================
--- Python-3.4.10.orig/Lib/locale.py	2025-11-23 22:19:13.637359989 +0100
+++ Python-3.4.10/Lib/locale.py	2025-11-23 22:19:51.815015991 +0100
@@ -111,6 +111,15 @@
     d = _localeconv()
     if _override_localeconv:
         d.update(_override_localeconv)
+    # decode byte strings
+    encoding = getpreferredencoding(False)
+    for k, v in d.items():
+        if isinstance(v, bytes):
+            try:
+                d[k] = v.decode(encoding)
+            except UnicodeDecodeError:
+                # fall back to the default encoding
+                d[k] = v.decode(sys.getdefaultencoding(), 'surrogateescape')
     return d
 
 
openSUSE Build Service is sponsored by