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.