strange urlget problem... firewall related?
Preston Landers
planders at mail.utexas.edu
Sat May 29 15:24:21 EDT 1999
Preston Landers <planders at mail.utexas.edu> writes:
> from urllib import urlopen
> Data = urlopen("http://www.python.org/").read()
> print Data
>
> However, when I run it on another machine running Slackware (and
> Python 1.5.1, same as my machine), the first 20 or so lines are cut
> off and the rest of the document is printed! It seems to be cut by
> the same amount every time though I haven't determined yet exactly how
> much is cut. This really plays havoc with my scripts as one of their
> main functions is to scan HTML header stuff.
Well, here's another piece of the puzzle in case anyone's curious...
I don't think it's the firewall anymore. (By the way, this does
happen with all web sites, not just python.org
urlopen("http://whatever").readlines() does capture all the data.
.read() does not. I wonder why?
I will have to tweak my scripts to get it to work with a list of
lines, but that's not TOO big a deal, just a small hassle.
I still would really like to know why .read() isn't working.
I also wonder if I could solve it by copying my copy of urllib (and
maybe some other modules) to the server that's having the problems?
If I put those modules in the same directory as my script, will they
be chosen in preference to the system modules?
we wonders, yess we do, preciouss...
---Preston
More information about the Python-list
mailing list