Commits


Bryce Mecum authored and GitHub committed 2a4df7a8a17
MINOR: [Dev][C++] Fix SyntaxWarnings in asan_symbolize.py (#40411) ### Rationale for this change When running the C++ tests I noticed some warnings around string escape sequences in the [asan_symbolize.py](https://github.com/apache/arrow/blob/main/cpp/build-support/asan_symbolize.py): ``` 70: Running arrow-s3fs-test, redirecting output into /Users/bryce/src/apache/arrow/cpp/build/build/test-logs/arrow-s3fs-test.txt (attempt 1/1) 70: /Users/bryce/src/apache/arrow/cpp/build-support/asan_symbolize.py:172: SyntaxWarning: invalid escape sequence '\(' 70: match = re.match('^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line) 70: /Users/bryce/src/apache/arrow/cpp/build-support/asan_symbolize.py:177: SyntaxWarning: invalid escape sequence '\(' 70: function_name = re.sub('\(.*?\)', '', function_name) 70: /Users/bryce/src/apache/arrow/cpp/build-support/asan_symbolize.py:345: SyntaxWarning: invalid escape sequence '\(' 70: '^( *#([0-9]+) *)(0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)') ``` It looks like this usage was [turned into a SyntaxWarning in Python 3.12](https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes). Eventually they plan to change this to a SyntaxError so I think it's good to fix it now. I didn't look elsewhere in the codebase to find other instances. ### What changes are included in this PR? Swapped affected instances for raw strings. ### Are these changes tested? I haven't tested the script against what I assume would be ASAN output of some sort but I did test that the strings compile fine. For example, ```python >>> atos_line = 'foo(type1, type2) (in object.name) (filename.cc:80)' >>> re.match('^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line) <re.Match object; span=(0, 51), match='foo(type1, type2) (in object.name) (filename.cc:8> >>> re.match(r'^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line) <re.Match object; span=(0, 51), match='foo(type1, type2) (in object.name) (filename.cc:8> ``` ### Are there any user-facing changes? No. Authored-by: Bryce Mecum <petridish@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>