Python3 doesn't support unichr

Bug #1755976 reported by White on 2018-03-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Undecided
Unassigned

Bug Description

####
Python : sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)
lxml.etree : (3, 5, 0, 0)
libxml used : (2, 9, 4)
libxml compiled : (2, 9. 2)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)
####

Traceback(most recent call last):
....
....
....
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 33, in fromstring
    return _parse(data, beautifulsoup, makeelement, **bsargs)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 79, in _parse
    root = _convert_tree(tree, makeelement)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 148, in _convert_tree
    res_root = convert_node(html_root)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 212, in convert_node
    return handler(bs_node, parent)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 251, in convert_tag
    handler(child, res)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 251, in convert_tag
    handler(child, res)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 251, in convert_tag
    handler(child, res)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 251, in convert_tag
    handler(child, res)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 277, in convert_text
    append_text(parent, unescape(bs_node))
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 303, in unescape
    return handle_entities(unescape_entity, string)
  File "/usr/lib/python3/dist-packages/lxml/html/soupparser.py", line 300, in unescape_entity
    return unichr(name2codepoint[m.group(1)])
NameError: name 'unichr' is not defined

scoder (scoder) wrote :

Already fixed in later releases.

Changed in lxml:
status: New → Invalid
Vince (v1ncent) wrote :

I have confirmed this bug is in the latest release for 16.04:

$ sudo dpkg -l | grep lxml
ii python3-lxml 3.5.0-1build1 amd64 pythonic binding for the libxml2 and libxslt libraries

$ sudo apt-get install python3-lxml
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-lxml is already the newest version (3.5.0-1build1).

Changed in lxml:
status: Invalid → Confirmed
scoder (scoder) wrote :

Was fixed in lxml 3.6.0.

Changed in lxml:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers