Tcl Source Code

View Ticket
Login
Ticket UUID: 627660
Title: tclPkgUnknown broken in safe interps
Type: Bug Version: obsolete: 8.4.1
Submitter: dgp Created on: 2002-10-23 19:24:38
Subsystem: 38. Init - Library - Autoload Assigned To: das
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-10-27 18:21:34
Resolution: Fixed Closed By: das
    Closed on: 2002-10-27 11:21:34
Description:
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.
User Comments: das added on 2002-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?

Attachments: