Pypy and Lxml 3.0: still referenced nodes are garbage collected

Bug #1065924 reported by Alain Poirier on 2012-10-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Medium
scoder

Bug Description

This code shows how nodes are disappearing with Lxml 3.0 under Pypy:

-----------

import gc
from lxml import etree

root = etree.Element('foo')
etree.SubElement(root, 'bar')

# OK
print root.getchildren() # [<Element bar at 0x10106a320>]

# KO
gc.collect()
print root.getchildren() # [None]

-----------

Tested on MacOS:

  Python : (major=2, minor=7, micro=2, releaselevel='final', serial=42)
  lxml.etree : (3, 0, 0, 0)
  libxml used : (2, 7, 8)
  libxml compiled : (2, 7, 8)
  libxslt used : (1, 1, 26)
  libxslt compiled : (1, 1, 26)

and Linux:

  Python : (major=2, minor=7, micro=2, releaselevel='final', serial=42)
  lxml.etree : (3, 0, 0, 0)
  libxml used : (2, 8, 0)
  libxml compiled : (2, 8, 0)
  libxslt used : (1, 1, 27)
  libxslt compiled : (1, 1, 27)

Thanks for the excellent test case. I'll see if I can fix it.

scoder (scoder) wrote :
Changed in lxml:
assignee: nobody → Stefan Behnel (scoder)
importance: Undecided → Medium
status: New → Fix Released
scoder (scoder) on 2013-04-28
Changed in lxml:
milestone: none → 3.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers