Cannot save to dxf, script error occured

Bug #957086 reported by Yann Papouin on 2012-03-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Alvin Penner

Bug Description

I've attached the svg file that need to be saved as dxf.

This is the output:

Traceback (most recent call last):
  File "dxf_outlines.py", line 299, in <module>
    e.affect()
  File "C:\inkscape\inkscape\share\extensions\inkex.py", line 230, in affect
    self.effect()
  File "dxf_outlines.py", line 290, in effect
    self.process_group(doc)
  File "dxf_outlines.py", line 259, in process_group
    self.process_group(node)
  File "dxf_outlines.py", line 259, in process_group
    self.process_group(node)
  File "dxf_outlines.py", line 261, in process_group
    self.process_clone(node)
  File "dxf_outlines.py", line 238, in process_clone
    if refnode.tag == inkex.addNS('g','svg'):
AttributeError: 'NoneType' object has no attribute 'tag'

From the attached file:
   inkscape:version="0.48+devel r11093"

Yann Papouin (yann-papouin) wrote :
su_v (suv-lp) on 2012-03-16
description: updated
tags: added: dxf exporting
su_v (suv-lp) on 2012-03-16
tags: added: clones
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48+devel r11093 on OS X Lion:

AFAICT the python script fails to handle orphaned clones: it crashes instead of ignoring them (simple test case attached).

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
su_v (suv-lp) wrote :

A "regular" clone exports ok for me.

su_v (suv-lp) wrote :
su_v (suv-lp) wrote :

Attaching "fixed" version of the original sample file which exports to DXF without python failure (all orphaned clones deleted, some of the inside otherwise empty groups).

Alvin Penner (apenner) wrote :

thanks for testing, attached is a slightly modified version of dxf_outlines.py. This will silently ignore the orphaned clones.

Yann Papouin (yann-papouin) wrote :

Thanks both of you for this quick fix, it saves my week :)

I also need to save only one layer, so I made a proposal based on your work:
https://bugs.launchpad.net/inkscape/+bug/959159

Alvin Penner (apenner) wrote :

good to hear, committed to bzr rev 11100

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp) on 2012-03-20
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
milestone: none → 0.49
tags: added: backport-proposed
su_v (suv-lp) wrote :

Backported to branch 0.48.x in revision 9935.

tags: removed: backport-proposed
Changed in inkscape:
milestone: 0.49 → 0.48.4
Ted Gould (ted) on 2012-12-17
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers