Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1f325b2ba6e0534a15b257016a4c2b572e9d9fda
Ticket: 218312ffffffffffffffffffffffffffffffffff
Tcl fails to generate visible errors under certain condition
User & Date: nobody on 2000-10-26 00:56:00
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3738 Bug
    Version: 8.0p2
    SubmitDate: '1999-12-01'
    LastModified: '1999-12-03'
    Severity: SER
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Solaris
    OSVersion: 2.6
    Machine: Sun Sparc 1000, Windows 95 running the X-Windows emulator Xoftwa
    FixedDate: '2000-10-25'
    ClosedDate: '1999-12-03'
    
    
    Name: Mark A. Wege
    
    Comments:
    This also happens using Tcl 7.4/Tk 4.0 on Unix, as well as Tcl 8.0.3 on Windows 95.
    
    While writing the test script above, I also noticed that Tcl failed to inform
    me of an error when I defined the checkvalue procedure without providing the
    3 arguments required by the trace command.
    
    ReproducibleScript:
    The following script is part of some code we use to validate data that the user
    types into entry widgets; this is done by placing traces on the entry widget's
    textvariable.  To test this, either execute wish interactively and paste this
    code into the session, or place the code into a file and then execute wish with
    the file as a parameter:
    
    proc checkvalue {args} {
       global e
       if {[string length $e] == 5} {
          after 500 {set e ""}
          puts "\nAbout to generate the error (undefined variable \"test\")"
          puts "test = $test"
          puts "after undefined variable"
       } else {
          puts "e = $e"
       }
    }
    label .l -text "Enter 5 characters to generate an error"
    entry .e -textvariable e -width 10
    button .b -width 10 -text "Enter Char" -command {append e c}
    button .c -width 10 -text "Close" -command exit
    pack .l .e
    pack .b .c -side left -expand yes
    focus .e
    trace variable e w checkvalue
    
    ObservedBehavior:
    The trace procedure (checkvalue) is written such that the code attempts to
    display the current value for an undefined variable when the entry widget
    contains 5 characters.  This should generate an error, but doesn't always.
    If you enter 5 characters manually, my first debug statement is displayed and
    the trace procedure aborts, but no error is displayed, either in my xterm
    window or in a popup window.  If you enter 5 characters by clicking on the
    "Enter Char" button 5 times, a popup window containing the error is displayed.
    
    DesiredBehavior:
    Tcl should provide some visual indication that an error has occurred, either
    by writing the error to stdout (when running interactively), or by displaying
    the error in a popup window (using tkerror/bgerror).
    
    
    
    This is by design.  The latter fails as expected, because it
    occurs via the 'append' command.  However, the former is triggered
    through the textvar tracing proc in the entry widget, which
    ignores errors. The user can specifically do 'error' if they want. 
    -- 12/03/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.0p2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    Tcl fails to generate visible errors under certain condition
    
  11. type changed to: "Bug"