Skip to content

Commit a9df39a

Browse files
committed
Use unicode for filesystem stuff on Python 2
1 parent b8043ec commit a9df39a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/pip/_internal/operations/install/wheel.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969

7070
def rehash(path, blocksize=1 << 20):
71-
# type: (str, int) -> Tuple[str, str]
71+
# type: (text_type, int) -> Tuple[str, str]
7272
"""Return (encoded_digest, length) for path using hashlib.sha256()"""
7373
h, length = hash_file(path, blocksize)
7474
digest = 'sha256=' + urlsafe_b64encode(
@@ -90,7 +90,7 @@ def csv_io_kwargs(mode):
9090

9191

9292
def fix_script(path):
93-
# type: (str) -> Optional[bool]
93+
# type: (text_type) -> Optional[bool]
9494
"""Replace #!python with #!/path/to/python
9595
Return True if file was changed.
9696
"""
@@ -248,7 +248,7 @@ def _normalized_outrows(outrows):
248248

249249

250250
def _record_to_fs_path(record_path):
251-
# type: (RecordPath) -> str
251+
# type: (RecordPath) -> text_type
252252
return record_path
253253

254254

@@ -391,8 +391,8 @@ def clobber(
391391
source, # type: text_type
392392
dest, # type: text_type
393393
is_base, # type: bool
394-
fixer=None, # type: Optional[Callable[[str], Any]]
395-
filter=None # type: Optional[Callable[[str], bool]]
394+
fixer=None, # type: Optional[Callable[[text_type], Any]]
395+
filter=None # type: Optional[Callable[[text_type], bool]]
396396
):
397397
# type: (...) -> None
398398
ensure_dir(dest) # common for the 'include' path
@@ -464,7 +464,7 @@ def clobber(
464464
console, gui = get_entrypoints(ep_file)
465465

466466
def is_entrypoint_wrapper(name):
467-
# type: (str) -> bool
467+
# type: (text_type) -> bool
468468
# EP, EP.exe and EP-script.py are scripts generated for
469469
# entry point EP by setuptools
470470
if name.lower().endswith('.exe'):

src/pip/_internal/utils/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ def is_console_interactive():
876876

877877

878878
def hash_file(path, blocksize=1 << 20):
879-
# type: (str, int) -> Tuple[Any, int]
879+
# type: (Text, int) -> Tuple[Any, int]
880880
"""Return (hash, length) for path using hashlib.sha256()
881881
"""
882882

0 commit comments

Comments
 (0)