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-156939: Document that PyASCIIObject ends with null byte by vstinner · Pull Request #157708 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 17, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Document also that PyUnicode_READ_CHAR() supports reading the trailing null byte.

Add tests on PyUnicode_READ_CHAR().

  • Issue: C API: Detect buffer overflow in PyBytesWriter #156939

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner
vstinner requested a review from ZeroIntensity as a code owner September 17, 2026 20:48
@bedevere-app bedevere-app Bot mentioned this pull request Sep 17, 2026
C API: Detect buffer overflow in PyBytesWriter #156939
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Sep 17, 2026
@vstinner vstinner added the skip news label Sep 17, 2026
@vstinner

vstinner commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

This PR is similar to #157236 which documents PyBytesObject trailing null byte.

All reactions

Sorry, something went wrong.

Uh oh!

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

@read-the-docs-community

read-the-docs-community Bot commented Sep 17, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34650751 | 📁 Comparing eef4c0c against main (5539c2a)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

  • license.html
  • c-api/bytes.html
  • c-api/unicode.html
  • library/ipaddress.html
  • library/turtle.html
  • whatsnew/changelog.html
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
pythongh-156939: Document that PyASCIIObject ends with null byte
ee34138
Document also that PyUnicode_READ_CHAR() supports reading the
trailing null byte.
@vstinner
vstinner force-pushed the unicode_capi branch from dcc4075 to ee34138 Compare September 19, 2026 13:35
@vstinner
Rephrase
eef4c0c
@vstinner
vstinner enabled auto-merge (squash) September 19, 2026 13:49
@vstinner
vstinner merged commit 4d3b405 into python:main Sep 19, 2026
31 checks passed

Uh oh!

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

@vstinner
vstinner deleted the unicode_capi branch September 19, 2026 13:56
@bedevere-app bedevere-app Bot removed the awaiting core review label Sep 19, 2026
@vstinner vstinner added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 16, 2026
@miss-islington-app

miss-islington-app Bot commented Oct 16, 2026

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 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 commented Oct 16, 2026

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 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 commented Oct 16, 2026

Copy link
Copy Markdown

GH-159530 is a backport of this pull request to the 3.14 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.14 bugs and security fixes label Oct 16, 2026
@bedevere-app

bedevere-app Bot commented Oct 16, 2026

Copy link
Copy Markdown

GH-159531 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 Oct 16, 2026
vstinner added a commit that referenced this pull request Oct 16, 2026
@miss-islington @vstinner
[3.14] gh-156939: Document that PyUnicodeObject ends with null charac…
823f781
…ter (GH-157708) (#159530)

gh-156939: Document that PyUnicodeObject ends with null character (GH-157708)

Document also that PyUnicode_READ() and PyUnicode_READ_CHAR()
accept reading the trailing null character, and that PyUnicode_GetLength()
doesn't count the trailing null character.
(cherry picked from commit 4d3b405)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this pull request Oct 16, 2026
@miss-islington @vstinner
[3.15] gh-156939: Document that PyUnicodeObject ends with null charac…
5a6369f
…ter (GH-157708) (#159531)

gh-156939: Document that PyUnicodeObject ends with null character (GH-157708)

Document also that PyUnicode_READ() and PyUnicode_READ_CHAR()
accept reading the trailing null character, and that PyUnicode_GetLength()
doesn't count the trailing null character.
(cherry picked from commit 4d3b405)

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

Reviewers

@ZeroIntensity ZeroIntensity Awaiting requested review from ZeroIntensity ZeroIntensity is a code owner

Uh oh!

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

Assignees

No one assigned

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.

1 participant

@vstinner
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 01402503 — 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.