fontconfig: Branch 'master'

[email protected] (Akira TAGOH)
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <[email protected]>
 fc-blanks/fc-blanks.py |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 92da67a9fcf9fa48ebb40f2032d47291d5427d41
Author: Akira TAGOH <[email protected]>
Date:   Fri Aug 25 11:46:53 2017 +0900

    fc-blanks: fall back to the static data available in repo if downloaded data is corrupted
    
    https://bugs.freedesktop.org/show_bug.cgi?id=102399

diff --git a/fc-blanks/fc-blanks.py b/fc-blanks/fc-blanks.py
index cc23cde..410178a 100755
--- a/fc-blanks/fc-blanks.py
+++ b/fc-blanks/fc-blanks.py
@@ -19,10 +19,14 @@ try:
     fp = urlopen('http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3AGC%3DZs%3A][%3ADI%3A]&abb=on&ucd=on&esc=on&g')
     data = fp.read()
     fp.close()
+    # check before writing if data isn't corrupted.
+    dom = html.fromstring(data)
+    x = dom.xpath('/html/body/form/p/text()')
+    p = x[1]
     fp = open(datafile, 'wb');
     fp.write(data);
     fp.close();
-except URLError:
+except (URLError, IndexError):
     # fall back reading the static data in repo
     try:
         fp = open(datafile)
_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.