[issue34446] ambiguous _max_size parameter in SpooledTemporaryFile

2019-07-07 Thread Andrew Scheller
Andrew Scheller added the comment: I agree that this is ambiguous behaviour. The docs at https://docs.python.org/3/library/tempfile.html#tempfile.SpooledTemporaryFile say "This function operates exactly as TemporaryFile() does, except that data is spooled in memory until the file size

[issue34446] ambiguous _max_size parameter in SpooledTemporaryFile

2018-08-21 Thread jcc2220
jcc2220 added the comment: Here's an example of the inconsistency - if SpooledTemporaryFile is instantiated with max_size set to 0, it will not rollover, EXCEPT when truncate method is called. Both write and writelines (public methods) call _check, which deals with rollover, but _check

[issue34446] ambiguous _max_size parameter in SpooledTemporaryFile

2018-08-21 Thread Brett Cannon
Brett Cannon added the comment: Do realize that anything which starts with an underscore, like _check, is considered a private API. -- nosy: +brett.cannon ___ Python tracker

[issue34446] ambiguous _max_size parameter in SpooledTemporaryFile

2018-08-20 Thread jcc2220
New submission from jcc2220 : When _max_size is set to 0, the _check method will never call rollover, as the conditional for a rollover is never satisfied. However, in the truncate method, the _max_size is not checked against 0, and so a rollover could be called when it is 0. This is more