Extension deprecation warnings

Bug #387446 reported by jazzynico
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Unassigned

Bug Description

Ubuntu 9.04, Python 2.6.2, Inkscape rev. 21592 and 0.46-5ubuntu4.

At least two Python extensions (perspective and envelope) return this warning (here with envelope):

-----
/usr/local/share/inkscape/extensions/summersnight.py:61: DeprecationWarning: os.popen3 is deprecated. Use the subprocess module.
  f,err = os.popen3('inkscape --query-%s --query-id=%s "%s"' % (query,id,file))[1:]
-----

This doesn't prevent the extension from working, but you must click Ok on the warning window first, which is annoying.

According to the Python doc (http://www.python.org/doc/2.6.2/library/os.html?highlight=popen#os.popen3), os.popen3 is obsolete since 2.6, and is replaced by the subprocess module, which was introduced in 2.4 (http://www.python.org/doc/2.6.2/library/subprocess.html#module-subprocess).

Should we:
1/ replace the deprecated code in the extensions (they will still work with Python 2.5)?
2/ prevent deprecation warnings from appearing?

jazzynico (jazzynico)
description: updated
Revision history for this message
Alvin Penner (apenner) wrote :

there is also an extension called restack.py that uses os.popen3.

However, since Inkscape is currently shipping with Python 2.5, maybe this bugfix could be postponed until after the release of 0.47

Revision history for this message
jazzynico (jazzynico) wrote :

Python 2.5 is embedded in the Win32 version only. Linux versions use the external Python package. And the stable one, on Ubuntu 9.04, is 2.6.2.
I think that we should at least remove the warnings from the future stable 0.47. From the user's point of view, it's completely unnecessary.

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

Mac OS X: a mix of bundled site-packages (lxml, numpy for 2.3, 2.4, 2.5, 2.6) within Inkscape.app (or currently offered as separate package to dev builds on modevia for python 2.3-2.5) and the system-wide installed Python Frameworks. On OS X 10.5.7 (default install with all updates):

  LeWitt:~ suv$ python --version
  Python 2.5.1

I don't have access to older osx versions (tiger, ppc).

Revision history for this message
Alvin Penner (apenner) wrote :

there is an example of the usage of the command subprocess.Popen in the file 'run_command.py'. This is apparently backwards compatible to Python 2.4.

Revision history for this message
Coz (cosimo321) wrote :

Hey guys,
  I am on ubuntu 9.04 and this is not just a warning,
The perspective extension does not produce any thing and just quits sometimes deleteing the origianl object set to path.
  It just doesnt work at all.. I get the warning pop up and that 's it.
I posted a bug report and was asked to mark it as a duplicate of this one ,,,however it is not apparently.
  https://bugs.launchpad.net/inkscape/+bug/388687
 so I may unmark it if that is possible.

coz

Revision history for this message
Alvin Penner (apenner) wrote :

I'll take a look at it this weekend, if no one gets there before me...

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

bug #388687 unmarked as duplicate, sorry for misleading coz! ~suv

Revision history for this message
jazzynico (jazzynico) wrote :

At least, we can consider it confirmed! :)

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Coz (cosimo321) wrote :

hey ~suv
no big deal these things don't get to me :)
  i am just concerned about this problem because I cant do some work that requires the perspective and I dont want to use the "repo" version in ubuntu :)
  I am addicted to svn :)

coz

Revision history for this message
Alvin Penner (apenner) wrote :

attached is a modified version of perspective.py which I believe will fix this.
Could someone test this on Linux using Python 2.6.2 ?

If it works, I'll commit it.

Revision history for this message
Alvin Penner (apenner) wrote :

committed to rev 387446.
the new version uses the subprocess module.
this will affect 3 extensions :

Modify Path -> Perspective
Modify Path -> Envelope
Arrange -> Restack

Could someone test this with Python 2.6.2 ?

Changed in inkscape:
status: Confirmed → Fix Committed
Revision history for this message
jazzynico (jazzynico) wrote :

Fix confirmed. Thanks Alvin!

Revision history for this message
Alvin Penner (apenner) wrote :

good to hear, thanks for your work on the href path resolution problems.

jazzynico (jazzynico)
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.