Pypy and Lxml 3.0: still referenced nodes are garbage collected

Bug #1065924 reported by Alain Poirier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Released
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)

Revision history for this message
scoder (scoder) wrote : Re: [Bug 1065924] [NEW] Pypy and Lxml 3.0: still referenced nodes are garbage collected

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.