[Tutor] FTP Errors

John Weller john at johnweller.co.uk
Thu Jul 2 11:47:57 EDT 2020


>
> >     except ftplib.all_errors as err:
> 
> Study the traceback carfully: the line above is the problem.
> You probably wrote
> 
> from ftplib import FTP
> 

You were quite right!!

> In both cases the name ftplib is not available to your module. To fix this you can
> add the line
> 
> import ftplib
> 
> I recommend that for consistency you also change
> 
> >         ftp = FTP(data.ftp_host)     # connect to host, default port
> 
> to
> 
>           ftp = ftplib.FTP(data.ftp_host)


Changed.

> and remove the from ... import.
> 
Not quite sure what this means?

Many thanks Peter.

John

John Weller
01380 723235
07976 393631



More information about the Tutor mailing list