You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ruff==0.7.0 flags our use of NamedTemporaryFile, and I believe it is correct to do so.
The temp files are owned by _FilesParser which is used like this:
parser=_FilesParser(boundary)
whileTrue:
chunk=response.read(self._chunk_size)
ifnotchunk:
breakparser.feed(chunk)
resp=parser.get_response()
ifrespisNone:
raiseProtocolError('no "response" field in multipart body')
self._raise_on_path_error(resp, path)
filenames=parser.filenames()
ifnotfilenames:
raiseProtocolError('no file content in multipart response')
eliflen(filenames) >1:
raiseProtocolError('single file request resulted in a multi-file response')
filename=filenames[0]
iffilename!=path:
raiseProtocolError(f'path not expected: {filename!r}')
f=parser.get_file(path, encoding)
parser.remove_files()
returnf
The 2nd raise, if it ever occurs will leave temporary files in the file system.
Given that charm code tends to be rerun on many events, it's likely that the broken code path would be too, leading to accumulation of temporary files until the disk is full or unit is removed.
The text was updated successfully, but these errors were encountered:
From: #1437
ruff==0.7.0
flags our use of NamedTemporaryFile, and I believe it is correct to do so.The temp files are owned by
_FilesParser
which is used like this:The 2nd
raise
, if it ever occurs will leave temporary files in the file system.Given that charm code tends to be rerun on many events, it's likely that the broken code path would be too, leading to accumulation of temporary files until the disk is full or unit is removed.
The text was updated successfully, but these errors were encountered: