diff options
| author | Julien Palard <julien@palard.fr> | 2022-09-27 15:56:47 +0200 |
|---|---|---|
| committer | Julien Palard <julien@palard.fr> | 2022-09-27 17:00:53 +0200 |
| commit | b35394aca15a51ff6fb44943c9f9530c68e685c4 (patch) | |
| tree | 431561ef49d7b0d6e45dcbcc3939e7fe00640221 /setuptools/config | |
| parent | badd7064e202635b8a94d5603b31a37ca7d58d6c (diff) | |
| download | python-setuptools-git-b35394aca15a51ff6fb44943c9f9530c68e685c4.tar.gz | |
expand: Give bytes to ast.parse to let it discover encoding cookie.
Diffstat (limited to 'setuptools/config')
| -rw-r--r-- | setuptools/config/expand.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/setuptools/config/expand.py b/setuptools/config/expand.py index 384504d8..693b2dbc 100644 --- a/setuptools/config/expand.py +++ b/setuptools/config/expand.py @@ -62,7 +62,7 @@ class StaticModule: """Proxy to a module object that avoids executing arbitrary code.""" def __init__(self, name: str, spec: ModuleSpec): - with open(spec.origin) as strm: # type: ignore + with open(spec.origin, mode='rb') as strm: # type: ignore src = strm.read() module = ast.parse(src) vars(self).update(locals()) |
