I tried to use the os.lchmod() function documented here: http://docs.python.org/library/os.html#os.lchmod
However, it doesn't exist in my version of Python:
wout@zoot ~ 549>python Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import os os.lchmod('blabla', 0)
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'lchmod'
So either the documentation is wrong or my version of Python is bad (in which case I have contact the distributor - Debian). But since the system chmod manual page says that permissions on symbolic links cannot be changed, I figured the function should probably not exist.
Best regards, Wout