Skip to content

Commit 0c9abbc

Browse files
dkgalistair23
authored andcommitted
Fix escaped serial port label string
Without this fix, Python 3.13.1 yields this warning during "import odb": …/obd/utils.py:177: SyntaxWarning: invalid escape sequence '\C' I'm not a Windows expert, but the correct naming convention seems to be described here: https://support.microsoft.com/en-us/topic/howto-specify-serial-ports-larger-than-com9-db9078a5-b7b6-bf00-240f-f749ebfd913e
1 parent e0304c3 commit 0c9abbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

obd/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def scan_serial():
174174
possible_ports += glob.glob("/dev/ttyUSB[0-9]*")
175175

176176
elif sys.platform.startswith('win'):
177-
possible_ports += ["\\.\COM%d" % i for i in range(256)]
177+
possible_ports += [r"\\.\COM%d" % i for i in range(256)]
178178

179179
elif sys.platform.startswith('darwin'):
180180
exclude = [

0 commit comments

Comments
 (0)