function os.lchmod() does not seem to exist
Hi, 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
Hi Wout, thanks for your email. On Sun, Feb 6, 2011 at 05:16, Wout van Albada <wout@bliepbliep.net> wrote:
Hi,
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'
this happens because POSIX doesn't require lchmod (and lchfalgs) and so Linux systems doesn't provide them. I just opened an issue[1] to discuss about how to handle documentation for these cases. [1] http://bugs.python.org/issue11233 Cheers, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi
participants (2)
-
Sandro Tosi
-
Wout van Albada