Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 472ed9835fb7b08d019e89c00c9e922ff0e7c25c8d1063f8c2c7fc72bf608787
Ticket: 580808121389182456a680e5323ea346ac30e567
"string length" converts bytearrays to strings when traced
User & Date: tomkiti on 2017-11-22 15:44:55
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    When "string length" is traced, it converts a bytearray argument to a string. This happens when the the trace operation is either enterstep or leavestep, but not enter or leave. This behavior does not occur in Tcl 8.5.
    
    Script:
    
        proc p {} {
            set x [binary format x]
            puts [::tcl::unsupported::representation $x]
            string length $x
            puts [::tcl::unsupported::representation $x]
        }
        
        proc traceProc {args} {}
        
        trace add execution p enterstep traceProc
        p
    
    Output:
        value is a bytearray with a refcount of 2, object pointer at 00000000003847A0, internal representation 0000000000399860:0000000000384740, string representation " "
        value is a string with a refcount of 2, object pointer at 00000000003847A0, internal representation 000000000039AF40:0000000000384740, string representation " "
    
  5. foundin changed to: "8.6.7"
  6. is_private changed to: "0"
  7. login: "tomkiti"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "1c57e67924247fd7926e89348f266c081ec57db2"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "tomkiti"
  14. subsystem changed to: "12. ByteArray Object"
  15. title changed to:
    "string length" converts bytearrays to strings when traced
    
  16. type changed to: "Bug"