Artifacts Associated With Ticket 1438236
Ticket change [5b842051d7] (rid 118340) by nobody on 2006-02-24 17:38:22:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
In the Windows runtime environment, most environment variables are defined with what I'll call dos-like slashes "\". But the TCLLIBPATH environment variable is actually used inside the init.tcl script, and requires unix-like slashes "/". Would it be possible to add this one line: if { [string equal $tcl_platform (platform) "windows"] } { set env(TCLLIBPATH) [string map {\\ \/} $env(TCLLIBPATH)] } And Change ($TCL_ROOT/lib/init.tcl): if {![info exists auto_path]} { if {[info exists env(TCLLIBPATH)]} { set auto_path $env(TCLLIBPATH) } else { set auto_path "" } } To: if {![info exists auto_path]} { if {[info exists env(TCLLIBPATH)]} { if { [string equal $tcl_platform (platform) "windows"] } { set env(TCLLIBPATH) [string map {\\ \/} $env(TCLLIBPATH)] } set auto_path $env(TCLLIBPATH) } else { set auto_path "" } } The will allow "package requires" to succeed no matter how and where the TCLLIBPATH was defined. FYI. My TCLLIBPATH is set within a .bat script and I'm finding it painfully difficult to reverse the direction of the slashes. - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "38. Init - Library - Autoload"
- title initialized to: "UNIX vs DOS Slashes"
- type initialized to: "RFE"
Ticket change [9cb659cd53] (rid 96188) by speedboat on 2006-02-25 00:43:07:
- icomment:
Logged In: YES user_id=243036 Sorry, did not mean to submit as "nobody". If you think it's a silly idea, I'll still claim it. ;) Al
- login: "speedboat"
- mimetype: "text/plain"
- username: "speedboat"
- icomment:
Ticket change [a60be07123] (rid 98529) by dgp on 2006-02-25 12:03:21:
- icomment:
Logged In: YES user_id=80530 Please give an example of a value of TCLLIBPATH that this would help. I suspect any such example would simply be an invalid value of TCLLIBPATH, which must be a Tcl list. If there's a valid use case, I think a pass with [file normalize] ought to take care of things.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [cdf61b1368] (rid 95976) by speedboat on 2006-02-27 21:00:01:
- icomment:
Logged In: YES user_id=243036 I have a .bat script which determines it's own location, for example C:\MyDir. The .bat script then sets the TCLLIBPATH accordingly, for example: set TCLLIBPATH=%MYDIR%/path/to/my/packages % MYDIR%/another/path Which results in: C:\MyDir/path/to/my/packages C:\MyDir/another/path which will not work. [file normalize] would be great, I didn't realize it would work on a list of file paths, but it would still need to be include in init.tcl probably as: set auto_path [file normalize $env(TCLLIBPATH)] I agree the .bat script is providing tcl an illegal list of directory paths, but it's far easier to correct within tcl than it is in the batch script. It's also a fairly easy problem to generate when most of the other environment variables (Ex. TCL_ROOT, TCL_LIBRARY) in the .bat script require DOS-like slashes. - login: "speedboat"
- mimetype: "text/plain"
- username: "speedboat"
- icomment:
Ticket change [4af1e41d52] (rid 126621) by speedboat on 2006-02-27 21:00:17:
- icomment:
Logged In: YES user_id=243036 I have a .bat script which determines it's own location, for example C:\MyDir. The .bat script then sets the TCLLIBPATH accordingly, for example: set TCLLIBPATH=%MYDIR%/path/to/my/packages % MYDIR%/another/path Which results in: C:\MyDir/path/to/my/packages C:\MyDir/another/path which will not work. [file normalize] would be great, I didn't realize it would work on a list of file paths, but it would still need to be include in init.tcl probably as: set auto_path [file normalize $env(TCLLIBPATH)] I agree the .bat script is providing tcl an illegal list of directory paths, but it's far easier to correct within tcl than it is in the batch script. It's also a fairly easy problem to generate when most of the other environment variables (Ex. TCL_ROOT, TCL_LIBRARY) in the .bat script require DOS-like slashes. - login: "speedboat"
- mimetype: "text/plain"
- username: "speedboat"
- icomment:
Ticket change [4bad70019e] (rid 126755) by dgp on 2006-02-27 22:38:07:
- icomment:
Logged In: YES user_id=80530 If you are going to put a literal backslash character in the value of TCLLIBPATH, you will need to enclose the list element containing that character with braces. Try: set TCLLIBPATH={%MYDIR%/path/to/my/packages} {%MYDIR%/another/path} Contrary to your claim, this is not easier to correct within Tcl than outside, because the "correction" you are asking for, is really to make a "guess" as to what the input "means". Somehow you want Tcl to guess when the backslashes are supposed to be literal, and when they are supposed to have Tcl's normal substitution rules. This kind of Do What I Mean interface always eventually leads to trouble when a different context makes the guesses wrong. Follow the rules and Say What You Mean. - login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Rejected"
- status changed to: "Closed"
- username: "dgp"
- icomment:
Ticket change [afed316f92] (rid 97900) by dgp on 2006-02-27 22:38:08:
- closedate changed to: "2006-02-27T15:38:08"
- closer changed to: "dgp"
Ticket change [ed2a9b0499] (rid 103834) by speedboat on 2006-02-27 23:11:46:
- icomment:
Logged In: YES user_id=243036 And I thought I tried every combination of quotes and braces. Sorry, guess not. Thanks, I withdraw my request. It's of course much better to fix the problem at the source, I just couldn't figure out how.
- login: "speedboat"
- mimetype: "text/plain"
- username: "speedboat"
- icomment: