Skip to content

gh-90241: Clarify documentation for PyUnicode_FSConverter and PyUnicode_FSDecoder #128451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jan 3, 2025

@encukou
Copy link
Member

encukou commented Jan 3, 2025

LGTM, but see my comment on the issue.
Feel free to merge if you don't want to expand the PR's scope

Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

Just a few small typos

conversion function:

.. c:function:: int PyUnicode_FSConverter(PyObject* obj, void* result)

ParseTuple converter: encode :class:`str` objects -- obtained directly or
:ref:`PyArg_Parse\* converter <arg-parsing>`: encode :class:`str` objects -- obtained directly or
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:ref:`PyArg_Parse\* converter <arg-parsing>`: encode :class:`str` objects -- obtained directly or
:ref:`PyArg_Parse\* converter <arg-parsing>`: encodes :class:`str` objects -- obtained directly or

Small typo

@serhiy-storchaka
Copy link
Member Author

They are not typos.

@StanFromIreland
Copy link
Member

- PyArg_Parse converter encode str objects
+ PyArg_Parse converter encodes str objects

Since PyArg_Parse is singular, encode must also be singular. See this article.

@serhiy-storchaka
Copy link
Member Author

This is not related. Imperative style is more preferable. See documentations for other functions. For example, PyUnicode_DecodeFSDefaultAndSize: Decode a string from the :term:`filesystem encoding and error handler`.

@serhiy-storchaka
Copy link
Member Author

@encukou, please take a look again. Is it look good enough now?

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

Minor nit; otherwise looks good.

Co-authored-by: Erlend E. Aasland <[email protected]>
@encukou encukou merged commit 657d7b7 into python:main Jan 6, 2025
24 of 25 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 6, 2025
…yUnicode_FSDecoder (pythonGH-128451)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 6, 2025
…yUnicode_FSDecoder (pythonGH-128451)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jan 6, 2025

GH-128542 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jan 6, 2025
@bedevere-app
Copy link

bedevere-app bot commented Jan 6, 2025

GH-128543 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jan 6, 2025
serhiy-storchaka added a commit that referenced this pull request Jan 6, 2025
…PyUnicode_FSDecoder (GH-128451) (GH-128542)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Jan 6, 2025
…PyUnicode_FSDecoder (GH-128451) (GH-128543)

(cherry picked from commit 657d7b7)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…yUnicode_FSDecoder (pythonGH-128451)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants