Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37521
| References | <846C3A8E860C4344B567D813B63AA51D6F905ED8@BL2PRD0610MB349.namprd06.prod.outlook.com> |
|---|---|
| Date | 2013-01-24 10:58 +1100 |
| Subject | Re: urllib2 FTP Weirdness |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.934.1358985494.2939.python-list@python.org> (permalink) |
On Thu, Jan 24, 2013 at 7:07 AM, Nick Cash
<nick.cash@npcinternational.com> wrote:
> Python 2.7.3 on linux
>
> This has me fairly stumped. It looks like
> urllib2.urlopen("ftp://some.ftp.site/path").read()
> will either immediately return '' or hang indefinitely. But
> response = urllib2.urlopen("ftp://some.ftp.site/path")
> response.read()
> works fine and returns what is expected. This is only an issue with urllib2, vanilla urllib doesn't do it.
>
> The site I first noticed it on is private, but I can reproduce it with "ftp://ftp2.census.gov/".
Confirmed on 2.6.5 on Windows, fwiw. This is extremely weird. Possibly
it's some kind of race condition??
ChrisA
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: urllib2 FTP Weirdness Chris Angelico <rosuav@gmail.com> - 2013-01-24 10:58 +1100
Re: urllib2 FTP Weirdness Hans Mulder <hansmu@xs4all.nl> - 2013-01-24 01:45 +0100
Re: urllib2 FTP Weirdness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-24 04:12 +0000
Re: urllib2 FTP Weirdness Cameron Simpson <cs@zip.com.au> - 2013-02-07 10:06 +1100
Re: urllib2 FTP Weirdness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-07 02:43 +0000
Re: urllib2 FTP Weirdness Cameron Simpson <cs@zip.com.au> - 2013-02-08 08:49 +1100
csiph-web