[issue25635] urllib2 cannot fully read FTP file

keakon report at bugs.python.org
Mon Nov 16 08:47:11 EST 2015


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 <report at bugs.python.org>
<http://bugs.python.org/issue25635>
_______________________________________


More information about the Python-bugs-list mailing list