Tcl Source Code

View Ticket
Login
Ticket UUID: 9b47029467631832b6e9092f77eab7fd4e60f9d3
Title: testing existence of env(some_thing) destroys traces
Type: Bug Created on: 2016-02-15 23:14:51
Submitter: Assigned to: dkf
Subsystem: 08. Environment Variables Severity: Minor
Priority: 5 Medium Last modified: 2026-10-22 17:19:32
Status: Closed Closed by: serhiy.storchaka
Resolution: Fixed Closed on: 2026-10-21 11:09:22
Version: f6c1c6b4916aade8f7177b466
User Comments:
bch added on 2016-02-15 23:14:51:
[f6c1c6b4916aade8f7177b466|This commit] destroys traces on env() variables if the variables do not yet exist.

Example:

  proc foo args {
    puts "foo: $args"
  }

  trace add variable env(not_yet_existent) write foo
  info exists env(not_yet_existent)
  set env(not_yet_existent) "Now I'm here"; # trace fails to fire

jan.nijtmans added on 2016-02-19 10:54:27:

Proposed fix in [5e24c6a9dbafaf63]. Donald, could you do a review please, since you did the env handling reform.


jan.nijtmans added on 2016-02-22 12:19:06:

Fixed in trunk (and added test-case in core-8-5-branch). Kept "Pending" in case DKF would like to review it: There might be a better solution.


serhiy.storchaka added on 2026-10-21 11:09:22:

Fixed in 8.6.5 by [d644df2cad], with test env-7.3 (passes on trunk, 9.0 and 8.6). No review concerns came up since, so closing.