Re: urllib2 FTP Weirdness

2013-02-07 Thread Cameron Simpson
On 07Feb2013 02:43, Steven D'Aprano wrote: | On Thu, 07 Feb 2013 10:06:32 +1100, Cameron Simpson wrote: | > Timing. (Let me say I consider this scenario unlikely, very unlikely. | > But...) | > If the latter is consistently slightly slower | | On my laptop, the difference is of the order of 10

Re: urllib2 FTP Weirdness

2013-02-06 Thread Steven D'Aprano
On Thu, 07 Feb 2013 10:06:32 +1100, Cameron Simpson wrote: > | I cannot see how the firewall could possible distinguish between using > | a temporary variable or not in these two snippets: > | > | # no temporary variable hangs, or fails > | urllib2.urlopen("ftp://ftp2.census.gov/";).read() > | >

Re: urllib2 FTP Weirdness

2013-02-06 Thread Cameron Simpson
On 24Jan2013 04:12, Steven D'Aprano wrote: | On Thu, 24 Jan 2013 01:45:31 +0100, Hans Mulder wrote: | > On 24/01/13 00:58:04, Chris Angelico wrote: | >> Possibly it's some kind of race condition?? | > | > If urllib2 is using active mode FTP, then a firewall on your box could | > explain what you

Re: urllib2 FTP Weirdness

2013-01-23 Thread Steven D'Aprano
On Thu, 24 Jan 2013 01:45:31 +0100, Hans Mulder wrote: > On 24/01/13 00:58:04, Chris Angelico wrote: >> On Thu, Jan 24, 2013 at 7:07 AM, Nick Cash >> wrote: >>> Python 2.7.3 on linux >>> >>> This has me fairly stumped. It looks like >>> urllib2.urlopen("ftp://some.ftp.site/path";).read()

Re: urllib2 FTP Weirdness

2013-01-23 Thread Hans Mulder
On 24/01/13 00:58:04, Chris Angelico wrote: > On Thu, Jan 24, 2013 at 7:07 AM, Nick Cash > 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 >

Re: urllib2 FTP Weirdness

2013-01-23 Thread Steven D'Aprano
Nick Cash 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() > work

Re: urllib2 FTP Weirdness

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 7:07 AM, Nick Cash 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.s