remove redundant open() arg: encoding='utf8'

By default, open() returns a str:
https://docs.python.org/3/library/functions.html#open

By default, str is UTF-8:
https://docs.python.org/3/library/stdtypes.html#str

This used to matter on Python 2.x, but this code is 3.x only now.
This commit is contained in:
Hans-Christoph Steiner 2018-10-19 15:01:34 +02:00
parent 6e5d1a6cc3
commit 57556aceee
9 changed files with 27 additions and 27 deletions

View file

@ -706,7 +706,7 @@ def parse_srclib(metadatapath):
if not os.path.exists(metadatapath):
return thisinfo
metafile = open(metadatapath, "r", encoding='utf-8')
metafile = open(metadatapath, "r")
n = 0
for line in metafile:
@ -1014,7 +1014,7 @@ def parse_metadata(metadatapath, check_vcs=False, refresh=True):
else:
app.id = name
with open(metadatapath, 'r', encoding='utf-8') as mf:
with open(metadatapath, 'r') as mf:
if ext == 'txt':
parse_txt_metadata(mf, app)
elif ext == 'json':
@ -1565,7 +1565,7 @@ def write_metadata(metadatapath, app):
.format(path=metadatapath, formats=', '.join(accepted)))
try:
with open(metadatapath, 'w', encoding='utf8') as mf:
with open(metadatapath, 'w') as mf:
if ext == 'txt':
return write_txt(mf, app)
elif ext == 'yml':