
Tim Arnold, 21.02.2012 19:00:
This is a bug reported last August for Mac, but it is also happening for freebsd8.2 (amd64). https://bugs.launchpad.net/lxml/+bug/707396
Python 2.7.1 (r271:86832, Apr 5 2011, 13:19:14) [GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
from lxml import etree parser = etree.HTMLParser(encoding='cp1252')
Traceback (most recent call last): File "lxml_bug.py", line 11, in <module> parser = etree.HTMLParser(encoding='cp1252') File "parser.pxi", line 1423, in lxml.etree.HTMLParser.__init__ (src/lxml/lxml.etree.c:81303) File "parser.pxi", line 743, in lxml.etree._BaseParser.__init__ (src/lxml/lxml.etree.c:76172) LookupError: unknown encoding: 'cp1252'
I'm neither a Mac nor BSD user, so I can't comment on it. Could you figure out what version of libiconv you are using and if your copy of libxml2 depends on it? Please comment in the bug tracker if you find anything useful. Stefan