]> granicus.if.org Git - python/commitdiff
Closes #25185: Use UTF-8 encoding when reading pyvenv.cfg.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 1 Oct 2015 10:27:00 +0000 (11:27 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Thu, 1 Oct 2015 10:27:00 +0000 (11:27 +0100)
Lib/site.py

index ad5d136ac0eeeb73c64eb07b64eee9153e563f6e..3c8584b12a64ae0ce3247f5ec1c4728d97a06adf 100644 (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)