Getting TypeError in Changing file permissions
Peter Hansen
peter at engcorp.com
Fri Jul 22 17:56:10 EDT 2005
Benjamin Niemann wrote:
> Pranav Bagora wrote:
>>" os.chmod(outfile,0700)
>>TypeError: coercing to Unicode: need string or buffer,
>>file found"
>
> Looks as if your are using a file object (that you got from an open() call)
> as the first parameter. What you need is a string with the path to the
> file.
Which this should do:
os.chmod(outfile.name, 0700)
-Peter
More information about the Python-list
mailing list