Skip to content

Ignore DeprecationWarning when decoding string escape sequences - #12

Draft
mlin wants to merge 1 commit into
mainfrom
codex/fix-invalid-escape-sequence-warning
Draft

Ignore DeprecationWarning when decoding string escape sequences#12
mlin wants to merge 1 commit into
mainfrom
codex/fix-invalid-escape-sequence-warning

Conversation

@mlin

@mlin mlin commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent spurious DeprecationWarning emitted by codecs.decode(..., 'unicode-escape') when decoding ASCII parts of WDL strings so decoding does not pollute logs on newer Python versions.

Description

  • Import warnings and wrap the ASCII-part decode in a decode_ascii helper that uses warnings.catch_warnings() with warnings.filterwarnings("ignore", category=DeprecationWarning), and use that helper in String._decode_escapes via String._ASCII_PARTS_RE.sub in WDL/Expr.py.

Testing

  • Ran the project's unit tests including string-escape decoding checks and the full test suite with pytest, and the tests completed successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant