mirror of
https://github.com/opencv/opencv.git
synced 2026-09-11 04:43:22 -05:00
Fix Python utility compatibility issues - #29755 ### Problem Several repository Python utilities emit invalid escape sequence SyntaxWarnings under Python 3.13. The Java test checker also attempts to parse non-Java assets as UTF-8, causing UnicodeDecodeError, and relies on a global parser instance. The Apple build utility accepts malformed CMake version strings because one version separator is an unescaped regex wildcard. ### Changes - Use raw strings for regular expressions and replacement templates. - Skip non-Java files in the Java test checker. - Use the current JavaParser instance instead of global state. - Require literal dots in parsed CMake versions. ### Verification - Compiled every tracked Python file with SyntaxWarning treated as an error. - Ran the Java checker against modules/java/test successfully. - Verified valid CMake versions are accepted and malformed versions rejected. - Ran git diff --check.