This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alanoe
Recipients alanoe
Date 2014-09-09.21:53:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410299620.11.0.341288273378.issue22376@psf.upfronthosting.co.za>
In-reply-to
Content
Examples in Python command line:

Try 1
-----

>>> import urllib2
urllib2.urlopen('ftp://<user>:<password>@<server>/packages/repodata').read().splitlines()

Output:
<list of files>

Try 2
-----

>>> import urllib2
urllib2.urlopen('ftp://<user>:<password>@<server>/packages/repodata').read().splitlines()

Output:
[]


If I split urllib2.urlopen().read().splitlines() statement in 2 statements (urllib2.urlopen() and read().splitlines()), I always get correct results.

import urllib2
a = urllib2.urlopen('ftp://<user>:<password>@<server>/packages/repodata')
>>> a.read().splitlines()

Output:
<file_list>


Verified in Python 2.6.6 in RHEL 6.4, Python 2.7.x in RHEL 7 and Python 2.7.3 in Ubuntu 14.04
History
Date User Action Args
2014-09-09 21:53:40alanoesetrecipients: + alanoe
2014-09-09 21:53:40alanoesetmessageid: <1410299620.11.0.341288273378.issue22376@psf.upfronthosting.co.za>
2014-09-09 21:53:40alanoelinkissue22376 messages
2014-09-09 21:53:40alanoecreate