GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-148286: Remove invalid test in `test_decodeescape` by StanFromIreland · Pull Request #153187 · python/cpython

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Jul 6, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

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:

cpython/Lib/test/test_capi/test_bytes.py

Line 225 in 9c29e17

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

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

  • Issue: Various UB warnings found by UBSan #148286

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StanFromIreland
Fix UB in PyBytes_DecodeEscape
9c29e17
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 6, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jul 6, 2026
Various UB warnings found by UBSan #148286
Open
@StanFromIreland StanFromIreland added the skip news label Jul 6, 2026
@StanFromIreland
StanFromIreland marked this pull request as draft July 6, 2026 11:51
@bedevere-app bedevere-app Bot removed the awaiting core review label Jul 6, 2026
@serhiy-storchaka

serhiy-storchaka commented Jul 6, 2026

Copy link
Copy Markdown
Member

Simply comment out the test.

StanFromIreland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland added 2 commits July 6, 2026 14:05
@StanFromIreland
Revert "Fix UB in PyBytes_DecodeEscape"
e07bc26
This reverts commit 9c29e17.
@StanFromIreland
Remove invalid test instead
13bdd5e
@StanFromIreland
StanFromIreland requested a review from serhiy-storchaka July 6, 2026 12:09
@StanFromIreland
StanFromIreland marked this pull request as ready for review July 6, 2026 12:09
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 6, 2026
@StanFromIreland
Actually removing it would be helpful
84dfc43
@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 approved these changes Jul 6, 2026
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jul 6, 2026
@StanFromIreland StanFromIreland added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Jul 6, 2026
@StanFromIreland
StanFromIreland merged commit 8477652 into python:main Jul 6, 2026
58 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland
StanFromIreland deleted the PyBytes_DecodeEscape-ub branch July 6, 2026 14:47
@miss-islington-app

miss-islington-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Jul 6, 2026
@miss-islington-app

miss-islington-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sorry, @StanFromIreland, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 8477652cc122e744bcc70c1e133905bcbe2d8516 3.14
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned StanFromIreland Jul 6, 2026
@bedevere-app

bedevere-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

GH-153204 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jul 6, 2026
@miss-islington-app

miss-islington-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sorry, @StanFromIreland, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 8477652cc122e744bcc70c1e133905bcbe2d8516 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland removed the needs backport to 3.13 only security fixes label Jul 6, 2026
@StanFromIreland StanFromIreland removed the needs backport to 3.14 bugs and security fixes label Jul 6, 2026
StanFromIreland added a commit that referenced this pull request Jul 6, 2026
@miss-islington @StanFromIreland
[3.15] gh-148286: Remove invalid test in test_decodeescape (GH-153187…
8d21592
…) (#153204)

(cherry picked from commit 8477652)

Co-authored-by: Stan Ulbrych <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@StanFromIreland StanFromIreland

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@StanFromIreland @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.