Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-10-27
18:21 • Add attachment package.diff to ticket [627660ffff] artifact: aa416efdec user: das
18:21 • Closed ticket [627660ffff]: tclPkgUnknown broken in safe interps plus 7 othe... artifact: d43eecc09c user: das
2002-10-23
19:24 • New ticket [627660ffff]. artifact: 9a5e6d399b user: dgp

tclPkgUnknown broken in safe interps

Closed / Fixed627660ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-10-23 19:24:38
Tests safe-7.1 and safe-7.2 fail in the Tcl 8.4.1
distribution
on Linux.  Here's the essential problem:

% [safe::interpCreate] eval package require http 1
can't read "::tcl_platform(os)": no such element in array
% set errorInfo    
can't read "::tcl_platform(os)": no such element in array
    while executing
"string equal $::tcl_platform(os) "Darwin""
    (procedure "tclPkgUnknown" line 29)
    invoked from within
"tclPkgUnknown http 1"
    ("package unknown" script)
    invoked from within
"package require http 1"
    invoked from within
"[safe::interpCreate] eval package require http 1"

The variable tcl_platform(os) does not exist in a
safe interp, so this test needs to have an
[interp issafe] check to protect it.

das is already working on a patch to take these
platform-specifc things out of [tclPkgUnknown],
but the checks in init.tcl that will replace them
will have a similar need to check for safe interps.
dasplain2002-10-27 18:21:34
File Added - 33975: package.diff

Logged In: YES 
user_id=90580

the latest [patch  #624509] fixes this problem.

for reference, the attached 1 line patch will also fix the bug in the 
8.4.1 distro (in the simplest, minimal way).

tested that safe.test now passes with either of these patches 
applied.

If we don't anticipate checking in [patch  #624509] in the near 
future, maybe the attached patch should go in?
Log in (anonymous is fine) to add a comment.

Attachments: