diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2019-04-05 13:20:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-05 13:20:16 -0400 |
| commit | 4edd0d57228da37795f9600ec06363d0a24cada8 (patch) | |
| tree | 77d004a97ec9f95fa1dcfe75308772b55e5a313d /setuptools/unicode_utils.py | |
| parent | 393809a02ed4d0f07faec5c1f23384233e6cd68e (diff) | |
| parent | f36781084f8f870ea747d477bd742057ea022421 (diff) | |
| download | python-setuptools-git-4edd0d57228da37795f9600ec06363d0a24cada8.tar.gz | |
Merge pull request #1735 from pypa/bugfix/1702-utf8-config
When reading config files, require them to be encoded with UTF-8.
Diffstat (limited to 'setuptools/unicode_utils.py')
| -rw-r--r-- | setuptools/unicode_utils.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/setuptools/unicode_utils.py b/setuptools/unicode_utils.py index 3b8179a8..7c63efd2 100644 --- a/setuptools/unicode_utils.py +++ b/setuptools/unicode_utils.py @@ -1,6 +1,5 @@ import unicodedata import sys -import re from setuptools.extern import six @@ -43,15 +42,3 @@ def try_encode(string, enc): return string.encode(enc) except UnicodeEncodeError: return None - - -CODING_RE = re.compile(br'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)') - - -def detect_encoding(fp): - first_line = fp.readline() - fp.seek(0) - m = CODING_RE.match(first_line) - if m is None: - return None - return m.group(1).decode('ascii') |
