Skip to content

bpo-40287: Fix SpooledTemporaryFile.seek() return value #19540

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
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def readlines(self, *args):
return self._file.readlines(*args)

def seek(self, *args):
self._file.seek(*args)
return self._file.seek(*args)

def tell(self):
return self._file.tell()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ``SpooledTemporaryFile.seek()`` did not return the position.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Fixed ``SpooledTemporaryFile.seek()`` did not return the position.
Fixed ``SpooledTemporaryFile.seek()`` to return the position instead of
``None``.

Grammar fix and slight elaboration on the change made.

Copy link
Member Author

Choose a reason for hiding this comment

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

slight elaboration on the change made.

While return (including implicit return) and return None has the same behavior,
"return None intentionally" is different from "return nothing (but None actually)" for human.

In this case, returned None didn't have any meaning. So I don't want to mention about None.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, good point. I suppose my thoughts were that if I were to read this news entry, I might ask "what did it do previously?". But in this case, the change was probably straightforward enough that they could simply look at the source.