mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Use encoding
option or binary mode for open()
This commit is contained in:
parent
bbf8466088
commit
fb62f2707a
|
@ -766,7 +766,7 @@ def _install_wheel(
|
|||
# Record the REQUESTED file
|
||||
if requested:
|
||||
requested_path = os.path.join(dest_info_dir, 'REQUESTED')
|
||||
with open(requested_path, "w"):
|
||||
with open(requested_path, "wb"):
|
||||
pass
|
||||
generated.append(requested_path)
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ class RequirementTracker:
|
|||
assert req not in self._entries
|
||||
|
||||
# Start tracking this requirement.
|
||||
with open(entry_path, 'w') as fp:
|
||||
with open(entry_path, 'w', encoding="utf-8") as fp:
|
||||
fp.write(str(req))
|
||||
self._entries.add(req)
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ class SelfCheckState:
|
|||
cache_dir, "selfcheck", _get_statefile_name(self.key)
|
||||
)
|
||||
try:
|
||||
with open(self.statefile_path) as statefile:
|
||||
with open(self.statefile_path, encoding="utf-8") as statefile:
|
||||
self.state = json.load(statefile)
|
||||
except (OSError, ValueError, KeyError):
|
||||
# Explicitly suppressing exceptions, since we don't want to
|
||||
|
|
Loading…
Reference in a new issue