mirror of https://github.com/pypa/pip
Merge pull request #5482 from ambv/utf8fun
Open pyproject.toml with UTF-8 encoding in all environments
This commit is contained in:
commit
09cd649277
|
@ -0,0 +1 @@
|
|||
Always read ``pyproject.toml`` as UTF-8. This fixes Unicode handling on Windows and Python 2.
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
@ -444,7 +445,7 @@ class InstallRequirement(object):
|
|||
requirements, pip will default to installing setuptools and wheel.
|
||||
"""
|
||||
if os.path.isfile(self.pyproject_toml):
|
||||
with open(self.pyproject_toml) as f:
|
||||
with io.open(self.pyproject_toml, encoding="utf-8") as f:
|
||||
pp_toml = pytoml.load(f)
|
||||
build_sys = pp_toml.get('build-system', {})
|
||||
return (build_sys.get('requires', ['setuptools', 'wheel']), True)
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
|
||||
# Note: pyproject.toml is always UTF-8 🤡
|
||||
|
|
Loading…
Reference in New Issue