Closes #25185: Use UTF-8 encoding when reading pyvenv.cfg.

This commit is contained in:
Vinay Sajip 2015-10-01 11:27:00 +01:00
parent f731bc09fa
commit f223c53218
1 changed files with 3 additions and 1 deletions

View File

@ -472,7 +472,9 @@ def venv(known_paths):
config_line = re.compile(CONFIG_LINE)
virtual_conf = candidate_confs[0]
system_site = "true"
with open(virtual_conf) as f:
# Issue 25185: Use UTF-8, as that's what the venv module uses when
# writing the file.
with open(virtual_conf, encoding='utf-8') as f:
for line in f:
line = line.strip()
m = config_line.match(line)