crash when doing Python-driven export to a read-only file

Bug #309856 reported by Alvin Penner
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
theAdib

Bug Description

to reproduce :
- save a file using Python export extension (file type .dxf, .hpgl, .gpl)
- after saving, mark the file as read-only
- save the file again, choose the option to "Replace" the file
- Inkscape crashes with the message (Win32):

C:\Python25\APP>inkcl.py
return code: 3
terminate called after throwing an instance of 'Glib::FileError'
Emergency save activated!

- Note that this crash does not occur if a "native" export such as .svg or .ps is performed. In this case the read-only file will not be updated, but there is no crash.

The origin of this report is that AutoCAD apparently locks the .dxf file that it reads, which can lead to an Inkscape crash if both are running, see https://bugs.launchpad.net/inkscape/+bug/192923/comments/67

Revision history for this message
jazzynico (jazzynico) wrote :

Not reproduced on Ubuntu 9.04, Inkscape rev. 21851.
Inkscape doesn't crash, but doesn't return any warning box (see Bug #353847).
Tested with DXF and HPGL file formats.

tags: added: saving
Revision history for this message
su_v (suv-lp) wrote :

Crash not reproduced with Inkscape 0.47pre1 r21720 on OS X 10.5.7.
Tested with DXF, Inkscape doesn't return any warning box after confirming to 'Replace' the file, but logs this message:

** (inkscape-bin:4894): WARNING **: There was an error saving the file.

Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Vista, Inkscape rev. 21852.
Same message 'Glib::FileError'

Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
tags: added: crash win32
Revision history for this message
theAdib (theadib) wrote :

commited fix in svn revision 21953.
pls Test. Adib.

Changed in inkscape:
assignee: nobody → theAdib (theadib)
status: Confirmed → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

Inkscape 0.46+devel r21953, built Jul 29 2009, OS X 10.5.7

Fix confirmed: no crash, Inkscape prompts with a warning dialog box: 'File /Users/suv/tmp/exports/spiral-309856-test.hpgl could not be saved'

*nitpicking* the file name of the currently open drawing (used for export/save as...) is changed to ' /Users/suv/tmp/exports/spiral-309856-test.hpgl', the name of the failed export file. That is confusing (for the user) and wrong, IMHO. I have seen bug reports about this before I think, but can't find them right now.

Revision history for this message
theAdib (theadib) wrote :

I commited svn revision 21960 that reverts the document filename in case save_as fails.
Hence I think this issue can be closed if you all test and confirm.

Adib.

Revision history for this message
su_v (suv-lp) wrote :

Inkscape 0.46+devel r21973 on OS X 10.5.7

Fix confirmed with previous test case (comment 5): Inkscape keeps the original document name if 'save as' fails.

Thanks, Adib!

theAdib (theadib)
Changed in inkscape:
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.