-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-39691: Clarify io.open_code behavior #19824
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
Conversation
The previous statement wasn't true. This change uses the language from PEP 578 to describe io.open_code's behavior.
Oops, this kind of reads like the opposite of what it's meant to mean. Will fix. |
Doc/library/io.rst
Outdated
@@ -136,8 +136,8 @@ High-level Module Interface | |||
|
|||
The behavior of this function may be overridden by an earlier call to the | |||
:c:func:`PyFile_SetOpenCodeHook`, however, it should always be considered | |||
interchangeable with ``open(path, 'rb')``. Overriding the behavior is | |||
intended for additional validation or preprocessing of the file. | |||
interchangeable with ``open(abspath(str(path), 'rb')``. Overriding the |
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.
Let's also change "should always be considered interchangeable with" to "should always behave the same as". The simpler language will be easier for most people to follow (including me... I just spent way to long figuring out what I meant here)
Looks great 👍 |
Thanks @hauntsaninja for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry @hauntsaninja and @zooba, I had trouble checking out the |
Thanks @hauntsaninja for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
(cherry picked from commit 831d58d) Co-authored-by: Shantanu <[email protected]>
GH-19840 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit 831d58d) Co-authored-by: Shantanu <[email protected]>
The previous statement wasn't true, for instance, for absolute paths or pathlib.Path instances.
https://bugs.python.org/issue39691