Menu

#2076 tclPkgUnknown broken in safe interps

obsolete: 8.4.1
closed-fixed
5
2002-10-27
2002-10-23
Don Porter
No

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.

Discussion

  • Daniel A. Steffen

    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?

     
  • Daniel A. Steffen

     
  • Daniel A. Steffen

    • status: open --> closed-fixed