mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-22 23:30:48 +00:00
Fix UnicodeDecodeError for CPython 3.6.15 and 3.7.12 (#2237)
This commit is contained in:
parent
42e6409f6c
commit
7ea0408966
2 changed files with 60 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
From d9782f66445c9fa5d835ad29c23b22be85cde354 Mon Sep 17 00:00:00 2001
|
||||
From: Ronald Oussoren <ronaldoussoren@mac.com>
|
||||
Date: Sat, 14 Nov 2020 16:07:47 +0100
|
||||
Subject: [PATCH] bpo-42351: Avoid error when opening header with non-UTF8
|
||||
encoding (GH-23279)
|
||||
|
||||
grep_headers_for() would error out when a header contained
|
||||
text that cannot be interpreted as UTF-8.
|
||||
|
||||
cherry-picked from 7a27c7ed4b by Pedro Fonini <fonini@ip.tv>
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 4aaa51e0d4..3556bbe041 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -184,7 +184,7 @@ def is_macosx_sdk_path(path):
|
||||
|
||||
def grep_headers_for(function, headers):
|
||||
for header in headers:
|
||||
- with open(header, 'r') as f:
|
||||
+ with open(header, 'r', errors='surrogateescape') as f:
|
||||
if function in f.read():
|
||||
return True
|
||||
return False
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
From 245427d207ee88a4ba26a66c3de350bcbcc036f2 Mon Sep 17 00:00:00 2001
|
||||
From: Ronald Oussoren <ronaldoussoren@mac.com>
|
||||
Date: Sat, 14 Nov 2020 16:07:47 +0100
|
||||
Subject: [PATCH] bpo-42351: Avoid error when opening header with non-UTF8
|
||||
encoding (GH-23279)
|
||||
|
||||
grep_headers_for() would error out when a header contained
|
||||
text that cannot be interpreted as UTF-8.
|
||||
|
||||
cherry-picked from 7a27c7ed4b by Pedro Fonini <fonini@ip.tv>
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f211989aac..467362813d 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -159,7 +159,7 @@ def is_macosx_sdk_path(path):
|
||||
|
||||
def grep_headers_for(function, headers):
|
||||
for header in headers:
|
||||
- with open(header, 'r') as f:
|
||||
+ with open(header, 'r', errors='surrogateescape') as f:
|
||||
if function in f.read():
|
||||
return True
|
||||
return False
|
||||
--
|
||||
2.34.1
|
||||
|
Loading…
Reference in a new issue