Inkscape "copy to clipboard" fails with "invalid literal for float"

Bug #1423290 reported by sgmanohar
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Incomplete
Undecided
Unassigned

Bug Description

Copying objects seems to be broken for a number of string objects in Inkscape 0.91:
I have a text object with manual kerning (imported from a pdf), and it has a
<svg:text> <svg:tspan> with multiple x-attributes separated by spaces.
It won't copy to the clipboard.

Traceback (most recent call last):
  File "ink2canvas.py", line 89, in <module>
    ink.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 268, in affect
    self.effect()
  File "ink2canvas.py", line 84, in effect
    self.walk_tree(svg_root)
  File "ink2canvas.py", line 75, in walk_tree
    self.walk_tree(node)
  File "ink2canvas.py", line 75, in walk_tree
    self.walk_tree(node)
  File "ink2canvas.py", line 74, in walk_tree
    elem.draw()
  File "/usr/share/inkscape/extensions/ink2canvas/svg.py", line 371, in draw
    _x = float(tspan.get("x"))
ValueError: invalid literal for float(): -7.6668 -2.1068001 3.7332001 9.2931995 12.0732 17.6332 23.193199 28.753201 34.313202 39.873199 45.433201

Similarly, I have another text object imported from pdf, which contains an en-dash character.
This also fails to copy to the clipboard.

Traceback (most recent call last):
  File "ink2canvas.py", line 89, in <module>
    ink.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 269, in affect
    if output: self.output()
  File "ink2canvas.py", line 34, in output
    sys.stdout.write(self.canvas.output())
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2212' in position 361: ordinal not in range(128)

I am running on Ubuntu 14.04 64-bit, gnome classic / metacity.

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

could you attach the original svg file for testing purposes?

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

On 2015-02-18 19:37 (+0100), sgmanohar wrote:
> I am running on Ubuntu 14.04 64-bit, gnome classic / metacity.

Based on the provided steps to reproduce, this is very likely another duplicate of
- Bug #418242 "Incorrect call to output plugins (with persistent error message) on copy"
  <https://bugs.launchpad.net/inkscape/+bug/418242>

Trigger in most cases is a custom clipboard manager (e.g. when using Xfce), or a (java-based) download manager. Other duplicates confirm the same issue when running Netbeans or OpenOffice at the same time as Inkscape.

There is no fix available at the moment - the current known workaround is e.g. to disable the clipboard monitoring of download helper apps.

Could you check whether you have any applications or applets running which actively monitor the clipboard?

Changed in inkscape:
status: New → Incomplete
tags: added: extensions-plugins
Revision history for this message
sgmanohar (sgmanohar) wrote :

SVG file which produces error. Two text objects which, when copied to clipboard, produce the error.

Revision history for this message
sgmanohar (sgmanohar) wrote :

Thank you -- you are right ~suv

It seems the problem was "teamviewerd" - team viewer daemon.
Error disappears when "teamviewer --daemon stop" is called, and re-appears when daemon is restarted.

Revision history for this message
Wolf (drechsel) wrote :

Me too.
But disabling teamviewer doen't help ):
ubuntu 15.04, inkscape 0.91

Revision history for this message
Remy (remmel) wrote :

Thanks, disabling teamviewer solves the problem

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.