[Win32] Perspective / Envelope error (ValueError: empty string for float)

Bug #176750 reported by CamiloSanchez
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Tom Davidson

Bug Description

Traceback (most recent call last):

  File "share\extensions\perspective.py", line 123, in ?

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 157, in affect

    self.effect()

  File "share\extensions\perspective.py", line 68, in effect

    q[query] = float(f.read())

ValueError: invalid literal for float(): RegistryTool: Could not set the value 'C:\Program Files\Inkscape\inkscape.exe'

116.17442

Revision history for this message
prkos (prkos) wrote :

Traceback (most recent call last):

  File "share\extensions\perspective.py", line 127, in <module>

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 153, in affect

    self.effect()

  File "share\extensions\perspective.py", line 72, in effect

    q[query] = float(f.read())

ValueError: empty string for float()

Im on WinXP, latest dev build

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Tom Davidson (tjd-mit) wrote :

prkos also noted in bug 168796 that a similar error is seen in the 'envelope effect'. His comment is pasted here:

Im using the build from 27th Dec and still get error:

Traceback (most recent call last):

  File "share\extensions\summersnight.py", line 78, in <module>

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 153, in affect

    self.effect()

  File "share\extensions\summersnight.py", line 51, in effect

    self.q[query] = float(f.read())

ValueError: empty string for float()

On 16848 on fedora the Envelope works but I get this:

** (inkscape:9437): WARNING **: Format autodetect failed. The file is being opened as SVG.

** (inkscape:9438): WARNING **: Format autodetect failed. The file is being opened as SVG.

** (inkscape:9439): WARNING **: Format autodetect failed. The file is being opened as SVG.

** (inkscape:9440): WARNING **: Format autodetect failed. The file is being opened as SVG.

Revision history for this message
Tom Davidson (tjd-mit) wrote : Re: Perspective / Envelope errors on Vista machine

(Should have said "his/her comment", above, of course)

Bug 179683 suggests that these problems may be due to a permissions problem. Can someone test whether the same errors happen when using a user account with Administrator privileges?

Revision history for this message
Tom Davidson (tjd-mit) wrote :

Setting milestone since I merged in a milestoned bug (bug 168796) to this one.

Changed in inkscape:
milestone: none → 0.46
importance: Undecided → Medium
Revision history for this message
prkos (prkos) wrote :

*cough cough* yes it is "her" comment :D

The above Traceback is done on a user account with admin privileges (on WinXP).

Both Envelope and Perspective work ok on fedora 7, no more format messages (though envelope can give some strange results if the skeleton is much bigger than the object but you can work around it easily).

Revision history for this message
Bryce Harrington (bryce) wrote :

The title suggests this is a Vista-only issue, is that correct? If it works acceptably in other versions of Windows, and works fine on non-Linux systems as prkos indicates, then I don't think we should consider it a release blocker issue, and drop the milestone.

Changed in inkscape:
status: Confirmed → Incomplete
Revision history for this message
CamiloSanchez (camilosanchez2) wrote : RE: [Bug 176750] Re: Perspective / Envelope errors on Vista machine

i dont think this problem is vista related, i think the problem goes beyond that since many users in different OS have expressed the same bug.

_______________________________________________________
Visit(a) mi/my Blog! Dia Sideral/Sidereal Day <click aqui<click here
_______________________________________________________

> From: <email address hidden>
> To: <email address hidden>
> Date: Mon, 7 Jan 2008 00:43:24 +0000
> Subject: [Bug 176750] Re: Perspective / Envelope errors on Vista machine
>
> The title suggests this is a Vista-only issue, is that correct? If it
> works acceptably in other versions of Windows, and works fine on non-
> Linux systems as prkos indicates, then I don't think we should consider
> it a release blocker issue, and drop the milestone.
>
> ** Changed in: inkscape
> Status: Confirmed => Incomplete
>
> --
> Perspective / Envelope errors on Vista machine
> https://bugs.launchpad.net/bugs/176750
> You received this bug notification because you are a direct subscriber
> of the bug.

_________________________________________________________________
Put your friends on the big screen with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008

Revision history for this message
Bryce Harrington (bryce) wrote : Re: Perspective / Envelope errors on Vista machine

Camilo, can you provide references to these other reports of the same bug?

Revision history for this message
Peter Lewerin (vermeil-deactivatedaccount) wrote :

Maybe it's this dog that's biting us: <URL: http://www.python.org/doc/faq/windows/#why-doesn-t-os-popen-work-in-pythonwin-on-nt>

The only scripts that use os.popen are g2pngs.py, gimp_xcf.py, summersnight.py, and perspective.py. Only the latter two try to read from the pipe, and neither of them seems to work on WinXP.

Revision history for this message
prkos (prkos) wrote :

It also happens on WinXP, build 6th Jan

Perspective:
Traceback (most recent call last):
  File "share\extensions\perspective.py", line 127, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "share\extensions\perspective.py", line 72, in effect
    q[query] = float(f.read())
ValueError: empty string for float()

Envelope:
Traceback (most recent call last):
  File "share\extensions\summersnight.py", line 78, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "share\extensions\summersnight.py", line 51, in effect
    self.q[query] = float(f.read())
ValueError: empty string for float()

Revision history for this message
Tina Russell (tinarussell) wrote :

Waaah! I'm getting the error on Ubuntu 7.10. I can provide more info if needed.

Revision history for this message
Tina Russell (tinarussell) wrote :

I changed to the Jan. 4 build, and then "Perspective" gave me the error that I had to install the lxml module. I installed that through the package manager, and now I get this weird error and traceback for "Perspective:"

Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/perspective.py", line 127, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 153, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/perspective.py", line 72, in effect
    q[query] = float(f.read())
ValueError: invalid literal for float(): Initting inputs
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
Input::Input
In

Inkscape also now has a weird window maximization error, if that helps...

prkos (prkos)
Changed in inkscape:
status: Incomplete → Confirmed
Revision history for this message
Peter Lewerin (vermeil-deactivatedaccount) wrote : Re: Perspective / Envelope errors

Both scripts work on WinXP with the 2008-01-11 (21:53) version.

Revision history for this message
prkos (prkos) wrote :

Are you sure? Im getting the same traceback messages as in my last comment.

Revision history for this message
Peter Lewerin (vermeil-deactivatedaccount) wrote :

Hmm, just tried it again. Perspective works when I start up Inkscape normally, but crashes if I run it through gdb.

Got to clean the house now, I'll look at it again tonight.

Revision history for this message
Peter Lewerin (vermeil-deactivatedaccount) wrote :

Yes, I'm positive. Both Perspective and Envelope work fine in regular Inkscape, but crash when starting Inkscape from gdb.

My backtrace indicates a problem with the debugging code:

#0 0x7c901231 in ntdll!DbgUiConnectToDbg ()
   from C:\WINDOWS\system32\ntdll.dll
#1 0x7c96c943 in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#2 0x0022ece4 in ?? ()
#3 0x7c96cd80 in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#4 0x00d572c0 in intl!bind_textdomain_codeset ()
#5 0x003f0000 in ?? ()
#6 0x00d572c8 in intl!bind_textdomain_codeset ()
#7 0x0022ed58 in ?? ()
#8 0x7c96df66 in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#9 0x003f0000 in ?? ()
#10 0x00d572c0 in intl!bind_textdomain_codeset ()
#11 0x7c96e11c in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#12 0x003f0000 in ?? ()
#13 0x00d572c8 in intl!bind_textdomain_codeset ()
#14 0x40000060 in ?? ()
#15 0x00000000 in ?? ()

Revision history for this message
Tom Davidson (tjd-mit) wrote :

@Tina: do you have the 'numpy' library installed ? If not, could you install it and report back if that helps?

Revision history for this message
Tina Russell (tinarussell) wrote : Re: Perspective / Envelope error (ValueError: empty string for float)

Yep, I have “numpy” installed. Not having it was an earlier error I got, but was easy enough to fix with the package manager.

By the way, “Perspective” works for me again (hooray), as of some recent (post-Jan 8th) snapshot. Now my main problem is a weird window maximization bug that I wrote about somewhere here on Launchpad...

https://bugs.launchpad.net/inkscape/+bug/186541

Revision history for this message
Tom Davidson (tjd-mit) wrote :

Tina's comment means that this bug is currently only being reported under Windows, which supports Peter L's hypothesis...

Revision history for this message
Fithian (fithian) wrote :

Certain function of Inkscape only work in Vista if you run as administrator i.e. Perspective or Envelope

Revision history for this message
Bryce Harrington (bryce) wrote :

In order for this to remain milestoned, we must have an assignee for the bug, who will take ownership of getting it fixed.

We cannot block the release on platform-specific bugs that have no owner.

Revision history for this message
Tom Davidson (tjd-mit) wrote :

Assigning to myself as 'fix or remove'. If this extension is not fixed before 0.46, it should not be shipped with Windows. Work on a fix can continue in the next development branch...

Changed in inkscape:
assignee: nobody → tjd-mit
Revision history for this message
Johan Engelen (johanengelen) wrote :

How exactly is this extension meant to work?

I can make it do something, but...
please explain it or submit a test file.

Thank you very much.

Revision history for this message
prkos (prkos) wrote :

Im attaching a test file, it contains 2 paths, one star-like and the other a 4-node skeleton, the skeleton must be selected last. Run Envelope and the star should be deformed to adjust to the skeleton. (the same with Perspective).

This is what I get from gdb when trying to execute Perspective or Envelope on WinXP, 25th Feb build:

warning: HEAP[inkscape.exe]:
warning: Invalid Address specified to RtlFreeHeap( 03880000, 00D61240 )

Program received signal SIGTRAP, Trace/breakpoint trap.
0x7c901231 in ntdll!DbgUiConnectToDbg () from C:\WINDOWS\system32\ntdll.dll
(gdb) bt
#0 0x7c901231 in ntdll!DbgUiConnectToDbg ()
   from C:\WINDOWS\system32\ntdll.dll
#1 0x7c96c943 in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#2 0x0022ece4 in ?? ()
#3 0x7c96cd80 in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#4 0x00d61238 in sp_feTurbulence_build_renderer(SPFilterPrimitive*, NR::Filter*
)::__PRETTY_FUNCTION__ ()
#5 0x03880000 in ?? ()
#6 0x00d61240 in sp_feTurbulence_build_renderer(SPFilterPrimitive*, NR::Filter*
)::__PRETTY_FUNCTION__ ()
#7 0x0022ed58 in ?? ()
#8 0x7c96df66 in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#9 0x03880000 in ?? ()
#10 0x00d61238 in sp_feTurbulence_build_renderer(SPFilterPrimitive*, NR::Filter*
)::__PRETTY_FUNCTION__ ()
#11 0x7c96e11c in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\system32\ntdll.dll
#12 0x03880000 in ?? ()
#13 0x00d61240 in sp_feTurbulence_build_renderer(SPFilterPrimitive*, NR::Filter*
)::__PRETTY_FUNCTION__ ()
#14 0x40000060 in ?? ()
#15 0x00000000 in ?? ()

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

running the win32 binary build : Inkscape-0.45+0.46pre3-1.win32.exe
on Windows XP Professional

both the Perspective and Envelope effects are working well, thanks for the demo svg file, it clarified things considerably.

Revision history for this message
prkos (prkos) wrote :

I just installed pre3 (on WinXP) and still no luck with Perspective or Envelope, I get the same traceback like reported above. All other Modify Path extensions are working.

If the problem might be my system, what can I test? Python seems to work for everything else.

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

I've kind of lost track of the thread here. What happens if you run it without gdb?

Revision history for this message
prkos (prkos) wrote :

If I run normally I get:

Perspective:
Traceback (most recent call last):
  File "share\extensions\perspective.py", line 127, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "share\extensions\perspective.py", line 72, in effect
    q[query] = float(f.read())
ValueError: empty string for float()

Envelope:
Traceback (most recent call last):
  File "share\extensions\summersnight.py", line 78, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "share\extensions\summersnight.py", line 51, in effect
    self.q[query] = float(f.read())
ValueError: empty string for float()

I can't get gdb to work atm but if I remember correctly Inkscape froze when I selected Perspective or Envelope from the menu (the menu wouldn't close).

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

sorry, I didn't read the thread very carefully. I'm at a loss as to what is happening here. The only thing I can think of is to check how recent the .pyc files are. In the extensions directory there are files like inkex.pyc, simplepath.pyc, ffgeom.pyc, cubicsuperpath.pyc. These are compiled automatically from the corresponding .py files. If the .pyc files are not newer than the .py files then you should force a re-compile by renaming the .pyc file to be something else, which would make python create a new version.

Revision history for this message
sas (sas-sas) wrote :

I've tried the Envelope effect (with the enveltest.svg file that prkos attached) under Windows XP, and it worked without problem, in both 0.46pre2 and 0.46pre3.

One thing I would suggest is to see what Inkscape is producing on stderr when it (apparently) produces nothing on stdout. I can post a modified version of summersnight.py to do this if anybody wants it.

Revision history for this message
Ulferikson (ulferikson) wrote :

There is another bug about extensions not working unless python is in the search path since Inkscape simply calls for "python". The summersnight.py script similarly calls "inkscape" without a path. Is Inkscape in your search path?

Revision history for this message
sas (sas-sas) wrote :

I can reproduce the problem by renaming inkscape.exe to something else. So it looks like Ulferikson may be on the right track, insofar as the script's attempt to run Inkscape may be failing because inkscape.exe can't be found. But inkscape.exe isn't in the path on my machine, and yet the Envelope effect works, so there's more to it than this.

I'm attaching a modified version of summersnight.py that reports the message from stderr back to Inkscape on failure. If someone who is experiencing the problem could try the Envelope effect with this summersnight.py, and report the result, it would clarify what is happening.

Revision history for this message
prkos (prkos) wrote :

Thank you sas for the file, here is what I got when I ran Envelope with it:

** (inkscape.exe:2504): CRITICAL **: Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*): assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed

** (inkscape.exe:2504): CRITICAL **: Inkscape::XML::Document* sp_repr_read_file(const gchar*, const gchar*): assertion `Inkscape::IO::file_test( filename, G_FILE_TEST_EXISTS )' failed

** (inkscape.exe:2504): WARNING **: Specified document C:\DOCUME~1\m cannot be opened (is it valid SVG file?)

(inkscape.exe:2504): Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed
The system cannot find the path specified.

I did try paths before and it still didn't work (I tried .bat and also globally in environment variables)

Revision history for this message
theAdib (theadib) wrote :

I patched trunk that might affect this problem. pls see https://bugs.launchpad.net/inkscape/+bug/187290 . Check nightly build after revision 17875 . Adib.

Revision history for this message
theAdib (theadib) wrote :

can someone confirm this is solved on recent pre4 snapshot? Thx, Adib.

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

I copied the libpng13.dll and renamed into 12 to make it start

I still have the same issue, heres what I get on pre4 (other extensions seem to work ok):
Envelope:
Traceback (most recent call last):
  File "C:\Program Files\Inkscape\share\extensions\summersnight.py", line 78, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "C:\Program Files\Inkscape\share\extensions\summersnight.py", line 51, in effect
    self.q[query] = float(f.read())
ValueError: empty string for float()

Perspective:
Traceback (most recent call last):
  File "C:\Program Files\Inkscape\share\extensions\perspective.py", line 127, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "C:\Program Files\Inkscape\share\extensions\perspective.py", line 72, in effect
    q[query] = float(f.read())
ValueError: empty string for float()

nothing in gdb

Revision history for this message
Rygle (rygle) wrote :

Don't know if this is the patch you mean, but the spawn patch should be in trunk, and ready to be applied in the \packaging\win32\patches folder for branch.
The patch I mean is here - https://bugs.launchpad.net/inkscape/0.46.x/+bug/204779 - although Adib did some mods from that which I didn't fully understand, but they seemed to do the same thing as the spawn patch on the bug.

Revision history for this message
sas (sas-sas) wrote :

The error messages that prkos reports in her post of 2008-03-12 seem to show that the Python script calls Inkscape with a truncated filename, since the temporary SVG file shouldn't be C:\DOCUME~1\m. (It should be something like %tmpdir%\ink_ext_XXXXXX.svgKBY67S, where the last 6 characters are random, and %tmpdir% is the temporary file directory, usually of the form C:\DOCUME~1\<username>\LOCALS~1\Temp.)

Perhaps someone who is experiencing this problem could try the following: in your Inkscape directory, type

  set TMPDIR=C:\

at the command prompt, and then

  inkscape.exe

and then try the envelope effect. Does it work? If it still doesn't work, what does my modified version of summersnight.py report?

Revision history for this message
prkos (prkos) wrote :

thats it thank you sas!!

set TMPDIR=C:\ works for both Envelope and Perspective

do you still need the test with the summersnight.py?

Revision history for this message
sas (sas-sas) wrote :

No, there's no need to test with the modified summersnight.py, as it's just the same as the original when everything works.

Although we now have a workaround, I still don't really understand what is going wrong. Is the second character of your Windows username something that might conceivably cause problems (like a space, or a punctuation mark, or a non-ASCII character)?

I could try replacing the os.popen3 call in the script by using the newer subprocess module, but I don't know if this would make any difference.

Revision history for this message
Ulferikson (ulferikson) wrote :

By setting TMPDIR to point to a direcotry containing a space in its name I too see an "empty string" error. Adding escaped quotes to the last %s in the call to os.popen3() seems to help.

Revision history for this message
prkos (prkos) wrote :

its &

I didn't pick up at all what was going on until you mentioned the second character. Whats in a name eh?

Revision history for this message
sas (sas-sas) wrote :

Adding quotes (as Ulferikson suggests) works for "&" as well. I'm attaching a fixed version of summersnight.py - can someone confirm that this is OK on Linux too (I think it should be)?

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

sas, prkos: I can't follow this thread. Please give a short status! Is this issue now in c-code or in the python code?
Regarding the temp I have to say defining a temp is not so good. Microsoft defines for each user a separate directory somewhere in "c:\documents and settings\username"
Or is there an error in implementation of temp_file function ?

Adib.

Revision history for this message
sas (sas-sas) wrote :

The issue is in the Python scripts.

Setting TMPFILE was just a test, to try to determine the problem. The fix won't change the temp directory.

The fix is just to add some quotes in the scripts. I can post a patch, but I would like someone to confirm that the latest summersnight.py that I posted really does fix the problem, and that it works OK on Linux too.

Revision history for this message
prkos (prkos) wrote :

With the new summersnight.py the Envelope works, but Perspective doesnt (the errors there are in perspective.py I guess). The result is the same in pre4-2 and todays build 31st March.

What do you need tested on linux? Effects or weird characters in names? Perspective and Envelope work ok on Jan 10th build on fedora 7.

Revision history for this message
prkos (prkos) wrote :

I tested the latest summersnight.py on fedora 7, Jan 10th build and it all seems to work ok. Maybe someone with a newer build should test also.

Revision history for this message
sas (sas-sas) wrote :

Yes, summersnight.py is just the Envelope effect. Here's the fixed perspective.py, if anyone wants to test it.

Revision history for this message
sas (sas-sas) wrote :

Thanks for testing on Fedora. (The build doesn't matter much - I just wanted to be sure that the quotes don't cause any problem on Linux.)

So here's the patch for the Envelope effect.

Revision history for this message
sas (sas-sas) wrote :

And here's the patch for the Perspective effect.

Do we need to patch gimp_xcf.py too? It looks to have the same problem, but nobody has mentioned it.

Revision history for this message
prkos (prkos) wrote :

I tested perspective.py on pre4-2 and build 31st March and Perspective effect now works. thanx sas!

Revision history for this message
prkos (prkos) wrote :

pitty this didn't make it into official 0.46, could someone pls apply the 2 pathes?

Revision history for this message
sas (sas-sas) wrote :

Here's a combined patch, if that makes it any easier to apply.

Revision history for this message
Rygle (rygle) wrote :

Built on Windows XP SP2 using the latest trunk and doesn't seem to cause any extra problems. I know this is a vista problem, just reporting results. Perspective and Envelope worked both with and without patch.

Revision history for this message
prkos (prkos) wrote :

this bug only occurs when you have weird characters in your win username (like & for example like I do), so to make it work on my machine I need the patch :D

Revision history for this message
Rygle (rygle) wrote :

Added in to trunk - revision 18410.

Revision history for this message
Rygle (rygle) wrote :

Changing to Fix Committed as this has already been added to trunk. Milestoning for 0.46.1.

Changed in inkscape:
milestone: 0.46 → 0.46.1
status: Confirmed → Fix Committed
Revision history for this message
Rygle (rygle) wrote :

Added to 0.46 release branch as a patch for 0.46.1 under /packaging/win32/patches/0.46.1. Still trying to keep separate from main 0.46 branch as this is Win32 only, to keep the linux distro's happy.

Revision history for this message
Rygle (rygle) wrote :

The above was at revision 18468

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

it looks to me that this has been resolved, marking as fix released

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.