This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amcinnes
Recipients amcinnes
Date 2020-04-15.01:41:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586914911.28.0.271091942099.issue40287@roundup.psfhosted.org>
In-reply-to
Content
The documentation says SpooledTemporaryFile "operates exactly as TemporaryFile() does".

seek() would be expected to return the new absolute position; this is what it does for TemporaryFile, and is the documented behaviour of seek() in IOBase. But for SpooledTemporaryFile it returns None.

Probably trivial to fix by sticking a "return" on https://github.com/python/cpython/blob/0361556537686f857f1025ead75e6af4ca7cc94a/Lib/tempfile.py#L741

Python 3.8.2 (default, Apr  8 2020, 14:31:25) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> t = tempfile.TemporaryFile()
>>> print(t.seek(0))
0
>>> u = tempfile.SpooledTemporaryFile()
>>> print(u.seek(0))
None
>>>
History
Date User Action Args
2020-04-15 01:41:51amcinnessetrecipients: + amcinnes
2020-04-15 01:41:51amcinnessetmessageid: <1586914911.28.0.271091942099.issue40287@roundup.psfhosted.org>
2020-04-15 01:41:51amcinneslinkissue40287 messages
2020-04-15 01:41:50amcinnescreate