some-programs / exitwp

Exitwp is tool primarily aimed for making migration from one or more wordpress blogs to the jekyll blog engine as easy as possible.
686 stars 145 forks source link

Parsing and encoding error #64

Open dsteinkopf opened 8 years ago

dsteinkopf commented 8 years ago

I get an encoding error (see below) "suddenly" after everything has been running fine for some weeks every day. Maybe it has got something todo with #58, but I don't think so.

My input XML is UTF-8 (also stated in the xml header line).

I was not able to find out which input (line) causes the problem. It seems there is some problem in the input that causes the parser to fail. And then even the print of the problematic line (variable body) fails.

Any hint on how to continue debugging? (I am not a python nerd...)

Traceback (most recent call last):
  File "/home/stk/exitwp/exitwp.py", line 373, in <module>
    data = parse_wp_xml(wpe)
  File "/home/stk/exitwp/exitwp.py", line 176, in parse_wp_xml
    'items': parse_items(),
  File "/home/stk/exitwp/exitwp.py", line 148, in parse_items
    print 'could not parse html: ' + body
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 138: ordinal not in range(128)