ExtractSublimePackage
ExtractSublimePackage copied to clipboard
Extraction-failure message has an invalid format string (`"extracting %' failed" % base_name` raises ValueError)
In ExtractSublimePackage.py (line ~78):
try:
arc.extractall(outdir)
except:
# so something else altogether went wrong
_msg("extracting %' failed" % base_name)
return
%' is not a valid conversion (it was probably meant to be %s), so building the message raises ValueError: unsupported format character "'" (ruff F509/PLE1300) inside the except: handler. When extraction really fails (disk full, permissions, corrupt member) the user gets a traceback instead of the "extracting ... failed" message, and return is never reached.
Fix: _msg("extracting %s failed" % base_name).
Found while testing packages from the Package Control catalog (static analysis + source review).
You could have fixed it in less time than it took to type up this bug.