8 of 9 submenu items of the "Help" menu fail when selected.

Bug #315996 reported by John Adams
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Inksape 0.46 on Win XP Home SP3

8 of 9 submenu items of the "Help" menu fail when selected.

What looks like a command window briefly flashes on screen and then disappears with no message or results after clicking:

Help>Inkscape Manual
Help>Keys and Mouse Reference
Help>Ask Us a Question
Help>Command Line Options
Help>FAQ
Help>New in This Version
Help>Report a Bug
Help>SVG 1.1 Specification

The Help>Tutorials all work fine, and Help>About Memory and Help>About Inkscape also work.

The window that briefly flashes looks similar to the python startup of Effects>Text>Loren Ipsum which works fine.

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

It might be worthwhile to try to run this from a DOS command prompt, to see where the problem lies.
- open up DOS with the command cmd
- change to the directory C:\Program Files\Inkscape\share\extensions\
- execute the command : python webbrowser_faq.py
- this should bring up a webbrowser which should attempt to connect to the URL : http://wiki.inkscape.org/wiki/index.php/FAQ

The URLs for the various items you are trying can be found in 8 files that begin with webbrowser_... and end with .py.

If the above procedure works, then it might be worthwhile to try to trap the Inkscape exit messages in DOS using the methods outlined at http://kaioa.com/node/42 or http://kaioa.com/node/63

Revision history for this message
John Adams (geartooth) wrote :

The first suggestion fails when executing the command:

C:\Program Files\Inkscape\share\extensions>python webbrowser_faq.py

The command responds:

'python' is not recognized as an internal or external command,
operable program or batch file.

and no web page opens.

But executing the command:

C:\Program Files\Inkscape\share\extensions>webbrowser_faq.py

successfully opens the FAQ wiki web page in firefox.
The rest of the 8 files that begin with webbrowser_... and end with .py also work correctly when executed without 'python' in the command.

I have not tried exit message trapping yet.

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

- do you have Python installed separately, independently of Inkscape ?
- it might be worthwhile to put the python directory into the PATH, so the PATH contains something like C:\Program Files\Inkscape\Python, so you can execute the command python directly from a DOS prompt.

Revision history for this message
John Adams (geartooth) wrote :

Yes, python is installed separately and independently.

Putting either the independent python directory or the inkscape\Python into the PATH does not work.

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

in that case about the only suggestion I have is to trap the exit messages using inkscapec.exe as mentioned above.

however, I should mention that these menu items have been rewritten since the release of 0.46 so they are now all generated by a single python file, and this problem may not exist in the development version.

Revision history for this message
John Adams (geartooth) wrote :

inkscapec.exe does not capture any exit messages.

From a command prompt, running:

C:\Program Files\Inkscape\inkscapec.exe

will start up inkscape normally, but 8 of 9 still fail as in my first post without any message appearing in the command prompt.

Closing the inkscape application also leaves no message in the command prompt, just a new ready prompt C:\Program Files\Inkscape> waiting for the next command.

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

- hmm, very strange, in view of the fact that Lorem Ipsum works.

- just for curiosity, which version of Python had you previously installed, (Inkscape is using version 2.5) ?

- what makes these Help items unique is that they use the import modules webbrowser and threading, which typically would not be used by the other Python extensions.

Revision history for this message
John Adams (geartooth) wrote :

Version of python is:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32

Revision history for this message
John Adams (geartooth) wrote :

additionally:
I just tried the precompiled dev build Inkscape20697-0902142327.7z Feb. 14 '09

the same 8 of 9 help menu items fail in exactly the same way in this build.

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

very strange; in that case the only thing I can think of is the browser, would it be possible to try this with IE as the default browser?

Revision history for this message
John Adams (geartooth) wrote :

the same 8 of 9 failures seen with default set to firefox 3.0.6
are still failing in default set to IE 7.0.5730.11
and still failing ib default set to safari 3.2.1 (525.27.1)

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

in that case, it would be worthwhile to go back to the path setup:
either the path C:\Program Files\Inkscape\python\
or the path C:\Python25\
should be declared in the path command.
In either case, it should be possible to go into any directory anywhere, and type in the word "python" and have it execute normally.
It should also be possible to go into the directory C:\Program Files\Inkscape\share\extensions\ and type in the command :
python webbrowser_faq.py (or whatever the name of the appropriate .py file is)
and have it execute as well. I normally define the path in the \autoexec.bat file, but there are other ways of doing this, depending on your preference.

Revision history for this message
Lawrence (annon0m0s) wrote :

I can confirm that this is happening on Windows Vista Inkscape 0.46 and Inkscape 0.47pre0, built Jul 2 2009. I don't know how long this has been a problem but only noticed it when trying to get the help in 0.47pre0. In both cases a command window opens quickly, perhaps a message is written to the window then the window is closed quickly so no error message is left on the screen. To try to get an error message .46 I opened a command window c:\program files\inkscape\share\extentions and ran "python webbrowser_faq.py" but that worked fine because it opened up a new tab in Firefox 3.5. For 0.47pre0 I changed to the separate directory where that is installed and found that webbrowser_faq.py does not exist but that launch_webbrowser.py does so ran "python launch_webbrowser.py www.python.org" which worked. I have python 2.5 installed separately.

Inkscape 0.47 final should not be released without working help menus.

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

does the DOS command
launch_webbrowser.py www.python.org
run, if you omit the word 'python' ?

Revision history for this message
Lawrence (annon0m0s) wrote :

Running "launch_webbrowser.py www.python.org" without the word python does work.
I also tried on 0.46 the InkCL.py InkCL.bat to try and capture any output error messages but nothing showed up. That could have happened because the Help related items are opened in another window.
The python Extensions do work. ex running 0.47pre0 create square, object to path, Extension-> Add Nodes, Extension-> Jitter. The Add Nodes and Jitter both work fine.

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

yes, what makes these help menu items unique is the fact that they use the python modules 'webbrowser' and 'threading', which I have never seen used elsewhere, so I have no experience with them. Unfortunately, I cannot reproduce this problem on my system, Windows XP. I have python 2.6 installed separately, but the version number is not relevant, I had no problems with python 2.5 either.

su_v (suv-lp)
tags: added: extensions-plugins
Revision history for this message
Lawrence (annon0m0s) wrote :

hi,
This bug still exists in Inkscape 0.47pre4 , built Oct 12 2009 on Windows Vista. This needs to be fixed because users need to be able to get a response when they select the Help-> Inkscape Manual. Of course it is somewhat ironic that the Help-> Report a Bug does not work. A dos window does open to start a python command but it closes quickly and there is no browser window with help.

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

@Lawrence - what is your default browser (system wide default - don't know the win32 specific term)?

Revision history for this message
Lawrence (annon0m0s) wrote :

My default browser is Firefox 3.5.3. The official help window says "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3" but I am using Windows Vista. Window's Internet Explorer is also installed but is not the default browser.

Revision history for this message
Lawrence (annon0m0s) wrote :

This bug is still happening in 0.47 release "Inkscape 0.47 r22583, built Nov 21 2009". The help menu really needs to work because otherwise new users will stop using inkscape.

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

would you be willing to perform a temporary experiment to try to locate the source of the problem? I am attaching a modified version of the file launch_webbrowser.py which gives detailed information on which lines have been successfully executed. If you would like to try it, then make a backup copy of your file so you can revert back to it. And then try to use one of the help menu options.
    I am hoping this will tell us where the crash occurred.

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

when I use this file I get two separate message windows as shown in the attached figure, and then the appropriate web site loads.

Revision history for this message
Lawrence (annon0m0s) wrote :

Renaming the original launch_webbrowser.py and putting the temporary one in place then running Inkscape help->Inkscape manual causes the attached message window to show up. No web site is show in the my browser Firefox version 3.5.5. This is on a Windows Vista

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

    thanks, that helps a lot. It looks as if the python code ran essentially to completion before the crash occurred. The problem is either related to threading or the webbrowser import, both of which are unique to this extension.
    would you be willing to try one more experiment, this one is not destructive:

- open a DOS window, perhaps using Start->Run and typing in the command 'cmd'
- type the command : python
- type the command : import webbrowser
- type the command : webbrowser.open("http://inkscape.org/doc/keys046.html")
- type the command : exit()

on my machine this leads to a new browser window opening with Inkscape help.
attached is a trace of what my DOS window looked like after doing this.

......................................................

C:\>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.open("http://inkscape.org/doc/keys046.html")
True
>>> exit()

Revision history for this message
Lawrence (annon0m0s) wrote :

hi, I renamed the original launch_webbrowser.py back to the original name. Here is the result of directly following your request which shows that I have python 2.6 installed. The webbrowser opens with the correct page.
C:\Users\X>python
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.open("http://inkscape.org/doc/keys046.html")
True
>>> exit()
C:\Users\X>
When I changed to the Inkscape directory and rerun the commands this is the output. Notice that the python version is ever so slightly different than your version. Mine is 2.5 Sept 2006 but yours is 2.5.2 Apr 2007. The browser does open up with the correct page.
c:\Program Files\Inkscape047\Inkscape\python>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.open("http://inkscape.org/doc/keys046.html")
True
>>>
The Inkscape menu help->keys & mouse reference does not open a browser window.

Revision history for this message
Lawrence (annon0m0s) wrote :

This might help some to figuring out the cause of the problem. I made a copy of launch_webbrowser.py in another directory and made a few changes (1) change the url to a constant. (2) added another call to webbrowser to see if things are working (3) added print statements to say "got here". The quirky thing about this is that it works. The last line, webbrowser.open, seems to allow both pages to be shown. If the last line is commented out then both pages are not shown. So there seems to be something weird about running webbrowser from within a thread. I changed the threaded webbrowser call back to using the default and again it works only when the call to at the end to webbrowser is not commented out.
#!/usr/bin/env python
import webbrowser, threading
from optparse import OptionParser
print 'starting'
class VisitWebSiteWithoutLockingInkscape(threading.Thread):
    def __init__(self):
        threading.Thread.__init__ (self)
        print 'inside init'
        parser = OptionParser()
        parser.add_option("-u", "--url", action="store", type="string",
                          default="http://www.inkscape.org/",
                          dest="url", help="The URL to open in web browser")
        (self.options, args) = parser.parse_args()
        print 'end of init'

    def run(self):
        print 'start of run url=' + str(self.options.url)
        webbrowser.open(self.options.url)
        #webbrowser.open("http://inkscape.org/doc/keys046.html")
        print 'end of run'

print 'after class def'
vwswli = VisitWebSiteWithoutLockingInkscape()
vwswli.start()
print 'after thread started'
webbrowser.open("http://inkscape.org/doc/keys046.html")

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

I am somewhat concerned about the Python version 2.5. I have installed Inkscape 0.47 r22583 (Nov 21 2009) both from a .7z file and also from an .exe file and in both cases I get Python version 2.5.1, not 2.5.
     I am attaching a new version of the launch_webbrowser file. Could you run this from inside Inkscape using the Inkscape menu? It will explicitly report the Python version as well as give one extra line of output after running the webbrowser command. My sample output is attached below, obtained when I run this from inside Inkscape. If your Inkscape reports version 2.5 here, I would suggest re-installing Inkscape.

.........................................
2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
after thread
{'url': 'http://inkscape.org/report_bugs.php'}
before run
after run

Revision history for this message
Lawrence (annon0m0s) wrote :

Instead of doing a screen print a copy / paste of the message output is easier and more readable. This time there is a traceback!
Python is definitely version 2.5. I tried going to the Inkscape\python directory and directly running python
2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]

after thread
{'url': 'http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.php'}
before run
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "C:\Program Files\Inkscape047\Inkscape\python\Lib\threading.py", line 460, in __bootstrap
  File "C:\Program Files\Inkscape047\Inkscape\share\extensions\launch_webbrowser.py", line 20, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'open'

Running inkscape\python.exe directly
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> import sys
>>> print platform.python_version()
2.5.0
>>> print sys.version[:3]
2.5
>>> print "sys.exec_prefix: "+str(sys.exec_prefix)
sys.exec_prefix: C:\Program Files\Inkscape047\Inkscape\python
>>> print "sys.prefix: "+str(sys.prefix)
sys.prefix: C:\Program Files\Inkscape047\Inkscape\python
>>>
I will uninstall inkscape and reinstall it. I had downloaded the win32 exe from sourceforge so I expect it to be correct. Thanks for your help. I'll post what happens after the reinstall.

Revision history for this message
Lawrence (annon0m0s) wrote :

Uninstalled inkscape, rebooted, reinstalled from Inkscape-0.47-3.exe downloaded from sourceforge Nov 26, put in the most recent launch_webbrowser.py. Ran inkscape help->inkscape manual. The first time that I did this no browser opened and the messages stopped just after the "before run". The second time it was run, again no browser window but the output included a traceback. The python release is still 2.5 not 2.51.
2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
after thread
{'url': 'http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.php'}
before run
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "C:\Program Files\Inkscape\python\Lib\threading.py", line 460, in __bootstrap
  File "C:\Program Files\Inkscape\share\extensions\launch_webbrowser.py", line 20, in run
  File "C:\Program Files\Inkscape\python\Lib\webbrowser.py", line 59, in open
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

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

Inkscape does not contain python 2.5, it contains python 2.5.1. For example on my machine this is what I get when I interrogate the Inkscape directory.

D:\Program Files\Inkscape\python>dir python.*
 Volume in drive D is MAIN
 Volume Serial Number is 1706-18D7

 Directory of D:\Program Files\Inkscape\python

05/08/2008 09:50 AM 24,064 python.exe

and in the Inkscape directory itself I have a python.dll file as follows

 Directory of D:\Program Files\Inkscape

05/08/2008 09:50 AM 2,113,536 python25.dll

could you confirm that your python.exe is identical to this? This is from Inkscape 0.47 r22583 (Nov 21 2009)
If your Python.exe file is different from this, could you attach it?

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

it is possible that you may be running a different version of python than the one that came with Inkscape. In my case Inkscape is in the directory D:\Program Files\Inkscape\. When I run the Help menu extension, then I get the DOS window popup that says (very briefly) 'D:\Program Files\Inkscape\python\python.exe'

Could you confirm that the directory it shows in this popup is identical to the directory that Inkscape is installed in?

Revision history for this message
Lawrence (annon0m0s) wrote :

hi. The version of Inkscape from the about screen is "Inkscape 0.47 r22583, built Nov 21 2009".
C:\Program Files\Inkscape\python>dir python*
 Volume in drive C is S3A6022D501
 Volume Serial Number is 3015-4496

 Directory of C:\Program Files\Inkscape\python

08/05/2008 07:50 AM 24,064 python.exe
08/05/2008 07:50 AM 24,576 pythonw.exe
C:\Program Files\Inkscape>dir python*
 Volume in drive C is S3A6022D501
 Volume Serial Number is 3015-4496

 Directory of C:\Program Files\Inkscape

27/11/2009 05:48 PM <DIR> python
08/05/2008 07:50 AM 2,113,536 python25.dll

When I can read the directory on dos window, it is referring to the inkscape python. The uninstalled 047 was in a slightly different named directory than the current 047 and both dos windows were correctly referring to their own python. Even though the python.exe is the same size I have attached a zipped copy of it.

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

- yes, that is definitely the same python.exe as I have. I did a file compare, fc, command on it.
- so if you go to the directory C:\Program Files\Inkscape\python and run python, what do you get?
I get

D:\Program Files\Inkscape\python>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32

Revision history for this message
Lawrence (annon0m0s) wrote :

As mentioned earlier but redone just in case:
C:\Program Files\Inkscape\python>python.exe
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print 'sys.version_info =', sys.version_info
sys.version_info = (2, 5, 0, 'final', 0)
>>> print 'sys.version =', repr(sys.version)
sys.version = '2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]'

Revision history for this message
Lawrence (annon0m0s) wrote :

Also I tried opening a dos window 'set PYTHONPATH="dummy" ' and starting inkscape.exe from the command line. Still the same problem.

Revision history for this message
Lawrence (annon0m0s) wrote :

I just downloaded Inkscape-0.47-3-win32.7z from sourceforge, uncompressed it, copied in a slightly modified launch_webbrowser.py, it has a couple more print statements. Same problems - no browser window and it is running python 2.5. The output is:
2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
after thread
2.5
sys.exec_prefix: C:\ltattrie\z_storage\software\inkscape\beta\047_3_win32_7z\python
{'url': 'http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.php'}
before run
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "C:\ltattrie\z_storage\software\inkscape\beta\047_3_win32_7z\python\Lib\threading.py", line 460, in __bootstrap
  File "C:\ltattrie\z_storage\software\inkscape\beta\047_3_win32_7z\share\extensions\launch_webbrowser.py", line 24, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'open'

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

well, I'm not sure what to suggest. The first thing is to go to Control Panel, Add/Remove programs to confirm that Python 2.5 does not exist and confirm that whatever you have is newer then 2.5.
Also you can go to the directory \Python25\include\ and open the file patchlevel.h to confirm that what you have is newer than 2.5. Also I would do a global search for python.exe using a command like dir/s \python.exe and if there are multiple versions of this file then rename every single one of them to be something else and then confirm that python no longer runs from inkscape, and then re-enable the python.exe in the directory C:\Program Files\Inkscape\python\ to see if that helps, and then if necessary re-install python until you get a version that is newer than 2.5.

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

incidentally the date on my patchlevel.h file is April 18, 2007, which coincides with the date that Python reports. If your file is older than that, then I would re-install Python, just to be sure.

Revision history for this message
Lawrence (annon0m0s) wrote :

Issue resolved for me. The help -> Inkscape manual window and help ->key binding open up browser tabs. Thank you very much for your time and knowledge.

While using Explorer the mouse was moved over Inkscape\python.dll so a popup said the dll was something like version 2.5.11. So where was the version 2.5.0? http://support.microsoft.com/kb/198038 suggested free http://www.dependencywalker.com/ Downloaded that and ran it on Inkscape\python\python.exe. python.exe is dependant on Windows\system32\python25.dll. The mouse was moved over that dll and the popup showed version 2.5.0 (2006). Two issues (1) the windows\system32\python25.dll is an old version and should be removed (2) Inkscape is not using its own python dll that is packaged with the app. Resolution: Using free http://www.revouninstaller.com/ to help uninstall python then scrub the registry of anything which says python25, double checking directories had been deleted, uninstalled inkscape. Reboot. Install Inkscape. From what I remember the previous install had the python dll called python.dll but now it is called python25.dll. I kind of wonder if previously the Inkscape installer found Windows\system32\python25.dll and assumed it would be a better newer version so renamed it's own to python.dll so it would not be used but in my case the wrong result occurred.

I had looked through python bugs fix comments for version 2.5.1 but did not find anything that seemed like it would have fixed this problem so that had left me skeptical that going up a .0.1 upgrade would help. But it did resolve my problem. Thanks again.
Most recent Inkscape pic created:
http://s270.photobucket.com/albums/jj88/ltattrie/Inkscape/?action=view&current=tendriles_good.jpg

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

good to hear! yes, I had forgotten about python25.dll in the \windows\system32\ directory. Certainly if there was an older version of it around, that may well have been the problem.

so, is there any objection if I mark this as Invalid, simply so that it gets taken off the list of things to do?

Revision history for this message
Lawrence (annon0m0s) wrote :

I've marked it invalid. Thanks again.

Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.