Commits

st4lk  committed 170fd0e

check article link can be decoded

  • Participants
  • Parent commits c4d58a4

Comments (0)

Files changed (1)

File articles/models.py

                         title_m = TITLE_RE.search(html)
                         if title_m:
                             title = title_m.group(1)
+                            # check, that title can be decoded
+                            try:
+                                title.decode('ascii')
+                            except UnicodeDecodeError:
+                                title = link.group(2)
                             log.debug('Found title: %s' % (title,))
                     except:
                         # if anything goes wrong (ie IOError), use the link's text