New submission from Lukas Weber:

On my notebook I have a builtin 4G module (HP lt4112 Gobi 4G Module) it is 
using 3 COM ports.

Running: 
from serial.tools.list_ports import comports
comports()

is giving me:
File "C:\Program 
Files\Python27\lib\site-packages\serial\tools\list_ports_common.py", line 65, 
in usb_info
    ' LOCATION={}'.format(self.location) if self.location is not None else '')

having a look (and changing) at list_ports_common.py is telling me that pid and 
vid is None

this works, but might not be very proper:
    def usb_info(self):
        """return a string with USB related information about device"""
        return 'USB VID:PID={}:{}{}{}'.format(
            '{:04X}'.format(self.vid) if self.vid is not None else '',
            '{:04X}'.format(self.pid) if self.pid is not None else '',
            ' SER={}'.format(self.serial_number) if self.serial_number is not 
None else '',
            ' LOCATION={}'.format(self.location) if self.location is not None 
else '')

----------
components: Interpreter Core
messages: 271920
nosy: Lukas Weber
priority: normal
severity: normal
status: open
title: comports() failing due to internal 4G module
type: crash
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27676>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to