"Content-Length" header

Paul Bissex paul.bissex at gmail.com
Mon Aug 30 22:40:21 CEST 2004


On 30 Aug 2004 13:28:50 -0700, Justin <justin__devine at hotmail.com> wrote:
> Ok I have now discovered the oddest problem ever.  Check this out it
> seems that the same code that works outside of a for loop doesn't work
> in one check it out.  Even though the first entry in the list
> linklisttype is the same exact URL.
> 
> (THIS WORKS)
> 
> temp =
> urlopen("http://www.ecs.soton.ac.uk/~harnad/Temp/Ariadne-RAE.doc")
> print temp
> temp2 = temp.info()
> print temp2
> temp3 = temp2.getheader("Content-Length")
> print temp3
> 
> (THIS DOESN't)
> for y in linklisttype:
> x = y
> temp = urlopen(x)
> print temp
> temp2 = temp.info()
> print temp2
> temp3 = temp2.getheader("Content-Length")
> print temp3

I am assuming that your mail client or something else between you and
us has borked the indentation.

If so, I think your problem lies outside the code you posted. If I run
that code, properly indented and preceded by

  linklisttype = ['http://www.ecs.soton.ac.uk/~harnad/Temp/Ariadne-RAE.doc']

then I get identical output from the two.

pb

-- 
paul bissex, e-scribe.com -- database-driven web development
413.585.8095
69.55.225.29
01061-0847
72°39'71"W 42°19'42"N



More information about the Python-list mailing list