Tcl Source Code

View Ticket
Login
Ticket UUID: 4fae07ea8a7f1d5462800eea0cf2a36b67136472
Title: Broken exec/auto_execok handling of PATHEXT extensions on Windows
Type: Bug Created on: 2026-04-27 10:51:38
Submitter: apnadkarni Assigned to: nobody
Subsystem: - New Builtin Commands Severity: Minor
Priority: 5 Medium Last modified: 2026-05-21 06:00:33
Status: Closed Closed by: apnadkarni
Resolution: Fixed Closed on: 2026-05-21 06:00:33
Version:
Description:

On Windows, auto_execok looks up PATHEXT for extensions that are deemed to be "executable". However, the returned command that is to be passed to exec is wrong. For example,

% file exists foo.vbs
1
% auto_execok foo.vbs
c:/src/tcltk/wip/tcl/win/Release_AMD64_VC1944/foo.vbs
% exec {*}[auto_execok foo.vbs]
couldn't execute "c:\src\tcltk\wip\tcl\win\Release_AMD64_VC1944\foo.vbs": no such file or directory

If auto_execok does not handle PATHEXT, it can be documented as such and return an empty string. Returning some bogus command line that will never work is not advisable.

User Comments:
apnadkarni added on 2026-05-21 06:00:33:
Fixed in 9.1. Will not be fixed in earlier releases.