Skip to content
Tcl Source Code History Of Ticket 2849797
Login

History Of Ticket 2849797

Artifacts Associated With Ticket 2849797

  1. Ticket change [b3cc3ee797] (rid 124912) by dkf on 2009-09-03 09:00:32:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Consider this trace...
      
      % close stderr; open /dev/tty w
      file2
      % file channels
      stdin stdout stderr
      % fconfigure stderr -buffering none
      % puts stderr BOO
      BOO
      % puts file2 BOO2
      BOO2
      
      Now the issues... [open] is returning a name that isn't listed by [file channels], and [puts] (and any other channel command) is working with both the 'standard' name (file2) and the 'magic' name (stderr). Let channels only ever have a single name, and let lookups always only work with that name. And when working with FDs 0, 1 or 2, let the name be the 'magic' one because that's what scripts expect (irrespective of what the [open] command - or any other channel creator - expects).
      
    4. foundin initialized to: "obsolete: 8.6b1.1"
    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: "dkf"
    10. subsystem initialized to: "25. Channel System"
    11. title initialized to: "channel name inconsistencies"
    12. type initialized to: "Bug"
  2. Ticket change [09579b8d0c] (rid 89704) by ferrieux on 2009-09-07 03:23:21:

    1. icomment:
      It appears that channel creation occurs at several places, while they all end up calling Tcl_RegisterChannel, whose channel argument is *not* declared const.
      Do you have an objection against extending T_RC's mission to "std normalization" (ie rewriting "file1" as "stdin" etc) ? Or is its lack of side effects too deep in its DNA ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [193933f1ca] (rid 122779) by nijtmans on 2009-09-07 21:51:04:

    1. icomment:
      Thinking more about it, letting FDs 0, 1 and 2 be magic, is the wrong solution. In the given example, I expect the "puts stderr BOO" give
      an error, because stderr is closed! When someone closes stderr, any
      writing to it should give an error, just as any other channel.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  4. Ticket change [161762b749] (rid 124667) by ferrieux on 2009-09-08 03:23:13:

    1. icomment:
      Yes, but it is the way people have been doing (unix-specific) std* redirections in Tcl since the beginning... So, reforming it the way you suggest is guaranteed to break scripts (eg Larry's on tclcore).
      
      Clearly I have sympathy with any consistent move at this point, and both extremes are consistent. The sad part is that both have potential losses of compatibility... Now let's weigh them:
      
       (1) Business As Usual: do nothing, close this item as Won't Fix
       (2) force-to-std* (Donal): possible breakage of contorted scripts eg depending on channel name prefix to recognize type
       (3) never-go-back-to-std* (Jan): clean, and isomorphic with Windows, but guaranteed to break scripts that do hackish unix redirections.
      
      IMHO (2) is a quick win which is 99.9% safe, while (3) is 90% safe, but the 10% can be fixed by a new [chan dup2/rename] or similar explicit, Tcl-channel-level redirection primitive.
      
      Opinions ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [54eccb987b] (rid 94034) by dkf on 2009-09-08 16:01:40:

    1. icomment:
      3 breaks existing code.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [ba2d4cb880] (rid 129280) by dkf on 2009-09-08 16:03:44:

    1. icomment:
      And I've no evidence of anyone relying on preservation of the 'file2' pattern for the stdchan case.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [48aaf06389] (rid 99932) by nijtmans on 2009-09-08 16:20:54:

    1. icomment:
      > the 10% can be fixed by a new [chan dup2/rename] or
      > similar explicit, Tcl-channel-level redirection primitive.
      
      Or just implement a "chan rename" for Tcl 8.6,
      which at least is risk-less and provides redirection for
      the standard channels on Windows, in combination
      with (1) or (2). Then (3) can be considered for
      Tcl 9, because judging the remarks it
      wouldn't be wise to do it in Tcl 8.x.
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  8. Ticket change [fd2aed6367] (rid 108370) by dkf on 2009-09-08 17:41:22:

    1. icomment:
      All I seek with this bug report is for channels to have one name, which should be that which people expect it to be. The command creating the channel should be returning the One True Name of that channel. (The standard channel names are exceptionally well known.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [5e8672d6b4] (rid 115651) by lars_h on 2009-09-10 01:37:23:

    1. icomment:
      Adding to the confusion:
      
      % info pa
      8.6b1
      % open README r
      file5
      % puts file5 foo
      channel "file5" wasn't opened for writing
      % close file5
      % close stderr
      % open README r
      file2
      % file channels
      stdin stdout stderr
      % read file2 30
      README:  Tcl
          This is the T
      % read stderr 30
      cl 8.6b1 source distribution.
      
      % open README r
      file5
      % read file5 30
      README:  Tcl
          This is the T
      % puts file5 foo
      % 
      
      stderr can be open for reading, but it's no error to write to it. And this "not an error" state appears contagious, as the final [puts file5] doesn't throw an error anymore.
      
      
      
    2. login: "lars_h"
    3. mimetype: "text/plain"
    4. username: "lars_h"
  10. Add attachment "channel.patch" [67af2012f0] (rid 102929) by nijtmans on 2009-09-23 16:40:47.

  11. Ticket change [396a4d08b2] (rid 112386) by nijtmans on 2009-09-23 16:40:47:

    1. icomment:
      
      
      File Added - 344019: channel.patch
      
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  12. Ticket change [57c8e89d6c] (rid 117687) by nijtmans on 2009-09-23 16:49:33:

    1. icomment:
      Added a patch, following exactly dkf's suggestion. Andreas (or anyone other), please evaluate! It shows that no current test case fails, but it would be good to add a test case for the new behavior.
      
      Noting that the magic behavior is in fact documented and not
      UNIX-specific (which I originally thought), it should be preserved
      in Tcl8.x! After doing this test, I changed my opinion and I now
      agree with DKF. The change looks harmless, and makes the
      script behavior less confusing. So, +1 for me.
      
      The *potential incompatibility* only consists of the function
      Tcl_CreateChannel() and its deratives, which now sometimes
      ignores the chanName argument. The proposed doc
      change is in the patch as well.
      
      Regards,
                 Jan Nijtmans
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  13. Ticket change [1c2dd01f83] (rid 90559) by nijtmans on 2009-11-19 05:42:07:

    1. closedate changed to: "2009-11-18T22:42:07"
    2. closer changed to: "nijtmans"
    3. icomment:
      
      
      allow_comments - 1
      
      Fixed as suggested by Donal
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "nijtmans"
  14. Ticket change [4776bb347b] (rid 99710) by dgp on 2009-11-19 10:46:52:

    1. icomment:
      
      Failing tests:
      
      ---- Result was:
      { chan close stdin
      stdout
      } {stderr
      }
      ---- Result should have been (exact matching):
      { chan close stdin
      file1
      } {file2
      }
      ==== chan-io-14.4 FAILED
      
      ---- Result was:
      { close stdin
      stdout
      } {stderr
      }
      ---- Result should have been (exact matching):
      { close stdin
      file1
      } {file2
      }
      ==== io-14.4 FAILED
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  15. Ticket change [b1af2d1274] (rid 98188) by dkf on 2009-11-20 00:13:26:

    1. icomment:
      Those appear to be tests that I'd expect to be broken by this type of fix of this issue. My principal concern was always the confusion about what the name of the channel (file2 in this bug report's example) really was; whether stderr (and also stdout and stdin) are aliases or real names.
      
      (chan-io-14.4 is just a [chan]-ification of io-14.4)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"