[ftputil] ftputil except problem
Stefan Schwarzer
sschwarzer at sschwarzer.net
Mon Aug 21 16:50:29 CEST 2006
Hello Vedran,
On 2006-08-20 20:59, vedran500 wrote:
> I have one strange ftputil problem,
>
> example of my program:
>
> (I was give wrong informations about ftp server,becose I want to my program "skip" error)
>
>>>> import ftp_error
>>>> import ftputil
>>>> import tkMessageBox
>>>> try:
> ftp=ftputil.FTPHost('vedran.byethost12.com','vedran at vedran.byethost12.com','veti')
> except ftp_error.PermanentError:
>
> SyntaxError: invalid syntax
unless you get a SyntaxError in one of the distributed ftputil
files, a SyntaxError should never have anything to do with
ftputil.
Possibly you have accidentically used a mixture of tab and space
characters for the indentation of your code. Always(*) use four
spaces per indentation level, never tabs. The script tabnanny may
help you to find inconsistent indentation (see
http://docs.python.org/lib/module-tabnanny.html ).
Hope that helps.
(*) unless you have to work with a project's code which is
consistently tab-indented (there are few such projects), and even
then you should use spaces in your own files which don't belong
to the "tabbed project"
Stefan
More information about the ftputil
mailing list