Tcl Source Code

View Ticket
Login
Ticket UUID: c1a376375e0e648830cf52ca984a9ace563c0706
Title: imported namespace ensemble command name distorted during deletion trace on the import
Type: Bug Version: all versions
Submitter: pooryorick Created on: 2020-08-31 19:27:28
Subsystem: 21. [namespace] Assigned To: pooryorick
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2020-09-06 14:43:13
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2020-09-06 14:43:13
Description:

The following script should result in an error to the effect that the routine doesn't exist. Instead, it returns the full path of the deleted routine with the empty string in place of the tail of the deleted routine.

#! /usr/bin/env tclsh


proc traced {oldname newname op} {
	set origin [namespace origin $oldname]
	puts [list origin 1 $origin]
	rename $origin {}
	set origin [namespace origin $oldname]
	puts [list origin 2 $origin]

}

namespace export *

namespace eval ns1 {
	namespace ensemble create
}

namespace eval ns2 {
	namespace import ::ns1
	trace add command ns1 delete traced
}

rename ns1 {}

User Comments: jan.nijtmans added on 2020-09-06 14:43:13:

Since the Travis build problem didn't arise from this bug-fix, re-applied now. Thanks!


jan.nijtmans added on 2020-09-05 21:38:27:

Please make sure Travis builds OK before merging to core-8-branch. Reverted now from core-8-branch for this reason. Sorry!


pooryorick added on 2020-09-02 09:32:48:

Fixed in [Fixed in [ebe34426255bef25].