From: tom.rmadilo on
On Jun 26, 7:30 pm, achillez <mew...(a)gmail.com> wrote:
> On Jun 26, 6:38 pm, achillez <mew...(a)gmail.com> wrote:
>
>
>
>
>
> > On Jun 26, 2:29 am, Keith <kilowattra...(a)use-reply-to.invalid> wrote:
>
> > > achillez wrote in
> > > <07a1543a-8d94-4137-bd72-d691fc6f3...(a)q36g2000pri.googlegroups.com> on Fri, 25
> > > Jun 2010 17:59:15 -0700 (PDT):
>
> > > >I've been experimenting with using geturl to download stock history
> > > >from yahoo.com and I noticed that it does not download the entire
> > > >file. Less of the file is received when -channel is used vs. just
> > > >dumping straight to the state(body) buffer. Can anyone offer a
> > > >suggestion on what I'm doing wrong? Is geturl known to be buggy w/
> > > >some sites or on some OS's (I'm using Win7) ?
>
> > > >Here's an example of the script I ran (note - httpcopy is a proc I
> > > >created from the Tcl help pages)
>
> > > >httpcopy
> > > >http://ichart.finance.yahoo.com/table.csv?s=GOOG&a=06&b=9&c=1970&d=05...
> > > >"output/goog.csv"
>
> > > There is a bug in the http package. IIRC you use the switch
> > > -blocksize -1
> > > There is thread about it here on the newsgroup, so a Google Groups search will
> > > help run it down.
>
> > > --
> > > --
> > > Best Regards, Keithhttp://home.comcast.net/~kilowattradio/
>
> > Thanks, I think I found the thread at:
>
> >http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/6de...
>
> > Interestingly, they said that this should be fixed in Tcl 8.6b1.2, I
> > just reinstalled to Tcl8.6b1.2 and see that the problem still exists.
> > If the if statement below is changed to "if {1} {" then it doesn't
> > download the entire file.
>
> > if {0} {
> >    set out [open $file w]
> >    fconfigure $out -translation binary
> >    set token [::http::geturl $url -channel $out -keepalive 1 \
> >           -progress httpCopyProgress -blocksize $chunk -timeout 10000 -
> > binary 0]
> >    close $out
> >    #::http::wait $token} else {
>
> >    set token [::http::geturl $url]
> >    set outfile [open $file w]
> >    fconfigure $outfile -translation binary
> >    puts -nonewline $outfile [::http::data $token]
> >    close $outfile
>
> > }
>
> > Any thoughts on what the problem still could be? Should I file a bug
> > report on this?
>
> It appears the problem is not OS dependent. I just replicated the same
> problem on Ubuntu with Tcl 8.6b1.2.

Actually the referenced thread says:

"You'll be pleased to know that the fix ships in the upcoming 8.5.8
release, and is also (of course) forward-ported to the 8.6 branch, so
it'll be in 8.6b2."

I'm guessing that 8.6b2 is newer than 8.6b1.2, but I don't know the
details of the fix or if they relate to this issue.
From: achillez on
On Jun 26, 9:22 pm, "tom.rmadilo" <tom.rmad...(a)gmail.com> wrote:
> On Jun 26, 7:30 pm, achillez <mew...(a)gmail.com> wrote:
>
>
>
> > On Jun 26, 6:38 pm, achillez <mew...(a)gmail.com> wrote:
>
> > > On Jun 26, 2:29 am, Keith <kilowattra...(a)use-reply-to.invalid> wrote:
>
> > > > achillez wrote in
> > > > <07a1543a-8d94-4137-bd72-d691fc6f3...(a)q36g2000pri.googlegroups.com> on Fri, 25
> > > > Jun 2010 17:59:15 -0700 (PDT):
>
> > > > >I've been experimenting with using geturl to download stock history
> > > > >from yahoo.com and I noticed that it does not download the entire
> > > > >file. Less of the file is received when -channel is used vs. just
> > > > >dumping straight to the state(body) buffer. Can anyone offer a
> > > > >suggestion on what I'm doing wrong? Is geturl known to be buggy w/
> > > > >some sites or on some OS's (I'm using Win7) ?
>
> > > > >Here's an example of the script I ran (note - httpcopy is a proc I
> > > > >created from the Tcl help pages)
>
> > > > >httpcopy
> > > > >http://ichart.finance.yahoo.com/table.csv?s=GOOG&a=06&b=9&c=1970&d=05...
> > > > >"output/goog.csv"
>
> > > > There is a bug in the http package. IIRC you use the switch
> > > > -blocksize -1
> > > > There is thread about it here on the newsgroup, so a Google Groups search will
> > > > help run it down.
>
> > > > --
> > > > --
> > > > Best Regards, Keithhttp://home.comcast.net/~kilowattradio/
>
> > > Thanks, I think I found the thread at:
>
> > >http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/6de....
>
> > > Interestingly, they said that this should be fixed in Tcl 8.6b1.2, I
> > > just reinstalled to Tcl8.6b1.2 and see that the problem still exists.
> > > If the if statement below is changed to "if {1} {" then it doesn't
> > > download the entire file.
>
> > > if {0} {
> > >    set out [open $file w]
> > >    fconfigure $out -translation binary
> > >    set token [::http::geturl $url -channel $out -keepalive 1 \
> > >           -progress httpCopyProgress -blocksize $chunk -timeout 10000 -
> > > binary 0]
> > >    close $out
> > >    #::http::wait $token} else {
>
> > >    set token [::http::geturl $url]
> > >    set outfile [open $file w]
> > >    fconfigure $outfile -translation binary
> > >    puts -nonewline $outfile [::http::data $token]
> > >    close $outfile
>
> > > }
>
> > > Any thoughts on what the problem still could be? Should I file a bug
> > > report on this?
>
> > It appears the problem is not OS dependent. I just replicated the same
> > problem on Ubuntu with Tcl 8.6b1.2.
>
> Actually the referenced thread says:
>
> "You'll be pleased to know that the fix ships in the upcoming 8.5.8
> release, and is also (of course) forward-ported to the 8.6 branch, so
> it'll be in 8.6b2."
>
> I'm guessing that 8.6b2 is newer than 8.6b1.2, but I don't know the
> details of the fix or if they relate to this issue.

Ah ok - I guess I'll have to wait for 8.6b2. I checked activestate and
they still do not have this version of Tcl available.