summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2013-05-31 01:00:57 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2013-05-31 01:00:57 +0000
commitf3da326297dcaae555247042c576b254550ad5da (patch)
tree93464226580b52c2ca44e17da650e33c51d19216
parenta13d84a44b1183b6ecdd2839651735c837e2894e (diff)
downloadpyserial-f3da326297dcaae555247042c576b254550ad5da.tar.gz
[Bug pyserial:144] com0com ports ignored due to missing "friendly name"
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@458 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r--CHANGES.txt4
-rw-r--r--serial/tools/list_ports_windows.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index cda018b..143ac23 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -445,7 +445,7 @@ Version 2.7 2012-nn-nn
Bugfixes:
- [Bug 3540332] SerialException not returned
-- [Bug pyserial:45] Error in socket_connection.py
+- [Bug pyserial:145] Error in socket_connection.py
Bugfixes (posix):
@@ -458,5 +458,5 @@ Bugfixes (win32):
- [Bug 3444941] ctypes.WinError() unicode error
- [Bug 3550043] on Window in tools global name 'GetLastError' is not defined
- [Bug pyserial:146] flush() does nothing in windows (despite docs)
-
+- [Bug pyserial:144] com0com ports ignored due to missing "friendly name"
diff --git a/serial/tools/list_ports_windows.py b/serial/tools/list_ports_windows.py
index a9e200c..c158dd5 100644
--- a/serial/tools/list_ports_windows.py
+++ b/serial/tools/list_ports_windows.py
@@ -186,9 +186,10 @@ def comports():
szFriendlyName = byte_buffer(250)
if not SetupDiGetDeviceRegistryProperty(g_hdi, ctypes.byref(devinfo), SPDRP_FRIENDLYNAME, None, ctypes.byref(szFriendlyName), ctypes.sizeof(szFriendlyName) - 1, None):
# Ignore ERROR_INSUFFICIENT_BUFFER
- if ctypes.GetLastError() != ERROR_INSUFFICIENT_BUFFER:
+ #~ if ctypes.GetLastError() != ERROR_INSUFFICIENT_BUFFER:
#~ raise IOError("failed to get details for %s (%s)" % (devinfo, szHardwareID.value))
- port_name = None
+ # ignore errors and still include the port in the list, friendly name will be same as port name
+ yield string(port_name_buffer), string(port_name_buffer), string(szHardwareID)
else:
# the real com port name has to read differently...
hkey = SetupDiOpenDevRegKey(g_hdi, ctypes.byref(devinfo), DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ)