Message366475
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 >>> | |
| Date | User | Action | Args | | 2020-04-15 01:41:51 | amcinnes | set | recipients: + amcinnes | | 2020-04-15 01:41:51 | amcinnes | set | messageid: <1586914911.28.0.271091942099.issue40287@roundup.psfhosted.org> | | 2020-04-15 01:41:51 | amcinnes | link | issue40287 messages | | 2020-04-15 01:41:50 | amcinnes | create | | |