etree.xmlfile shadows exceptions thrown by output

Bug #1415643 reported by dhjt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Released
Undecided
scoder

Bug Description

It looks like lxml eats any exceptions in the output that etree.xmlfile
writes into, leaving the output in a broken state. This goes unnoticed.
Only if you try to write to that same output again, things explode.

Please refer to attached testcase and the mailing list:

https://mailman-mail5.webfaction.com/pipermail/lxml/2014-December/007359.html

System info:

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

Revision history for this message
dhjt (d-h-j-takken) wrote :
Revision history for this message
scoder (scoder) wrote :

Rejecting as it's essentially fixed in Py3.

Changed in lxml:
status: New → Won't Fix
Revision history for this message
scoder (scoder) wrote :

Actually, let me take that back. The bug here is xmlfile tries to write the closing end tags in the context manager. It should not do that.
https://github.com/lxml/lxml/commit/7cb20fc92944a3db3cfd63e763536af94be15aa7

Changed in lxml:
assignee: nobody → scoder (scoder)
status: Won't Fix → Fix Committed
milestone: none → 3.9.0
scoder (scoder)
Changed in lxml:
status: Fix Committed → Fix Released
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.