Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500818 - dev-python/pyserial-2.6-r1 - serial.tools.list_ports.comports(): /usr/lib64/python2.7/site-packages/serial/tools/list_ports_posix.py: NameError: global name 'base' is not defined
Summary: dev-python/pyserial-2.6-r1 - serial.tools.list_ports.comports(): /usr/lib64/p...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-09 23:38 UTC by NiTr0
Modified: 2014-03-25 08:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NiTr0 2014-02-09 23:38:38 UTC
pyserial-2.6 has a bug, that causes list_ports.comports() to fail:

>>> import serial.tools.list_ports
>>> serial.tools.list_ports.comports()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/serial/tools/list_ports_posix.py", line 122, in comports
    return [(d, describe(d), hwinfo(d)) for d in devices]
  File "/usr/lib64/python2.7/site-packages/serial/tools/list_ports_posix.py", line 93, in describe
    return usb_lsusb_string(sys_usb)
  File "/usr/lib64/python2.7/site-packages/serial/tools/list_ports_posix.py", line 80, in usb_lsusb_string
    return base
NameError: global name 'base' is not defined

This bug is fixed into upstream (http://sourceforge.net/p/pyserial/patches/26/), there is a patch available for 2.6, and it's fixed in 2.7. It'll be good to include this patch or to stabilize 2.7.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-10 00:27:20 UTC
$ python2.7
Python 2.7.5 (default, Jan 11 2014, 18:42:25) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial.tools.list_ports
>>> serial.tools.list_ports.comports()
[('/dev/ttyS1', 'ttyS1', 'n/a'), ('/dev/ttyS0', 'ttyS0', 'n/a'), ('/dev/ttyS3', 'ttyS3', 'n/a'), ('/dev/ttyS2', 'ttyS2', 'n/a')]

Works for me.
Comment 2 NiTr0 2014-02-12 15:23:43 UTC
It fails on USB-serial connectors.
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2014-03-25 08:25:01 UTC
(In reply to NiTr0 from comment #2)
> It fails on USB-serial connectors.

Consider filing upstream @ http://sourceforge.net/projects/pyserial/

  25 Mar 2014; Ian Delaney <idella4@gentoo.org>
  +files/pyserial-2.6-list_ports.patch, pyserial-2.6-r1.ebuild:
  Add patch to fix Bug #500818 by NiTr0