Win32 - DOS/Command window pops up when using python scripts

Bug #215020 reported by Rygle
14
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Krzysztof Kosinski

Bug Description

When running a python script, a DOS window pops up, even when pythonw.exe is included in build.xml

This is separated out from discussion on LP# 187290 to avoid confusion. See relevant discussion from that bug report in this bug's discussion...

Related branches

Revision history for this message
Rygle (rygle) wrote :

Adib and Ulf Erikson suggested a patch that they thought would help with this;

https://bugs.launchpad.net/inkscape/+bug/187290/comments/13 - from Adib
AND
https://bugs.launchpad.net/inkscape/+bug/187290/comments/47 - from Ulf Erikson

But neither of these seem to help.

Revision history for this message
Rygle (rygle) wrote :

Marcin Floryan wrote:
>I have been fiddling with this issue a bit today and it seems that
>changing the build.xml to do -mconsole rather than -mwindows makes the DOS
>window disappear (and thus takes popper use of pythonw).
>PythonW.exe is now included in the build so this does not seem to be related
>to packaging.

Good work Marcin, I think this helps us move forward.

When I compile using the -mconsole option in build.xml (instead of -mwindows), I still get a windows gui program, but it keeps outputting all its messages to a permanent console, like what used to happen with the gimp and its scripting.

Anyway, it seems that it's finding pythonw.exe, but still wants to report to a Dos window that it's found it every time, which effectively bypasses the usefulness of pythonw.exe. It also reports errors.

Here's what I get when using anything python related;
>** Message: Found local interpreter, 'D:\Download\Multimedia\Image\Inkscape\comp
>iling\SVN\trunk\inkscape\python\pythonw.exe', Size: 24576

Here's an error I get when running add nodes;
>** (inkscape.exe:2460): CRITICAL **: void Inkscape::GC::Anchored::release() cons
>t: assertion `_anchor' failed

So, I reckon if we can stop Inkscape spitting out messages before running python scripts, we might have our problem solved.

Ulf Erikson wrote:
>Ok. So the real problem is the output to stdout (you don't seem to need AppPaths or PATH to find python)?
>Maybe it is enough to direct all output to stderr? Try change printf(...) to fprintf(stderr, ...) in the registrytool

This suggestion is slightly unrelated, as this particular error doesn't relate to the registrytool (I don't think) but maybe there's some merit in redirecting error messages to somewhere different, even to a text file...

Changed in inkscape:
assignee: nobody → pittos
status: New → Confirmed
description: updated
Rygle (rygle)
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.47
Revision history for this message
Ulferikson (ulferikson) wrote :

I've always used console builds just because I want those warning messages! That's why I thought the python console was gone :)

Here is a small program (a slightly modified runemacs) that you can experiment with. Simply compile inkscape with -mconsole and this tool with -mwindows. Name it either inkscapew.exe or runinkscape.exe. Seems to work okay for me, but I have not tested it much.

tags: added: extensions-plugins
removed: python
ScislaC (scislac)
Changed in inkscape:
milestone: 0.47 → none
Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

I recently fixed this (r9248), an incorrect name for the Python interpreter was causing this problem.

Changed in inkscape:
assignee: Rygle (rygle) → Krzysztof Kosinski (tweenk)
status: Confirmed → Fix Committed
milestone: none → 0.48
Revision history for this message
Rygle (rygle) wrote : Re: [Bug 215020] Re: Win32 - DOS/Command window pops up when using python scripts

Thanks Krzysztof,

You will know I haven't been at all active in the Inkscape community for
the last year after feeling I was overloaded. I still look on from the
sidelines a little.

Glad that there's some good progress happening.

Mike Pittman (Rygle).

On 30/03/2010 7:39 AM, Krzysztof Kosinski wrote:
> I recently fixed this (r9248), an incorrect name for the Python
> interpreter was causing this problem.
>
> ** Changed in: inkscape
> Assignee: Rygle (rygle) => Krzysztof Kosinski (tweenk)
>
> ** Changed in: inkscape
> Status: Confirmed => Fix Committed
>
> ** Changed in: inkscape
> Milestone: None => 0.48
>
>

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.

Duplicates of this bug

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

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