File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/setuptools_scm/_integration Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def read_dist_name_from_setup_cfg(
14
14
parser = configparser .ConfigParser ()
15
15
16
16
if isinstance (input , (os .PathLike , str )):
17
- parser .read ([input ])
17
+ parser .read ([input ], encoding = "utf-8" )
18
18
else :
19
19
parser .read_file (input )
20
20
Original file line number Diff line number Diff line change 6
6
7
7
import pytest
8
8
9
+ import setuptools_scm ._integration .setuptools
9
10
from .wd_wrapper import WorkDir
10
11
from setuptools_scm import PRETEND_KEY
11
12
from setuptools_scm import PRETEND_KEY_NAMED
@@ -152,3 +153,20 @@ def test_distribution_procides_extras() -> None:
152
153
153
154
dist = distribution ("setuptools_scm" )
154
155
assert sorted (dist .metadata .get_all ("Provides-Extra" )) == ["test" , "toml" ]
156
+
157
+
158
+ @pytest .mark .issue (760 )
159
+ def test_unicode_in_setup_cfg (tmp_path : Path ) -> None :
160
+ cfg = tmp_path / "setup.cfg"
161
+ cfg .write_text (
162
+ textwrap .dedent (
163
+ """
164
+ [metadata]
165
+ name = configparser
166
+ author = Łukasz Langa
167
+ """
168
+ ),
169
+ encoding = "utf-8" ,
170
+ )
171
+ name = setuptools_scm ._integration .setuptools .read_dist_name_from_setup_cfg (cfg )
172
+ assert name == "configparser"
You can’t perform that action at this time.
0 commit comments