Message226664
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 |
|
Date |
User |
Action |
Args |
2014-09-09 21:53:40 | alanoe | set | recipients:
+ alanoe |
2014-09-09 21:53:40 | alanoe | set | messageid: <1410299620.11.0.341288273378.issue22376@psf.upfronthosting.co.za> |
2014-09-09 21:53:40 | alanoe | link | issue22376 messages |
2014-09-09 21:53:40 | alanoe | create | |
|