Tk Source Code

View Ticket
Login
Ticket UUID: cb7250f960693222f09d810822391fc22e28a80b
Title: tk_getOpenFile on macOS crashes with double extensions
Type: Bug Version: 8.6.13
Submitter: umlaeute Created on: 2024-01-09 07:43:57
Subsystem: 37. [tk_get*File] Assigned To: nobody
Priority: 5 Medium Severity: Severe
Status: Open Last Modified: 2024-01-09 09:56:19
Resolution: None Closed By: nobody
    Closed on:
Description:

Consider the following call to open a file selector that filters for well-known archive extensions, including the "double extension" .tar.gz (which is of course common practice for tgz archives):

tk_getOpenFile -filetypes { {"ZIP files" .zip} {"TAR files" {.tgz}} {"more TAR files" {.tar.gz}} }

the above is a real-world example, here's a stripped down example:

tk_getOpenFile -filetypes { {"TAR files" .tar.gz} }

this code works nicely on Linux and Windows, but has started to crash with recent version of macOS (i've tested with macOS 12 (Monterey), 13 (Ventura) and 14 (Sonoma)). Older versions of OSX and macOS (e.g. 10.14 (Mojave)) seem to be unaffected (that is: it works on these older versions).

Since the Tcl/Tk build (8.6.13) is identical for our tests on Mojave (where it works) and Monterey (where it crashes), i guess the problem is really on the OS side.

however, it would be great if Tcl/Tk could catch the error for me rather than just crash.

User Comments: umlaeute added on 2024-01-09 09:56:19:

on rechecking with macOS 10.5 (Catalina), i noticed that while the tk_getOpenFile does not crash, it does not fully work either

  • the filter dialog correctly displays the tar.gzextension
  • however, i cannot actually select a foo.tar.gz file (it is disabled/greyed out in the dialog)

while not ideal, this is much better than the crash :-)