[issue25635] urllib2 cannot fully read FTP file

2020-11-30 Thread Irit Katriel


Irit Katriel  added the comment:

Works for me on master (3.10) too.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25635] urllib2 cannot fully read FTP file

2019-10-22 Thread Batuhan


Batuhan  added the comment:

It works as expected on master (3.9.0a0). I think we can close this

--
nosy: +BTaskaya

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25635] urllib2 cannot fully read FTP file

2015-11-16 Thread R. David Murray

R. David Murray added the comment:

Most likely it is a timing issue, with the response object sometimes getting 
GCed before the read is complete (your local server would make this less likely 
since the read would complete sooner).

I think this has been fixed in python3.  Can you check?

Note, however, that this is not best practice code.  Ideally you should 
explicitly close the response object after reading from it.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25635] urllib2 cannot fully read FTP file

2015-11-16 Thread keakon

New submission from keakon:

I found the bug from this slide: 
http://sector.ca/Portals/17/Presentations15/SecTor_Branca.pdf

The second way cannot fully read the file.

import urllib2

url = 'ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest'
response = urllib2.urlopen(url)
data = response.read()
print len(data)  # 6653498

data = urllib2.urlopen(url).read()
print len(data)  # 65536


It might be something wrong with the FTP server. It's OK when I read from my 
own FTP server.

--
components: Library (Lib)
messages: 254733
nosy: keakon
priority: normal
severity: normal
status: open
title: urllib2 cannot fully read FTP file
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com