summaryrefslogtreecommitdiff
path: root/devel/py-colorama/files/patch-setup.py
blob: fdc9e02d0db49c8323ff0e164cd5313cb875ec6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Default to UTF-8 encoding to fix build with Python 3.6

Obtained from: https://github.com/tartley/colorama/pull/294/files

--- setup.py.orig	2020-10-12 21:22:32 UTC
+++ setup.py
@@ -3,6 +3,7 @@
 
 from __future__ import with_statement
 
+from io import open
 import os
 import re
 try:
@@ -14,8 +15,9 @@ except ImportError:
 NAME = 'colorama'
 
 
-def read_file(path):
-    with open(os.path.join(os.path.dirname(__file__), path)) as fp:
+def read_file(path, encoding='utf8'):
+    with open(os.path.join(os.path.dirname(__file__), path),
+              encoding=encoding) as fp:
         return fp.read()
 
 def _get_version_match(content):