mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
metadata: always open metadata files in UTF-8
For some reason, Python uses whatever encoding the system is using via a locale. Since CI uses an ascii locale, stuff breaks. I can't find a way to make all of fdroidserver ignore the locale and just use UTF-8, so for now force it where it's bothering CI.
This commit is contained in:
parent
23a950bd00
commit
a023a235a2
1 changed files with 2 additions and 2 deletions
|
|
@ -705,7 +705,7 @@ def parse_srclib(metadatapath):
|
||||||
if not os.path.exists(metadatapath):
|
if not os.path.exists(metadatapath):
|
||||||
return thisinfo
|
return thisinfo
|
||||||
|
|
||||||
metafile = open(metadatapath, "r")
|
metafile = open(metadatapath, "r", encoding='utf-8')
|
||||||
|
|
||||||
n = 0
|
n = 0
|
||||||
for line in metafile:
|
for line in metafile:
|
||||||
|
|
@ -920,7 +920,7 @@ def parse_metadata(metadatapath):
|
||||||
app.metadatapath = metadatapath
|
app.metadatapath = metadatapath
|
||||||
app.id, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
|
app.id, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
|
||||||
|
|
||||||
with open(metadatapath, 'r') as mf:
|
with open(metadatapath, 'r', encoding='utf-8') as mf:
|
||||||
if ext == 'txt':
|
if ext == 'txt':
|
||||||
parse_txt_metadata(mf, app)
|
parse_txt_metadata(mf, app)
|
||||||
elif ext == 'json':
|
elif ext == 'json':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue