NameError: global name ‘base’ is not defined

I was facing this error:

$ python 
Traceback (most recent call last):
  File "", line 22, in 
    devices = SerialPortDevice.enumerate_devices()
  File "/comum/workspace/adafruit_guide_fft-master/", line 68, in enumerate_devices
    return [SerialPortDevice(port[0], port[1]) for port in if port[2] != 'n/a']
  File "/usr/lib/python2.7/dist-packages/serial/tools/", line 122, in comports
    return [(d, describe(d), hwinfo(d)) for d in devices]
  File "/usr/lib/python2.7/dist-packages/serial/tools/", line 93, in describe
    return usb_lsusb_string(sys_usb)
  File "/usr/lib/python2.7/dist-packages/serial/tools/", line 80, in usb_lsusb_string
    return base
NameError: global name 'base' is not defined

Then I found this “pyserial_patch.diff” patch:

After editing the the error message disappeared:

$ sudo vi /usr/lib/python2.7/dist-packages/serial/tools/

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s