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

@ -1722,7 +1722,7 @@ def make_categories_txt(repodir, categories):
catdata = ''
for cat in sorted(categories):
catdata += cat + '\n'
with open(os.path.join(repodir, 'categories.txt'), 'w', encoding='utf8') as f:
with open(os.path.join(repodir, 'categories.txt'), 'w') as f:
f.write(catdata)
@ -2065,7 +2065,7 @@ def main():
# Generate latest apps data for widget
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
data = ''
with open(os.path.join('stats', 'latestapps.txt'), 'r', encoding='utf8') as f:
with open(os.path.join('stats', 'latestapps.txt'), 'r') as f:
for line in f:
appid = line.rstrip()
data += appid + "\t"
@ -2074,7 +2074,7 @@ def main():
if app.icon is not None:
data += app.icon + "\t"
data += app.License + "\n"
with open(os.path.join(repodirs[0], 'latestapps.dat'), 'w', encoding='utf8') as f:
with open(os.path.join(repodirs[0], 'latestapps.dat'), 'w') as f:
f.write(data)
if cachechanged: