inkscape loads extension even if the script specified in <command> doesn't exist

Bug #505920 reported by Aurèle Duda on 2010-01-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

if an .inx file contains a <command> element pointing to an inextisting script, the extension is loaded (with non report in extension-errors.log).

So, when you launch the extension, inkscape complains about the python args.

The script used in <command> element should exist in <dependencies>

su_v (suv-lp) wrote :

not reproduced with Inkscape 0.47 on OS X 10.5.8

$ grep command debug.inx
    <command reldir="extensions" interpreter="python"></command>
$ mv

(launch, menu entry is missing, quit)

$ cat ../extension-errors.log
Extension "Python module info" failed to load because a dependency was not met.
  type: executable
  location: extensions

Please provide information about your OS and Inkscape version.

tags: added: extensions-plugins
removed: extension file script
su_v (suv-lp) wrote :

> The script used in <command> element should exist in <dependencies>
sorry, I overlooked the last sentence - my debug extension had:

$ grep dependency debug.inx
  <dependency type="executable" location="extensions"></dependency>
  <dependency type="executable" location="extensions"></dependency>

reproduced if the script is not added as dependency.

Changed in inkscape:
status: New → Confirmed
Alvin Penner (apenner) wrote :

strictly speaking, I do not think this is a bug. This is the way dependency statements are designed to operate. They specify which modules are mandatory. It is the responsibility of the script developer to make sure that the dependency statement accurately reflects the needs of the extension, otherwise the dependency statement would be redundant.

Aurèle Duda (aureleduda) wrote :

So if you specify no dependency at all in an extension and provide a <command> element pointing to a nonexistent script, inkscape will load the extension without complaining at all...
I understand the dependency statement, but I do not think it's a good thing there is no check about <command>.
Inkscape should at least indicate the lack of script a little more understandable.

jazzynico (jazzynico) on 2010-08-26
Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → Low
su_v (suv-lp) on 2011-10-09
tags: removed: python
jazzynico (jazzynico) on 2012-10-21
Changed in inkscape:
status: Confirmed → Triaged
Rena Kunisaki (i-am-inuyasha) wrote :

Was about to suggest that the file specified in <command> should not also need to be specified in <dependency>, as it's redundant. Not sure if that's exactly what's being reported here.

jazzynico (jazzynico) wrote :

The attached patch checks to command element as if it were a dependency (in fact, dependency elements with type="executable" are very close to command elements).
If the command value is invalid, Inkscape doesn't load the extension and add a dependency type error in the extension-error.log file.

Changed in inkscape:
milestone: none → 0.91
status: Triaged → In Progress
jazzynico (jazzynico) wrote :

Tested on Windows XP, Inkscape trunk revision 13328.

jazzynico (jazzynico) wrote :

Also tested successfully on Crunchbang Waldorf.

Fixed in the trunk, revision 13421.

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp) wrote :

It appears that the change in r13421 introduces a crash on launch if there is a comment <!-- --> inside the <script> element. It does not matter whether the extension is actually loaded (check successful) or not (e.g. script not found), nor whether the extension is loaded from the shared or the user extensions directory.

Testing with archived builds (on OS X 10.7.5): no crash with rev13419, crash with rev13421

@JazzyNico - would you prefer if this is filed as separate report?

su_v (suv-lp) wrote :

Follow-up report filed as
- Bug #1372200 “Comment within <script> element in INX file triggers crash on launch (rev >= 13421)”

jazzynico (jazzynico) on 2015-02-14
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