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
{{ message }}
Repository navigation
handle_user_provided_file leaves an empty temp file #414
When dest is not given, handle_user_provided_file() creates a NamedTemporaryFile(delete=False) before it knows whether it needs one. Two paths never use it, so an empty file is left behind:
nocopy=True with a local path returns source, and the temp file stays in in_dir (or the system temp directory).
A local path that does not exist raises OSError, and the temp file stays too.
nautilus (collection file) and kolibri2zim (custom about page and CSS, with in_dir=self.build_dir) call it with nocopy=True, so each of those runs given a local path leaves an empty tmp* file.
Proposed fix: create the temporary dest only in the download and copy branches, after the nocopy return and the existence check, and add tests that in_dir stays empty in both cases.
Activity