inclusion of pythonw.exe in 0.47pre4 causes 3rd party commandline usage problems

Bug #482093 reported by juve
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

I use LyX which uses Inkscape to convert my SVG to PDF/EPS via a .cmd-script.
When using vanilla 0.47pre i get a final document out of this process, that does not contain the converted images. Something goes wrong with the python-invokation within inkscape, but i don't get any error messages:
A detailed discussion can be found here: https://answers.launchpad.net/inkscape/+question/89609

I also found a solution:
When renaming pythonw.exe to pythonw.bak in the inkscape/python folder everything works fine again. So i suggest to not ship pythonw.exe with the windows version of inkscape. (My old Inkscape 0.46 did not have pythonw.exe, but just python.exe included)

Ciao,
Juve

su_v (suv-lp)
tags: added: cli packaging win32
removed: commandline
su_v (suv-lp)
summary: - inclustion of pythonw.exe in 0.47pre4 causes 3rd party commandline usage
+ inclusion of pythonw.exe in 0.47pre4 causes 3rd party commandline usage
problems
Revision history for this message
juve (awakener) wrote :

I just tried to convert my SVGs via LyX again and the problem is still there, even with removing pythonw.exe

In this bug and in: https://answers.launchpad.net/inkscape/+question/89609 I claimed that renaming the files would fix the problem, but that was a mistake. I just thought it worked because my LyX used cached versions of the converted EPS-files (converted correctly from my SVGs by inkscape 0.46).

Therefore, this bug has a wrong title and description. Maybe it should be renamed:
Inclusion of python.exe in 0.47pre4 causes 3rd party commandline usage problems

The actual problem is the following:
Inkscape seems to look for it's own python.exe and uses that one if found. When inkscape uses it's own python my LyX generates empty documents (documents without images). I am not sure whether the problem results from LyX using the "wrong" Inkscape python, or whether the problem is caused by Inkscape using it'using it's own python. I just see the commandline popping up. In the title of the window i see which python is used, but not who invoked it.

Workaround:
You can "fix" this problem by deleting python.exe from the inkscape/python folder. Then inkscape (via LyX?) uses LyX's python (C:\Lyx\python\python.exe in my case). This produces valid documents containing the converted EPS-images. But i still see commandline popups, which shouldn't be the case.

Problem Investigation:
When using inkscape 0.46 (leaving it's own python untouched) I have no problems and NO commandline popup. Maybe the Inkscape internal python invocation is simply missing the "do not show commandline"-flag?

Revision history for this message
Chris Morgan (chris.morgan) wrote :

LyX shouldn't be using Inkscape's Python and Inkscape shouldn't be using LyX's Python.

What's your PATH? Inkscape's directory shouldn't be in it, and I can't comment about LyX.

I'm trying to work out what the problem is, though; it's not very clearly worded. Is the problem occurring when using LyX or Inkscape? If it's LyX, the issue is with them, it is entirely their fault. They should be using their own location first, whatever.

Revision history for this message
juve (awakener) wrote :

I did more tests:

Test Scenario:
Trigger PDF/EPS conversion from Lyx using Inkscape 0.46/0.47
and use different versions of python (copied to in inkscape's python path).

Specifcations:
- PATH = nothing relevant to Lyx or python by default
- LyX is started from directory "C:\lyx\bin"
- LyX's python dlls are located in "C:\lyx\python". I believe LyX adds this path internally to the avaliable paths (while running)

Observations:
- inkscape 0.46's python.exe searches for python25.dll
- inkscape 0.47's python.exe searches for python25.dll
- 0.46's 0.47's python.exe files are identical
- LyX's python searches for python26.dll (which it seems to find in case inkscape/python/python.exe is invoked via LyX-->Inkscape)
- python.exe opens a commandline window
- pythonw.exe does not

Test 1.1: use 0.47 with default 0.47's python:
- shows commandline popups, title: ..full\path\to\inkscape-0.47\python\python.exe
- produces no images in the PDF (no error msg), see 1st attachment: imagetest_default-inkscape-python-for-inkscape-0.47.pdf

Test 1.2: use 0.47 with lyx's python:
- shows commandline popups, title: ..full\path\to\inkscape-0.47\python\python.exe
- produces a valid PDF with images (PDF is bigger due to new PDF conversion in 0.47), see 2nd attachment: imagetest_copied-lyx-python-to-inkscape-0.47.pdf

Test 1.3: use 0.47, delete inkscape-0.46/python/python.exe
- shows commandline popups, title: C:\lyx\python\python.exe
- produces valid (big) PDFs

Test 2.1: use 0.46 with default 0.46's python:
- no popups
- valid PDF (small size), see 3rd attachment: imagetest_default-inkscape-python-for-inkscape-0.46.pdf

Test 2.2: use 0.46 with Lyx's python:
- no popups
- valid PDF (same size as Test 3), see 4th attachment: imagetest_copied-lyx-python-to-inkscape-0.46.pdf

Test 2.3: use 0.46, delete inkscape-0.47/python/python.exe
- no popups
- valid (small) PDF

Test 3: use inkscape 0.46/0.47 without LyX, from the commandline
- no popups (maybe since we already are in a commandline window)
- valids PDF-images are produced in all cases
- needs the default python-binaries shipped with inkscape, since Inkscape will not find LyX's python26.dll without being invoked from LyX

Assumptions:
- Inkscape is delegating/processing the PDF/EPS conversion to/with inkscape/python/python.exe
- Inkscape 0.46, if invoked from another tool, did image processing without showing popups. Results are valid for both versions of python.
- Inkscape 0.47, if invoked from another tool, shows a python commandline popup and when inkscape uses it's own (old) python the other tool (LyX) can't use (or maybe find) the PDF/EPS-output of python

Conclusion:
I am not sure if it is really only LyX's fault. Maybe LyX has some strange commandline/external tool handling, but since everything worked fine with 0.46, I believe that this issue could be fixed by re-adding the former (more robust?) commandline/python-invokation handling to Inkscape 0.47 again.

Revision history for this message
juve (awakener) wrote :

added attachment for previous comment

Revision history for this message
juve (awakener) wrote :

added attachment for previous comment

Revision history for this message
juve (awakener) wrote :

added attachment for previous comment

su_v (suv-lp)
tags: removed: python
Revision history for this message
Qantas94Heavy (qantas94heavy) wrote :

Cannot reproduce this with Inkscape 1.0. If this is still an issue, please check the listed bugs here: https://inkscape.org/report

Closed by: https://gitlab.com/Qantas94Heavy

Changed in inkscape:
status: New → Invalid
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.