Skip to content

Commit

Permalink
Use unicode for filesystem stuff on Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed May 13, 2020
1 parent a41adf4 commit 12011be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/pip/_internal/operations/install/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@


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


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


def _record_to_fs_path(record_path):
# type: (RecordPath) -> str
# type: (RecordPath) -> text_type
return record_path


Expand Down Expand Up @@ -391,8 +391,8 @@ def clobber(
source, # type: text_type
dest, # type: text_type
is_base, # type: bool
fixer=None, # type: Optional[Callable[[str], Any]]
filter=None # type: Optional[Callable[[str], bool]]
fixer=None, # type: Optional[Callable[[text_type], Any]]
filter=None # type: Optional[Callable[[text_type], bool]]
):
# type: (...) -> None
ensure_dir(dest) # common for the 'include' path
Expand Down Expand Up @@ -464,7 +464,7 @@ def clobber(
console, gui = get_entrypoints(ep_file)

def is_entrypoint_wrapper(name):
# type: (str) -> bool
# type: (text_type) -> bool
# EP, EP.exe and EP-script.py are scripts generated for
# entry point EP by setuptools
if name.lower().endswith('.exe'):
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def is_console_interactive():


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

Expand Down

0 comments on commit 12011be

Please sign in to comment.