Skip to content

Add regression test for invalid escape SyntaxWarnings in utils.py - #874

Open
ReinerBRO wants to merge 1 commit into
jiaaro:masterfrom
ReinerBRO:test/no-invalid-escape-regression
Open

Add regression test for invalid escape SyntaxWarnings in utils.py#874
ReinerBRO wants to merge 1 commit into
jiaaro:masterfrom
ReinerBRO:test/no-invalid-escape-regression

Conversation

@ReinerBRO

@ReinerBRO ReinerBRO commented Mar 18, 2026

Copy link
Copy Markdown

Summary

  • add a regression test that compiles pydub/utils.py with -W error::SyntaxWarning
  • fail fast if an invalid escape sequence warning is introduced again

Why

Open issues report Python 3.12/3.13 warnings for invalid escape sequences in regexes (#801, #809, #870).
The current regex literals are already fixed, but this test keeps that guarantee covered in CI.

Validation

  • python3 -m unittest test.test.UtilityTests.test_utils_module_has_no_invalid_escape_syntax_warnings
  • python3 -m unittest test.test.UtilityTests
  • python3 -W error::SyntaxWarning -m py_compile pydub/utils.py

@ReinerBRO
ReinerBRO force-pushed the test/no-invalid-escape-regression branch from 7fe2d77 to e461b7f Compare March 23, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant