unknown encoding: ASCII problem
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Python : sys.version_
lxml.etree : (2, 3, 2, 0)
libxml used : (2, 7, 8)
libxml compiled : (2, 7, 8)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 26)
I' m trying to install and run virtaal (a translation app.) and it uses lxml on an Archlinux box. I have latest python-xml installed, on a KDE desktop with tr_TR.UTF-8 encoding (turkish). When i try to run setup.py to install virtaal; it throws this:
running build_scripts
running install
sh: /root/.
Traceback (most recent call last):
File "./setup.py", line 603, in <module>
main(options)
File "./setup.py", line 600, in main
**options)
File "/usr/lib/
dist.
File "/usr/lib/
self.
File "/usr/lib/
cmd_obj.run()
File "./setup.py", line 573, in run
failed = depcheck.
File
"/home/
line 98, in check_dependencies
elif not test_import(name):
File
"/home/
line 86, in test_import
__import_
File "lxml.etree.pyx", line 239, in init lxml.etree
(src/lxml/
File "lxml.etree.pyx", line 201, in lxml.etree.
(src/lxml/
LookupError: unknown encoding: ASCII
I have workaround this issue by exporting env LC_ALL=C . While it is installed correctly virtaal won't run and throw same error:
$ /usr/bin/virtaal
Traceback (most recent call last):
File "/usr/bin/virtaal", line 56, in <module>
failed = depcheck.
File "/usr/lib/
elif not test_import(name):
File "/usr/lib/
__import_
File "lxml.etree.pyx", line 239, in init lxml.etree (src/lxml/
File "lxml.etree.pyx", line 201, in lxml.etree.
LookupError: unknown encoding: ASCII
I have searched this and see only Turkish users have faced this problem. Also my searchs indicate that this error may be a lxml error rather than virtaal bug. I have reported this issue to virtaal developres as well : http://
Changed in lxml: | |
milestone: | none → 2.3.x |
Do you mean "python-xml" or "python-lxml"? The first is likely to be a dead package containing "PyXML". You don't need that.
Regarding the "ASCII" encoding - it seems that the best name for CPython to see is "ascii", in lower case. libxml2 prefers the upper case names, that's why Ixml had used those internally. Normally, CPython also gets along with the upper case names nicely, so I wonder what the problem is on your side. Maybe some Archlinux specifc issue?
I pushed a fix here:
https:/ /github. com/lxml/ lxml/commit/ 90b0b10743b89ec 4e0533a9ebca427 15f0054366
If you want to try it, you need Cython 0.15 to build from sources.