From: Daniel Martí Date: Thu, 25 Feb 2016 00:12:23 +0000 (+0000) Subject: metadata: always open metadata files in UTF-8 X-Git-Tag: 0.7.0~86^2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a023a235a2b1249088547c5a2db502ecdeac1e55;p=fdroidserver.git 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. --- diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 0112a0ec..d69e9074 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -705,7 +705,7 @@ def parse_srclib(metadatapath): if not os.path.exists(metadatapath): return thisinfo - metafile = open(metadatapath, "r") + metafile = open(metadatapath, "r", encoding='utf-8') n = 0 for line in metafile: @@ -920,7 +920,7 @@ def parse_metadata(metadatapath): app.metadatapath = 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': parse_txt_metadata(mf, app) elif ext == 'json':