Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c14292e5ae22bc341a5929605acfd5af51afe410
Ticket: 2431847fffffffffffffffffffffffffffffffff
Junk at start of errorInfo when using [dict get] on arrays
User & Date: andygoth on 2008-12-15 21:57:07
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The script:
    
    proc oops {} {
        dict set array(index) poisonous garbage!
        catch {
    dict get $array(index) nonexistent
        }
        puts $::errorInfo
    }
    oops
    
    prints the following:
    
    poisonous garbage!key "nonexistent" not known in dictionary
        while executing
    "dict get $array(index) nonexistent"
    
    The dictionary value is somehow prepended to $errorInfo when [dict get] fails to find the key it's looking for.
    
    This problem does not occur when running at top level (i.e. not inside a proc).  It also does not occur when not using an array (e.g. remove "(index)" from the script).  If [dict get] fails for another reason, such as "missing value to go with key", the dictionary value is not prepended (replace "nonexistent" with "poisonous garbage!" to test).
    
  4. foundin changed to: "obsolete: 8.6a3"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "andygoth"
  10. subsystem changed to: "16. Commands A-H"
  11. title changed to:
    Junk at start of errorInfo when using [dict get] on arrays
    
  12. type changed to: "Bug"