Skip to content
Tcl Source Code History Of Ticket 3165071
Login

History Of Ticket 3165071

Artifacts Associated With Ticket 3165071

  1. Ticket change [7584124d00] (rid 105401) by anonymous on 2011-01-25 04:10:04:

    1. assignee initialized to: "patthoyts"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The following script fails when run on tcl-8.6.0.0b4:
      
        set url {http://www.npr.org/templates/rss/podlayer.php?id=13}
        set file "[ clock seconds ].xml"
        set out [ open $file w ]
        http::geturl $url -channel $out
        close $out
        set channel [ tDOM::xmlOpenFile $file ]
        set doc [ dom parse -channel $channel ]
        chan close $channel
      
      The [dom parse ...] fails because the file retrieved by the [http::geturl ...] is missing a chunk of data starting somewhere around line 67.
      
      _____________________________________________________________________________________________
      
      Configuration information:
      ----------------------------------------
      
      OS: Windows 7 (Version 6.1 (Build 7600))
      Tcl: ActiveTcl 8.6.0.0b4
      
        % info tclversion
        8.6
        % info patchlevel
        8.6b1.2
        % package require http
        2.8.2
        % package require tdom
        0.8.3
      
      
    4. foundin initialized to: "obsolete: 8.6b1"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. subsystem initialized to: "29. http Package"
    10. title initialized to: "http::geturl fails for at least 1 RSS feed"
    11. type initialized to: "Bug"
  2. Add attachment "http-tcl-8.6.0.0b4-defect.tcl" [456e103336] (rid 99349) by anonymous on 2011-01-25 11:10:04.

  3. Ticket change [a69c8ca9ec] (rid 98635) by anonymous on 2011-01-25 11:10:05:

    1. icomment:
      
      
      File Added - 399712: http-tcl-8.6.0.0b4-defect.tcl
      
      
      
    2. login: ""
    3. mimetype: "text/plain"
    4. username: ""
  4. Ticket change [afe3289f26] (rid 97893) by anonymous on 2011-01-25 11:18:43:

    1. icomment:
      
      
      File Added - 399713: 1295925929.xml
      
      
      
    2. login: ""
    3. mimetype: "text/plain"
    4. username: ""
  5. Add attachment "1295925929.xml" [b1e4d86722] (rid 98240) by anonymous on 2011-01-25 11:18:43.

  6. Add attachment "1295925860.xml" [5764f4fdbd] (rid 94480) by anonymous on 2011-01-25 11:19:28.

  7. Ticket change [8923f930ae] (rid 131981) by anonymous on 2011-01-25 11:19:28:

    1. icomment:
      
      
      File Added - 399714: 1295925860.xml
      
      
      
    2. login: ""
    3. mimetype: "text/plain"
    4. username: ""
  8. Ticket change [f4b524aefa] (rid 129966) by patthoyts on 2011-03-07 04:31:12:

    1. icomment:
      Your problem is in handling the encoding. You should probably be setting the file to binary otherwise we apply the channel encoding to the data as we write it to the disk file. In this case you likely later expect it to be utf8.
      
      However, when we retrieve the resource using the http package we handle the encoding as declared on the remote site. In this case there is no http content-encoding header and its type is text/xml so we are treating the inbound stream as iso8859-1. The file internally declares xml utf-8 but we will never look inside the file.
      
      I suggest you use [open $file wb] and see how that works.
      
      
    2. login: "patthoyts"
    3. mimetype: "text/plain"
    4. username: "patthoyts"
  9. Ticket change [bc36afa165] (rid 129632) by patthoyts on 2011-03-07 04:38:16:

    1. icomment:
      See also http://diveintomark.org/archives/2004/02/13/xml-media-types and RFC3023. Given no explicit content-encoding header and a type of text/xml we should be (and are) treating the data as iso8859-1.
      
      
    2. login: "patthoyts"
    3. mimetype: "text/plain"
    4. username: "patthoyts"
  10. Ticket change [0a4ffaf8f5] (rid 113794) by anonymous on 2011-03-09 06:00:47:

    1. icomment:
      Thanks for the response.
      
      I'll take a look at the specified URLs.
      
      One thing that confuses me about this issue is that the application I excerpted the code from has been working fine on Tcl 8.5.6, 8.5.8, & 8.5.9; but when I tried it with an 8.6 beta release, I found that a chunk of data missing near the 67th line in the temp file of captured data.
      
      Is the behavior of http::geturl expected to be different in 8.6?
      
      
    2. login: ""
    3. mimetype: "text/plain"
    4. username: ""
  11. Ticket change [983e02d202] (rid 110573) by anonymous on 2011-03-09 06:09:02:

    1. icomment:
      Notes: 
      1) The attached XML file labeled "valid version of the RSS feed" was generated by running the code on Tcl 8.5.9.
      2) The attached XML file labeled "corrupted version of the RSS feed" was generated by running the code on Tcl 8.6.0.0b4 (ActiveTcl version #).
      
      
    2. login: ""
    3. mimetype: "text/plain"
    4. username: ""
  12. Ticket change [fa9674f2ce] (rid 204056) by kjnash on 2022-09-10 12:04:28:

    1. closedate changed to: "2459833.003111"
    2. closer changed to: "kjnash"
    3. comment changed to:
      The following script fails when run on tcl-8.6.0.0b4:
      
        set url {http://www.npr.org/templates/rss/podlayer.php?id=13}
        set file "[ clock seconds ].xml"
        set out [ open $file w ]
        http::geturl $url -channel $out
        close $out
        set channel [ tDOM::xmlOpenFile $file ]
        set doc [ dom parse -channel $channel ]
        chan close $channel
      
      The [dom parse ...] fails because the file retrieved by the [http::geturl ...] is missing a chunk of data starting somewhere around line 67.
      
      _____________________________________________________________________________________________
      
      Configuration information:
      ----------------------------------------
      
      OS: Windows 7 (Version 6.1 (Build 7600))
      Tcl: ActiveTcl 8.6.0.0b4
      
        % info tclversion
        8.6
        % info patchlevel
        8.6b1.2
        % package require http
        2.8.2
        % package require tdom
        0.8.3
      
    4. icomment:
      (1) The encoding issue (when the server does not specify content-type or charset) is a duplicate of bug [2998307] and now has a fix.
      
      (2) The URL http://www.npr.org/templates/rss/podlayer.php?id=13 no longer exists, and so it is not possible to reproduce the "missing chunk of text" bug.  Perhaps this was a bug in Tcl 8.6.0.0b4 - but it seems to have gone away.  Or at least I have never seen it in Tcl 8.6 or 8.7 (i.e. it "works for me").
      
    5. login: "kjnash"
    6. mimetype: "text/x-fossil-plain"
    7. resolution changed to: "Fixed"
    8. severity changed to: "Minor"
    9. status changed to: "Closed"