Problem rendering research report to PDF



A user reported to us having problems when exporting the research report to PDF. We are getting this stacktrace:

2019-04-17 11:08:16,210 INFO     [        ][MainThread] Starting dossier export to format "zip"
2019-04-17 11:08:16,247 ERROR    [patzilla.navigator.export               ][MainThread] Rendering dossier to PDF failed. Exception: 'ascii' codec can't encode character u'\u2605' in position 14: ordinal not in range(128)
Traceback (most recent call last):
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/patzilla/navigator/", line 224, in to_zip
    zipfile.writestr('report/@dossier.pdf', DossierXlsx(
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/patzilla/navigator/", line 690, in to_pdf
    payload = self.create()
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/patzilla/navigator/", line 499, in create
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/patzilla/navigator/", line 590, in write_numberlist_sheets
    df.to_excel(self.writer, sheet_name=sheet_name, index=False)
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/pandas/core/", line 1425, in to_excel
    startrow=startrow, startcol=startcol)
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/pandas/io/", line 1487, in write_cells
    val, style)
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/xlsxwriter/", line 64, in cell_wrapper
    return method(self, *args, **kwargs)
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/xlsxwriter/", line 400, in write
    return self.write_url(row, col, *args)
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/patzilla/navigator/", line 771, in <lambda>
    worksheet.write_url = lambda *args, **kwargs: write_url_deduce_title(worksheet, *args, **kwargs)
  File "/opt/patzilla/sites/patzilla-prod/.venv2/local/lib/python2.7/site-packages/patzilla/navigator/", line 765, in write_url_deduce_title
    tip = 'Open "{name}" in Patent Navigator'.format(name=string)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2605' in position 14: ordinal not in range(128)



Apparently, while the Unicode black star symbol ★ called U+2605 BLACK STAR is usually used for display purposes only, it made it into the database somehow and PatZilla croaks when encountering it again while running the report generator. Bummer!




We have finally been able to mitigate this issue [1] and make it part of the most recent release [2].

[1] Fix export with non-ascii characters accidentally slipped into patent… · ip-tools/ip-navigator@5c6aa96 · GitHub
[2] ip-navigator/CHANGES.rst at 0.165.0 · ip-tools/ip-navigator · GitHub