Skip to content

gh-156939: Document that PyBytesObject ends with a NUL byte - #157236

Open
vstinner wants to merge 3 commits into
python:mainfrom
vstinner:bytes_nul
Open

gh-156939: Document that PyBytesObject ends with a NUL byte#157236
vstinner wants to merge 3 commits into
python:mainfrom
vstinner:bytes_nul

Conversation

@vstinner

@vstinner vstinner commented Sep 9, 2026

Copy link
Copy Markdown
Member

@vstinner vstinner added topic-C-API needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 9, 2026
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Sep 9, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Sep 9, 2026
@read-the-docs-community

read-the-docs-community Bot commented Sep 9, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34478641 | 📁 Comparing 65550b7 against main (9398655)

  🔍 Preview build  

1 file changed
± c-api/bytes.html

@vstinner

vstinner commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

The trailing NUL byte property is already documented in:

  • PyBytes_AsString: "The last byte in the buffer is always null, regardless of whether there are any other null bytes."
  • PyBytes_AsStringAndSize: "The buffer refers to an internal buffer of obj, which includes an additional null byte at the end (not counted in length)."

For consistency with the page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news topic-C-API

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant