From c56a2de5fc8911dd6502f0548c01ab7bde833cda Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 5 Feb 2025 22:07:37 -0500 Subject: [PATCH] Fix escaped serial port label string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- obd/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obd/utils.py b/obd/utils.py index 77cb36e2..221d3e9c 100644 --- a/obd/utils.py +++ b/obd/utils.py @@ -174,7 +174,7 @@ def scan_serial(): possible_ports += glob.glob("/dev/ttyUSB[0-9]*") elif sys.platform.startswith('win'): - possible_ports += ["\\.\COM%d" % i for i in range(256)] + possible_ports += [r"\\.\COM%d" % i for i in range(256)] elif sys.platform.startswith('darwin'): exclude = [