Skip to content
Tcl Source Code History Of Ticket 09ba902e2e
Login

History Of Ticket 09ba902e2e

Artifacts Associated With Ticket 09ba902e2e

  1. Ticket change [fb88ae8699] (rid 248814) by LordAro on 2025-11-26 16:34:01:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      I've run into a curious problem on Windows where TCL will intermittently be unable to find init.tcl, but with the error "No error", which is especially unhelpful:
      
      ```
      >       self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      E       _tkinter.TclError: Can't find a usable init.tcl in the following directories: 
      E           {C:\builds\m6srz7K6C\0\dev\rvs\rvs\auxd\python\tcl\tcl8.6}
      E       
      E       C:/builds/m6srz7K6C/0/dev/rvs/rvs/auxd/python/tcl/tcl8.6/init.tcl: couldn't read file "C:/builds/m6srz7K6C/0/dev/rvs/rvs/auxd/python/tcl/tcl8.6/init.tcl": No error
      E       couldn't read file "C:/builds/m6srz7K6C/0/dev/rvs/rvs/auxd/python/tcl/tcl8.6/init.tcl": No error
      E           while executing
      E       "source C:/builds/m6srz7K6C/0/dev/rvs/rvs/auxd/python/tcl/tcl8.6/init.tcl"
      E           ("uplevel" body line 1)
      E           invoked from within
      E       "uplevel #0 [list source $tclfile]"
      E       
      E       
      E       This probably means that Tcl wasn't installed properly.
      ```
      
      So far this only happens on our CI build jobs on Windows (Server 2022, docker-windows & gitlab-runner), and only in maybe 1 in every 50 builds. I've had no luck in reproducing the issue locally. Defender is disabled within on the build machines (though I still wouldn't expect 'No error' for that).
      
      As the error comes from TCL itself and there's no multithreading involved as far as I'm aware (tests run via pytest) so I don't think it's anything directly to do with python/tkinter - there shouldn't even be any other processes running tcl at the same time, all entirely sequential.
      
      The relevant bit of source code that's running is:
      
      ```
      from tkinter import Tcl, TclError
      def run_tcl(filename: str, tcl_code: str) -> str:
          tcl = Tcl()
          try:
              return tcl.eval(tcl_code)
          except TclError as e:
              print(f"Error in Tcl code: {e}", filename)
      ```
      
      This has apparently been seen in the wild in a number of places, but mostly in the context of matplotlib, where the solution seems to be switching to a different backend (Agg) that doesn't use tkinter. Obviously this isn't viable for me as I'm running TCL code directly.
      
      * https://stackoverflow.com/questions/71443540/intermittent-pytest-failures-complaining-about-missing-tcl-files-even-though-the
      * https://github.com/actions/setup-python/issues/1102
      * https://github.com/microsoft/azure-pipelines-tasks/issues/16426
      * https://github.com/orgs/community/discussions/26434
      * https://github.com/matplotlib/matplotlib/issues/29119
      
      For reference, I've seen it when running via pytest 8.4.2 on CPython 3.13.9 (with a build from https://github.com/astral-sh/python-build-standalone), which has (a threaded build of) TCL 8.6.12, but has been seen on 3.12.10 as well (and judging by the other links, plenty of other versions too)
      
      I've had a good search of this bug tracker and the mailing list and haven't found anything particularly relevant. I realise this is a bit of a brain dump and there isn't a huge amount to go on, but I've not got a lot! I don't have any real experience with TCL/TK, so if there's anything more I can turn on to debug this further (environment variables, etc) it would be greatly appreciated!
      
    5. foundin initialized to: "8.6.12"
    6. is_private initialized to: "0"
    7. login: "LordAro"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "f5960d8c42a209f0c1345190d692f076bf24aaa0"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "LordAro"
    14. subsystem initialized to: "38. Init - Library - Autoload"
    15. title initialized to: "Intermittently unable to find init.tcl on Windows"
    16. type initialized to: "Bug"
  2. Ticket change [6de6c6c7f3] (rid 251972) by jan.nijtmans on 2026-03-09 07:50:30:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2461108.8267387035"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      It looks like this was a problem in tkinter, fixed by [https://github.com/python/cpython/pull/125312|this] pull-request.
      
      So, closing as Invalid (meaning: not a bug in Tcl but somewhere else)
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Invalid"
    8. status changed to: "Closed"