diff options
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | serial/tools/list_ports_posix.py | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 8a8e224..8359d28 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -450,6 +450,7 @@ Bugfixes (posix): - [Patch 3462364] Fix: NameError: global name 'base' is not defined - list_ports and device() for BSD updated (Anders Langworthy) +- [Bug 3518380] python3.2 -m serial.tools.list_ports error Bugfixes (win32): diff --git a/serial/tools/list_ports_posix.py b/serial/tools/list_ports_posix.py index 7913d81..974c037 100644 --- a/serial/tools/list_ports_posix.py +++ b/serial/tools/list_ports_posix.py @@ -41,7 +41,11 @@ def read_line(filename): def re_group(regexp, text):
"""search for regexp in text, return 1st group on match"""
- m = re.search(regexp, text)
+ if sys.version < '3':
+ m = re.search(regexp, text)
+ else:
+ # text is bytes-like
+ m = re.search(regexp, text.decode('ascii', 'replace'))
if m: return m.group(1)
|