bpo-45593: make SpooledTemporaryFile.truncate return new file size and improve documentation#29197
bpo-45593: make SpooledTemporaryFile.truncate return new file size and improve documentation#29197rooterkyberian wants to merge 5 commits into
Conversation
|
This PR is stale because it has been open for 30 days with no activity. |
MaxwellDupre
left a comment
There was a problem hiding this comment.
Ran 99 tests in 1.041s
OK (skipped=2)
== Tests result: SUCCESS ==
Looks ok to me.
|
LGTM. @rooterkyberian Can you resolve the conflict? |
|
@furkanonder done - rebased to current main and resolved conflicts |
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
| >>> fp.write(b'Hello world!') | ||
| # read data from file | ||
| >>> fp.seek(0) | ||
| 0 |
There was a problem hiding this comment.
If we add 0 here, we should add 12 after fp.write(b'Hello world!') too.
There was a problem hiding this comment.
And later,
>>> with tempfile.TemporaryFile() as fp:
... fp.write(b'Hello world!')
... fp.seek(0)
... fp.read()
b'Hello world!'
This output should be:
12
0
b'Hello world!'
There was a problem hiding this comment.
It seems this file is not tested by doctest.
Please leave it. Otherwise, we need to fix all output and remove all comments in sample code.
|
This PR is stale because it has been open for 30 days with no activity. |
Documentation build overview
|
https://bugs.python.org/issue45593
Currently SpooledTemporaryFile.truncate doesn't return anything.
This seems to be an old issue common for some SpooledTemporaryFile methods; most recently
.seek(...)has been fixed in similar fashion.https://bugs.python.org/issue45593