Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-12-16
16:32 • Closed ticket [2913616fff]: msgcat does not work with Safe Base plus 8 other... artifact: c6e1883f1e user: dkf
16:32 • Ticket [2913616fff]: 4 changes artifact: 8c9b71f207 user: dkf
2009-12-15
06:41 • Ticket [2913616fff]: 5 changes artifact: ae0b0df3ff user: das
05:07 • Ticket [2913616fff]: 2 changes artifact: 03efa83ce6 user: dgp
05:07 • Ticket [2913616fff]: 4 changes artifact: 51a53d70d6 user: dgp
2009-12-14
21:35 • Ticket [2913616fff]: 1 change artifact: d53fb074fd user: dgp
2009-12-13
10:52 • New ticket [2913616fff]. artifact: 2a782c466f user: john13a

msgcat does not work with Safe Base

Closed / Fixed2913616fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-12-13 10:52:10
tested with tcl8.5.7 and 8.6b1.1, win
% ::safe::interpCreate test
test
% ::safe::setLogCmd puts stderr
% test eval package require msgcat
... (Some glob notices)
ERROR for slave test : can't read "::tcl_platform(os)": no such element in array
script error

I think, it should be at least catched.
dgp Ticket [2913616fff]: 1 change [History diff]2009-12-14 21:35:20
dgpplain2009-12-15 05:07:21
Problem arose in versions 1.3.4  and 1.4.2 of msgcat,
which came with Tcl releases since 8.4.8.

Passing to das who introduced the access of 
the tcl_platform(os) variable, for advice on how
best to fallback when variable is not present.

Not blocking 8.6b2 for this.  Not new.
dgp Ticket [2913616fff]: 2 changes [History diff]2009-12-15 05:07:22
dasplain2009-12-15 06:41:54
thanks for pointing this out.
it's not completely clear to me what is gained by not having tcl_platform(os) present in a safe interp, when tcl_platform(platform) is...
but in case that is done for a good reason, the check for tcl_platform(os) in msgcat.tcl is not actually needed,  [info exists ::tcl::mac::locale] is only going to be true on that platform anyway, so just checking this suffices, i.e. transforming

    if {$::tcl_platform(os) eq "Darwin" && $::tcl_platform(platform) eq "unix"
    && [info exists ::tcl::mac::locale] && $::tcl::mac::locale ne ""} {

into

    if {[info exists ::tcl::mac::locale] && $::tcl::mac::locale ne ""} {

will behave in an equivalent fashion and will succeed in a safe interp.
dkfplain2009-12-16 16:32:20
Applied DAS's suggested change to 8.5 and 8.6.
dkfplain2009-12-16 16:32:21
allow_comments - 1
Log in (anonymous is fine) to add a comment.