File locale-test_float_with_commad.patch of Package python3.42041

---
 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	2019-03-18 17:51:26.000000000 +0100
+++ Python-3.4.10/Lib/locale.py	2025-12-21 01:49:31.295210554 +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