The size is in bytes. From the SpooledTemporaryFile() source code :
def _check(self, file): if self._rolled: return max_size = self._max_size if max_size and file.tell() > max_size: self.rollover()
and file.tell() gives the position in bytes.
I would say that any use of the term size in connection with Python file objects, not expressed in bytes, needs to be explicitly mentioned. All other file methods that deal with size always work in bytes.
source share