@@ -94,7 +94,7 @@ def test_egg_info_save_version_info_setup_empty(self, tmpdir_cwd, env):
94
94
ei .initialize_options ()
95
95
ei .save_version_info (setup_cfg )
96
96
97
- with open (setup_cfg , 'r' ) as f :
97
+ with open (setup_cfg , 'r' , encoding = "utf-8" ) as f :
98
98
content = f .read ()
99
99
100
100
assert '[egg_info]' in content
@@ -139,7 +139,7 @@ def test_egg_info_save_version_info_setup_defaults(self, tmpdir_cwd, env):
139
139
ei .initialize_options ()
140
140
ei .save_version_info (setup_cfg )
141
141
142
- with open (setup_cfg , 'r' ) as f :
142
+ with open (setup_cfg , 'r' , encoding = "utf-8" ) as f :
143
143
content = f .read ()
144
144
145
145
assert '[egg_info]' in content
@@ -251,7 +251,7 @@ def test_manifest_template_is_read(self, tmpdir_cwd, env):
251
251
self ._run_egg_info_command (tmpdir_cwd , env )
252
252
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
253
253
sources_txt = os .path .join (egg_info_dir , 'SOURCES.txt' )
254
- with open (sources_txt ) as f :
254
+ with open (sources_txt , encoding = "utf-8" ) as f :
255
255
assert 'docs/usage.rst' in f .read ().split ('\n ' )
256
256
257
257
def _setup_script_with_requires (self , requires , use_setup_cfg = False ):
@@ -492,7 +492,7 @@ def test_requires(
492
492
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
493
493
requires_txt = os .path .join (egg_info_dir , 'requires.txt' )
494
494
if os .path .exists (requires_txt ):
495
- with open (requires_txt ) as fp :
495
+ with open (requires_txt , encoding = "utf-8" ) as fp :
496
496
install_requires = fp .read ()
497
497
else :
498
498
install_requires = ''
@@ -538,7 +538,7 @@ def test_provides_extra(self, tmpdir_cwd, env):
538
538
env = environ ,
539
539
)
540
540
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
541
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
541
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
542
542
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
543
543
assert 'Provides-Extra: foobar' in pkg_info_lines
544
544
assert 'Metadata-Version: 2.1' in pkg_info_lines
@@ -557,7 +557,7 @@ def test_doesnt_provides_extra(self, tmpdir_cwd, env):
557
557
env = environ ,
558
558
)
559
559
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
560
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
560
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
561
561
pkg_info_text = pkginfo_file .read ()
562
562
assert 'Provides-Extra:' not in pkg_info_text
563
563
@@ -636,7 +636,7 @@ def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources
636
636
)
637
637
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
638
638
639
- with open (os .path .join (egg_info_dir , 'SOURCES.txt' )) as sources_file :
639
+ with open (os .path .join (egg_info_dir , 'SOURCES.txt' ), encoding = "utf-8" ) as sources_file :
640
640
sources_text = sources_file .read ()
641
641
642
642
if license_in_sources :
@@ -849,7 +849,7 @@ def test_setup_cfg_license_files(
849
849
)
850
850
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
851
851
852
- with open (os .path .join (egg_info_dir , 'SOURCES.txt' )) as sources_file :
852
+ with open (os .path .join (egg_info_dir , 'SOURCES.txt' ), encoding = "utf-8" ) as sources_file :
853
853
sources_lines = list (line .strip () for line in sources_file )
854
854
855
855
for lf in incl_licenses :
@@ -1033,7 +1033,7 @@ def test_setup_cfg_license_file_license_files(
1033
1033
)
1034
1034
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1035
1035
1036
- with open (os .path .join (egg_info_dir , 'SOURCES.txt' )) as sources_file :
1036
+ with open (os .path .join (egg_info_dir , 'SOURCES.txt' ), encoding = "utf-8" ) as sources_file :
1037
1037
sources_lines = list (line .strip () for line in sources_file )
1038
1038
1039
1039
for lf in incl_licenses :
@@ -1065,7 +1065,7 @@ def test_license_file_attr_pkg_info(self, tmpdir_cwd, env):
1065
1065
pypath = os .pathsep .join ([env .paths ['lib' ], str (tmpdir_cwd )]),
1066
1066
)
1067
1067
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1068
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1068
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1069
1069
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1070
1070
license_file_lines = [
1071
1071
line for line in pkg_info_lines if line .startswith ('License-File:' )
@@ -1086,7 +1086,7 @@ def test_metadata_version(self, tmpdir_cwd, env):
1086
1086
data_stream = 1 ,
1087
1087
)
1088
1088
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1089
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1089
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1090
1090
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1091
1091
# Update metadata version if changed
1092
1092
assert self ._extract_mv_version (pkg_info_lines ) == (2 , 1 )
@@ -1112,7 +1112,7 @@ def test_long_description_content_type(self, tmpdir_cwd, env):
1112
1112
env = environ ,
1113
1113
)
1114
1114
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1115
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1115
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1116
1116
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1117
1117
expected_line = 'Description-Content-Type: text/markdown'
1118
1118
assert expected_line in pkg_info_lines
@@ -1133,7 +1133,7 @@ def test_long_description(self, tmpdir_cwd, env):
1133
1133
data_stream = 1 ,
1134
1134
)
1135
1135
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1136
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1136
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1137
1137
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1138
1138
assert 'Metadata-Version: 2.1' in pkg_info_lines
1139
1139
assert '' == pkg_info_lines [- 1 ] # last line should be empty
@@ -1165,7 +1165,7 @@ def test_project_urls(self, tmpdir_cwd, env):
1165
1165
env = environ ,
1166
1166
)
1167
1167
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1168
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1168
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1169
1169
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1170
1170
expected_line = 'Project-URL: Link One, https://example.com/one/'
1171
1171
assert expected_line in pkg_info_lines
@@ -1182,7 +1182,7 @@ def test_license(self, tmpdir_cwd, env):
1182
1182
data_stream = 1 ,
1183
1183
)
1184
1184
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1185
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1185
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1186
1186
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1187
1187
assert 'License: MIT' in pkg_info_lines
1188
1188
@@ -1197,7 +1197,7 @@ def test_license_escape(self, tmpdir_cwd, env):
1197
1197
data_stream = 1 ,
1198
1198
)
1199
1199
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1200
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1200
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1201
1201
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1202
1202
1203
1203
assert 'License: This is a long license text ' in pkg_info_lines
@@ -1216,7 +1216,7 @@ def test_python_requires_egg_info(self, tmpdir_cwd, env):
1216
1216
env = environ ,
1217
1217
)
1218
1218
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1219
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1219
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1220
1220
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1221
1221
assert 'Requires-Python: >=2.7.12' in pkg_info_lines
1222
1222
assert self ._extract_mv_version (pkg_info_lines ) >= (1 , 2 )
@@ -1240,7 +1240,7 @@ def test_egg_info_includes_setup_py(self, tmpdir_cwd):
1240
1240
1241
1241
assert 'setup.py' in egg_info_instance .filelist .files
1242
1242
1243
- with open (egg_info_instance .egg_info + "/SOURCES.txt" ) as f :
1243
+ with open (egg_info_instance .egg_info + "/SOURCES.txt" , encoding = "utf-8" ) as f :
1244
1244
sources = f .read ().split ('\n ' )
1245
1245
assert 'setup.py' in sources
1246
1246
@@ -1277,7 +1277,7 @@ def test_egg_info_tag_only_once(self, tmpdir_cwd, env):
1277
1277
})
1278
1278
self ._run_egg_info_command (tmpdir_cwd , env )
1279
1279
egg_info_dir = os .path .join ('.' , 'foo.egg-info' )
1280
- with open (os .path .join (egg_info_dir , 'PKG-INFO' )) as pkginfo_file :
1280
+ with open (os .path .join (egg_info_dir , 'PKG-INFO' ), encoding = "utf-8" ) as pkginfo_file :
1281
1281
pkg_info_lines = pkginfo_file .read ().split ('\n ' )
1282
1282
assert 'Version: 0.0.0.dev0' in pkg_info_lines
1283
1283
0 commit comments