Skip to content

gh-148286: Remove invalid test in test_decodeescape#153187

Open
StanFromIreland wants to merge 4 commits into
python:mainfrom
StanFromIreland:PyBytes_DecodeEscape-ub
Open

gh-148286: Remove invalid test in test_decodeescape#153187
StanFromIreland wants to merge 4 commits into
python:mainfrom
StanFromIreland:PyBytes_DecodeEscape-ub

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Jul 6, 2026

Copy link
Copy Markdown
Member

This is technically disallowed by the documentation of PyBytes_DecodeEscape (added in 37e2762), which says:

s must not be NULL

However, this was triggered by our test suite, which explicitly tests this case:

self.assertEqual(decodeescape(NULL), b'')

Should we also update the documentation? CC @ZeroIntensity (added docs) and @serhiy-storchaka (added test)

@serhiy-storchaka

Copy link
Copy Markdown
Member

Simply comment out the test.

@StanFromIreland StanFromIreland marked this pull request as ready for review July 6, 2026 12:09
@StanFromIreland StanFromIreland changed the title gh-148286: Fix UB (applying zero offset to null pointer) in PyBytes_DecodeEscape gh-148286: Remove invalid test in test_decodeescape Jul 6, 2026

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants