publicfile's ftpd and urllib2

mw at csi.hu mw at csi.hu
Tue Mar 16 22:09:37 CET 2004


Hi,

I get an error when trying to use urllib2 with the ftp daemon of
publicfile:

$ python
Python 2.2.3 (#1, Oct 15 2003, 23:33:35) 
[GCC 3.3.1 20030930 (Red Hat Linux 3.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ftplib
>>> ftplib.FTP.debugging = 1
>>> import urllib2
>>> urllib2.urlopen("ftp://moni.msci.memphis.edu/pub/fedora/linux/core/1/i386/os/headers/header.info")
*resp* '220 Features: a p .'
*cmd* 'USER anonymous'
*resp* "230 Hi. No need to log in; I'm an anonymous ftp server."
*cmd* 'CWD pub'
*resp* '250 "/pub" '
*cmd* 'CWD fedora'
*resp* '250 "/pub/fedora" '
*cmd* 'CWD linux'
*resp* '250 "/pub/fedora/linux" '
*cmd* 'CWD core'
*resp* '250 "/pub/fedora/linux/core" '
*cmd* 'CWD 1'
*resp* '250 "/pub/fedora/linux/core/1" '
*cmd* 'CWD i386'
*resp* '250 "/pub/fedora/linux/core/1/i386" '
*cmd* 'CWD os'
*resp* '250 "/pub/fedora/linux/core/1/i386/os" '
*cmd* 'CWD headers'
*resp* '250 "/pub/fedora/linux/core/1/i386/os/headers" '
*cmd* 'TYPE I'
*resp* '200 Okay, using binary.'
*cmd* 'TYPE A'
*resp* '200 Why are you using ASCII?'
*cmd* 'PASV'
*resp* '227 =141,225,11,87,234,114'
*cmd* 'NLST header.info'
*resp* '150 Waiting for transfer connection...'
*resp* '426 Transmission failure: not a directory'
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/urllib2.py", line 138, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.2/urllib2.py", line 328, in open
    '_open', req)
  File "/usr/lib/python2.2/urllib2.py", line 307, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.2/urllib2.py", line 971, in ftp_open
    fp, retrlen = fw.retrfile(file, type)
  File "/usr/lib/python2.2/urllib.py", line 734, in retrfile
    self.ftp.nlst(file)
  File "/usr/lib/python2.2/ftplib.py", line 449, in nlst
    self.retrlines(cmd, files.append)
  File "/usr/lib/python2.2/ftplib.py", line 411, in retrlines
    return self.voidresp()
  File "/usr/lib/python2.2/ftplib.py", line 222, in voidresp
    resp = self.getresp()
  File "/usr/lib/python2.2/ftplib.py", line 213, in getresp
    raise error_temp, resp
IOError: [Errno ftp error] 426 Transmission failure: not a directory

Thx for any info,

Mate
-- 
---
Mate Wierdl | Dept. of Math. Sciences | University of Memphis  
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html




More information about the Python-list mailing list