Skip to content

Commit 9fd5981

Browse files
committed
Mark read_utf8_with_fallback as private
1 parent aeac45b commit 9fd5981

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

setuptools/command/develop.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools import namespaces
1111
import setuptools
1212

13-
from ..unicode_utils import read_utf8_with_fallback
13+
from ..unicode_utils import _read_utf8_with_fallback
1414

1515

1616
class develop(namespaces.DevelopInstaller, easy_install):
@@ -133,7 +133,7 @@ def uninstall_link(self):
133133

134134
contents = [
135135
line.rstrip()
136-
for line in read_utf8_with_fallback(self.egg_link).splitlines()
136+
for line in _read_utf8_with_fallback(self.egg_link).splitlines()
137137
]
138138

139139
if contents not in ([self.egg_path], [self.egg_path, self.setup_path]):
@@ -161,7 +161,7 @@ def install_egg_scripts(self, dist):
161161
for script_name in self.distribution.scripts or []:
162162
script_path = os.path.abspath(convert_path(script_name))
163163
script_name = os.path.basename(script_path)
164-
script_text = read_utf8_with_fallback(script_path)
164+
script_text = _read_utf8_with_fallback(script_path)
165165
self.install_script(dist, script_name, script_text, script_path)
166166

167167
return None

setuptools/package_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from setuptools.extern.more_itertools import unique_everseen
4242

4343
from .compat import py39
44-
from .unicode_utils import read_utf8_with_fallback
44+
from .unicode_utils import _read_utf8_with_fallback
4545

4646

4747
EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.+!]+)$')
@@ -1121,7 +1121,7 @@ def local_open(url):
11211121
for f in os.listdir(filename):
11221122
filepath = os.path.join(filename, f)
11231123
if f == 'index.html':
1124-
body = read_utf8_with_fallback(filepath)
1124+
body = _read_utf8_with_fallback(filepath)
11251125
break
11261126
elif os.path.isdir(filepath):
11271127
f += '/'

setuptools/unicode_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def try_encode(string, enc):
4646
return None
4747

4848

49-
def read_utf8_with_fallback(file: str, fallback_encoding=py39.LOCALE_ENCODING) -> str:
49+
def _read_utf8_with_fallback(file: str, fallback_encoding=py39.LOCALE_ENCODING) -> str:
5050
"""
5151
First try to read the file with UTF-8, if there is an error fallback to a
5252
different encoding ("locale" by default). Returns the content of the file.

setuptools/wheel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from setuptools.command.egg_info import write_requirements, _egg_basename
1919
from setuptools.archive_util import _unpack_zipfile_obj
2020

21-
from .unicode_utils import read_utf8_with_fallback
21+
from .unicode_utils import _read_utf8_with_fallback
2222

2323

2424
WHEEL_NAME = re.compile(
@@ -224,7 +224,7 @@ def _move_data_entries(destination_eggdir, dist_data):
224224
def _fix_namespace_packages(egg_info, destination_eggdir):
225225
namespace_packages = os.path.join(egg_info, 'namespace_packages.txt')
226226
if os.path.exists(namespace_packages):
227-
namespace_packages = read_utf8_with_fallback(namespace_packages).split()
227+
namespace_packages = _read_utf8_with_fallback(namespace_packages).split()
228228

229229
for mod in namespace_packages:
230230
mod_dir = os.path.join(destination_eggdir, *mod.split('.'))

0 commit comments

Comments
 (0)