Barcode problem

Bug #169043 reported by Bug Importer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Ted Gould

Bug Description

Systematic message when running Barcode extension. October development
version of inkscape

Can not encode '"1251455"' into EAN8 Barcode, Size must be 7 or 8 Numbers
only
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/render_barcode.py", line 58, in
<module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 153, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/render_barcode.py", line 46, in
effect
    'y' : y,
  File "/usr/share/inkscape/extensions/Barcode/__init__.py", line 79, in
getBarcode
    return EAN8.Object(param)
  File "/usr/share/inkscape/extensions/Barcode/Base.py", line 43, in
__init__
    self.string = self.encode( self.text )
  File "/usr/share/inkscape/extensions/Barcode/EAN8.py", line 49, in
encode
    result = result + leftMap[int(num)]
ValueError: invalid literal for int() with base 10: '"'

Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

Originator: NO

Aaron, you recently worked with barcode, can you please look into this?

nightrow (jb-benoit)
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Tom Davidson (tjd-mit) wrote :

From the error message, the original user appears to have entered double-quotes around the number. I.e. "1251455", so the error reported is actually expected behavior. Search 'barcode' for other problems relating to this extension.

Changed in inkscape:
status: Confirmed → Invalid
Revision history for this message
Aaron C Spike (acspike) wrote :

I think this is actually a symptom of generalized quoting problems with effects. The problem is something like the user didn't enter quote and they appeared, but were not stripped by standard command line parsing because they were unnecessary.

Changed in inkscape:
status: Invalid → In Progress
Revision history for this message
Tom Davidson (tjd-mit) wrote :

I see. Bug 168783 reports the same problem (That bug reported multiple issues, and launchpad will only allow a bug to be a dupe of one other bug, so I couldn't mark it as a duplicate of this one)

Revision history for this message
Aaron C Spike (acspike) wrote :

Ted I think this is your arena because it concerns quoting on linux.

Changed in inkscape:
assignee: acspike → ted-gould
Revision history for this message
Tom Davidson (tjd-mit) wrote :

Has anyone been able to reproduce this bug on a recent SVN version? I've never seen it on Linux, and Aaron reports that barcode is currently working on Windows...

Changed in inkscape:
status: In Progress → Incomplete
Revision history for this message
jkap (jkap) wrote :

I second the report. Mac OS X 10.4.11 Intel, Inkscape 0.46, EAN13, either 12 or 13 digits. The other barcode codings, too.

Traceback (most recent call last):
  File "Contents/Resources/extensions/render_barcode.py", line 58, in ?
    e.affect()
  File "/Applications/Inkscape.app/Contents/Resources/extensions/inkex.py", line 154, in affect
    self.effect()
  File "Contents/Resources/extensions/render_barcode.py", line 41, in effect
    object = getBarcode( self.options.type, {
  File "/Applications/Inkscape.app/Contents/Resources/extensions/Barcode/__init__.py", line 76, in getBarcode
    return EAN13.Object(param)
  File "/Applications/Inkscape.app/Contents/Resources/extensions/Barcode/Base.py", line 47, in __init__
    self.data = self.graphicalArray(self.string)
  File "/Applications/Inkscape.app/Contents/Resources/extensions/Barcode/Base.py", line 123, in graphicalArray
    return [(x,len(list(y))) for x, y in itertools.groupby(code)]
AttributeError: 'module' object has no attribute 'groupby'

or, different,

Traceback (most recent call last):
  File "Contents/Resources/extensions/render_barcode.py", line 58, in ?
    e.affect()
  File "/Applications/Inkscape.app/Contents/Resources/extensions/inkex.py", line 154, in affect
    self.effect()
  File "Contents/Resources/extensions/render_barcode.py", line 41, in effect
    object = getBarcode( self.options.type, {
  File "/Applications/Inkscape.app/Contents/Resources/extensions/Barcode/__init__.py", line 61, in getBarcode
    import Code128
  File "/Applications/Inkscape.app/Contents/Resources/extensions/Barcode/Code128.py", line 117
    for char in (datum[i:i+2] for i in range(0, len(datum), 2)):
                                ^
SyntaxError: invalid syntax

Revision history for this message
Louis-Xavier Brusset (lxbrusset) wrote :
Download full text (6.2 KiB)

Hello, I work under Intrepid Ibex.
I made some experiments in inkscape :
Tried to encode 2101094325777 in all formats.

# EAN13 : no codebar generated got following message :
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/render_barcode.py", line 58, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 154, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/render_barcode.py", line 46, in effect
    'y' : y,
  File "/usr/share/inkscape/extensions/Barcode/__init__.py", line 76, in getBarcode
    return EAN13.Object(param)
  File "/usr/share/inkscape/extensions/Barcode/Base.py", line 43, in __init__
    self.string = self.encode( self.text )
  File "/usr/share/inkscape/extensions/Barcode/EAN13.py", line 45, in encode
    if not self.varifyChecksum(number):
  File "/usr/share/inkscape/extensions/Barcode/EAN13.py", line 87, in varifyChecksum
    new = self.computeChecksum(number[:12])
AttributeError: Object instance has no attribute 'computeChecksum'

# EAN8 (trucated to 21010943):codebar generated got following message :
/usr/share/inkscape/extensions/render_barcode.py:50: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
  if barcode:

#UPC-A : no codebar generated got following message :
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/render_barcode.py", line 58, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 154, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/render_barcode.py", line 46, in effect
    'y' : y,
  File "/usr/share/inkscape/extensions/Barcode/__init__.py", line 76, in getBarcode
    return EAN13.Object(param)
  File "/usr/share/inkscape/extensions/Barcode/Base.py", line 43, in __init__
    self.string = self.encode( self.text )
  File "/usr/share/inkscape/extensions/Barcode/EAN13.py", line 45, in encode
    if not self.varifyChecksum(number):
  File "/usr/share/inkscape/extensions/Barcode/EAN13.py", line 87, in varifyChecksum
    new = self.computeChecksum(number[:12])
AttributeError: Object instance has no attribute 'computeChecksum'

#UPC-E : no codebar generated got following message :
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/render_barcode.py", line 58, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 154, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/render_barcode.py", line 46, in effect
    'y' : y,
  File "/usr/share/inkscape/extensions/Barcode/__init__.py", line 76, in getBarcode
    return EAN13.Object(param)
  File "/usr/share/inkscape/extensions/Barcode/Base.py", line 43, in __init__
    self.string = self.encode( self.text )
  File "/usr/share/inkscape/extensions/Barcode/EAN13.py", line 45, in encode
    if not self.varifyChecksum(number):
  File "/usr/share/inkscape/extensions/Barcode/EAN13.py", line 87, in varifyChecksum
    new = self.computeChecksum(number[:12])
AttributeError: Object instance has no attribute 'computeChecksum'

#UPC-E : no codebar generated got following...

Read more...

Revision history for this message
Louis-Xavier Brusset (lxbrusset) wrote :

Sorry forgot UPC-5

Barcode is generated and got message :
/usr/share/inkscape/extensions/render_barcode.py:50: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
  if barcode:

Revision history for this message
jazzynico (jazzynico) wrote :

I can reproduce it on Ubuntu 9.04, Inkscape 0.46, but NOT with rev. 21690. Thus I think it can be marked as fixed.
Please test with a recent dev build and reopen this report if you still have the bug.

Changed in inkscape:
milestone: none → 0.47
status: Incomplete → Fix Committed
tags: added: extensions-plugins
removed: extensions
ScislaC (scislac)
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.