Skip to content
Tcl Source Code History Of Ticket 3445787
Login

History Of Ticket 3445787

Artifacts Associated With Ticket 3445787

  1. Ticket change [0d7ee96408] (rid 114371) by apnadkarni on 2011-11-30 04:06:33:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Tcl as of fossil head on 11/29/2011. Follow on to bug 3211758 which was fixed post 8.6b2
      
      The fix in that bug made file a hidden command as was the case in older Tcl releases. However, the fix still does not allow all subcommands of file to be called even after exposing the file command.
      
      % interp create -safe
      interp0
      % interp expose interp0 file
      % interp0 eval {file dirname c:/tcl}
      invalid command name "::tcl::file::dirname"
      
      Aside from whether this is a good idea or not, it is a backward compatibility issue as was the case with 3211758 
      
      
      
    4. foundin initialized to: "obsolete: 8.6b2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "apnadkarni"
    10. subsystem initialized to: "16. Commands A-H"
    11. title initialized to: "Exposed file command broken in safe interps"
    12. type initialized to: "Bug"
  2. Ticket change [33c6e9d2f1] (rid 106650) by dgp on 2011-12-01 23:53:30:

    1. assignee changed to: "dgp"
    2. icomment:
      
      I believe this is related to the old, difficult
      problem that [interp hide] and friends have
      never really been updated to work well with
      namespaces.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. subsystem changed to: "20. [interp]"
    6. username: "dgp"
  3. Ticket change [2f62b265e9] (rid 93055) by johannes-kuhn on 2012-01-09 02:26:42:

    1. icomment:
      The file command is now a namespace ensemble (see [namespace ensemble configure file]).
      All subcommands of file are now hidden with a name like tcl:file:atime. (Original name with all namespace seperators (::) replaced by a single colon(:))
      
      This change does in fact break old scripts that uses [interp invokehidden $interp file].
      
      The safe base uses the trused interp's file command, this is ok because the exposed command does not have any special treatment depending on the interp, unlike [file channels] witch displays all open channels that this interp has access to.
      
      This might probably only a small amout of scripts that actually 1) does not use the safe base and 2) use safe interps with (partialy) exposed file commands.
      
      My advise is: make [interp hide] namespace aware, and when a hidden namespace enseble is called (like [file]) it should _first_ check if the target command (e.g. [::tcl::file::atime]) is there and call that command. If there is no such hidden command  it should check if there is an exposed command with that name.
      
      I think this is the only possible solution to have still backward compatibility and [file] a namespace ensemble
      
      
    2. login: "johannes-kuhn"
    3. mimetype: "text/plain"
    4. username: "johannes-kuhn"
  4. Ticket change [9374a191dd] (rid 105819) by johannes-kuhn on 2012-01-09 02:54:03:

    1. icomment:
      Ok, just saw that ::tcl::file::channels is never hidden, so scripts could easily create the [file] command it if they need it, but because the safe base defines an own [file] command, this is going to be a little bit more complex.
      
      Ohh, and by the way you broke my code... and it will take some of my time to fix it..
      
      
    2. login: "johannes-kuhn"
    3. mimetype: "text/plain"
    4. username: "johannes-kuhn"
  5. Ticket change [612f3edb52] (rid 92202) by dkf on 2012-05-16 15:28:07:

    1. assignee changed to: "dkf"
    2. icomment:
      This bug breaks tclhttpd. :-(
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "dkf"
  6. Ticket change [77a0745b58] (rid 89808) by johannes-kuhn on 2012-05-16 16:16:50:

    1. icomment:
      Looks like there are more scripts and applications that actually uses [interp invokehidden file] than I thought.
      
      The problem why I don't rewrite my script to work with the newer Tcl 8.6 releases is that I expect that the names of the hidden commands will change again, this time with namespace, like tcl::file::atime, which would require to rewrite the script again.
      
      I still suggest allowing hidden commands with namespaces, and for backward compatibility, if the hidden command is a namespace ensemble ([file]) then invoke the resulting command ([tcl::file::atime]) hidden (if exist), if not, invoke it in the slave.
      
      This will not fix [interp expose file], but I don't know if exposing this command is a good idea.
      
      
    2. login: "johannes-kuhn"
    3. mimetype: "text/plain"
    4. username: "johannes-kuhn"
  7. Ticket change [1cd0d2d258] (rid 90676) by dkf on 2012-05-16 21:16:08:

    1. closedate changed to: "2012-05-16T14:16:08"
    2. closer changed to: "dkf"
    3. icomment:
      OK, made a lot more compatible with older code (the hidden subcommands now have visible replacements that generate error messages) and enhanced/shortened the Safe Tcl code for doing the exposing (with help from many 8.6 features). I *think* that fixes things, but it needs independent testing...
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Pending"
    8. username: "dkf"
  8. Ticket change [993587fae1] (rid 133467) by dkf on 2013-08-22 09:43:44:

    1. closedate changed to: "2456526.90537574"
    2. comment changed to:
      Tcl as of fossil head on 11/29/2011. Follow on to bug 3211758 which was fixed post 8.6b2
      
      The fix in that bug made file a hidden command as was the case in older Tcl releases. However, the fix still does not allow all subcommands of file to be called even after exposing the file command.
      
      % interp create -safe
      interp0
      % interp expose interp0 file
      % interp0 eval {file dirname c:/tcl}
      invalid command name "::tcl::file::dirname"
      
      Aside from whether this is a good idea or not, it is a backward compatibility issue as was the case with 3211758
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. severity changed to: "Minor"
    6. status changed to: "Closed"