serial.tools.list_ports.comports() does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyserial (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The issue is present with both python-serial and python3-serial (ubuntu 15.04), where you got a trace back like below if you want to use list_ports.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
return [(d, describe(d), hwinfo(d)) for d in devices]
File "/usr/lib/
return [(d, describe(d), hwinfo(d)) for d in devices]
File "/usr/lib/
return usb_lsusb_
File "/usr/lib/
return base
NameError: name 'base' is not defined
The fix is also very simple (but not sure if this can be a valid fix):
In file: "/usr/lib/
Line: 67, change it to below:
66 def usb_lsusb_
67 base = os.path.
68 bus, dev = base.split('-')
So that "base" is properly defined and can be returned.
Attached the version info from apt-show:
hua@grass:~ $ apt-cache show python3-serial
Package: python3-serial
Priority: optional
Section: python
Installed-Size: 281
Maintainer: Ubuntu Developers <email address hidden>
Original-
Architecture: all
Source: pyserial
Version: 2.6-1.1ubuntu1
Depends: python3, python3:any (>= 3.3.2-2~)
Suggests: python3-wxgtk3.0 | python3-wxgtk
Filename: pool/main/
Size: 44348
MD5sum: 749c10727018f02
SHA1: 67dcb133ec940f6
SHA256: 0f6111b350e901e
Description-en: pyserial - module encapsulating access for the serial port
This module encapsulates the access for the serial port. It provides
back-ends for standard Python running on Windows, Linux, BSD (possibly
any POSIX compliant system). The module named "serial" automatically
selects the appropriate back-end.
Description-md5: 4dab91c4e71dab5
Homepage: http://
Bugs: https:/
Origin: Ubuntu
Supported: 9m
Task: ubuntu-core, cloud-image, ubuntu-core
Status changed to 'Confirmed' because the bug affects multiple users.