churchyard / rpms / python3

Forked from rpms/python3 6 years ago
Clone

Blame 00177-platform-unicode.patch

7c28d2c
Index: Python-3.3.0/Lib/platform.py
7c28d2c
===================================================================
7c28d2c
--- Python-3.3.0.orig/Lib/platform.py
7c28d2c
+++ Python-3.3.0/Lib/platform.py
7c28d2c
@@ -331,7 +331,7 @@ def linux_distribution(distname='', vers
7c28d2c
         return _dist_try_harder(distname,version,id)
7c28d2c
 
7c28d2c
     # Read the first line
7c28d2c
-    with open('/etc/'+file, 'r') as f:
7c28d2c
+    with open('/etc/'+file, 'r', encoding='utf-8', errors='surrogateescape') as f:
7c28d2c
         firstline = f.readline()
7c28d2c
     _distname, _version, _id = _parse_release_file(firstline)
7c28d2c