ExtractSublimePackage icon indicating copy to clipboard operation
ExtractSublimePackage copied to clipboard

Extraction-failure message has an invalid format string (`"extracting %' failed" % base_name` raises ValueError)

Open dpc00 opened this issue 2 months ago • 1 comments

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).

dpc00 avatar Sep 25 '26 09:09 dpc00

You could have fixed it in less time than it took to type up this bug.

michaelblyons avatar Sep 25 '26 12:09 michaelblyons