Skip to content

gh-149611: Explain return values for Path.write_text() and Path.write_bytes()#149629

Open
omkar-334 wants to merge 2 commits intopython:mainfrom
omkar-334:return-number
Open

gh-149611: Explain return values for Path.write_text() and Path.write_bytes()#149629
omkar-334 wants to merge 2 commits intopython:mainfrom
omkar-334:return-number

Conversation

@omkar-334
Copy link
Copy Markdown

@omkar-334 omkar-334 commented May 10, 2026

pathlib.Path.write_text and pathlib.Path.write_bytes both return an integer from the underlying file object's .write() call (number of characters and number of bytes, respectively), but neither the Sphinx documentation nor the docstrings mention this.

Issue - #149611

@omkar-334 omkar-334 requested a review from barneygale as a code owner May 10, 2026 02:26
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 10, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented May 10, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 10, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32620712 | 📁 Comparing fcbc4e2 against main (cc5cf14)

  🔍 Preview build  

1 file changed
± library/pathlib.html

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.

1 participant