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(
1414 parser = configparser .ConfigParser ()
1515
1616 if isinstance (input , (os .PathLike , str )):
17- parser .read ([input ])
17+ parser .read ([input ], encoding = "utf-8" )
1818 else :
1919 parser .read_file (input )
2020
Original file line number Diff line number Diff line change 66
77import pytest
88
9+ import setuptools_scm ._integration .setuptools
910from .wd_wrapper import WorkDir
1011from setuptools_scm import PRETEND_KEY
1112from setuptools_scm import PRETEND_KEY_NAMED
@@ -152,3 +153,20 @@ def test_distribution_procides_extras() -> None:
152153
153154 dist = distribution ("setuptools_scm" )
154155 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