STR that should be file?

j2 spamfilter2 at mupp.net
Tue Mar 25 07:40:57 EST 2003


> file is the name of a built-in type (the type of file objects).  So,
> file.write is an unbound method of the type, which needs to be called
> with an instance of the type as its first argument -- and the first
> argument you're using is 'block', a string, whence the traceback.
>
> You're using name 'file' for a local variable in the following
> function getFile (don't do that -- it's NOT a good idea to name
> your own variables with names of builtin types!), but that does
> not in the least affect function handleDownload.

I must admit i do not fully understand what all that means, but i seem to
have some  reading to do. Anyway, now the code works, and i can atleast fix
the given problem.. and THEN get around to actually learning stuff (yes,
backwards way, i know)

Thankyou so much.






More information about the Python-list mailing list