Tcl Library Source Code

View Ticket
Login
Ticket UUID: 8e5a7e4a420a9e5cf69fa29407ac218c9a6abbf0
Title: zipfile::decode::iszip leaves non-zip file open
Type: Bug Version: tip
Submitter: anonymous Created on: 2022-04-07 12:03:02
Subsystem: zip Assigned To: aku
Priority: 7 High Severity: Important
Status: Closed Last Modified: 2022-04-08 19:25:34
Resolution: Fixed Closed By: aku
    Closed on: 2022-04-08 19:25:34
Description:

Files should be testable to see if they are openable as ZIP files, and zipfile::decode::iszip does this. Except it leaves the file open if it is not a ZIP. This is because LocateEnd terminates with an error, yet the close of the channel is placed assuming that no error ever happens. This is especially a problem on Windows, where it prevents deletion of the file.

See this Stack Overflow question for details/context/clunky workaround.

User Comments: aku added on 2022-04-08 19:25:34:

Fixed with commit [114c16ad94]

Thanks to Donal for the report.