msg96249 - (view) |
Author: steve (bluegeek) |
Date: 2009-12-11 12:33 |
Reason for opening this bug: ============================ I am opening a bug because the documentation here: http://docs.python.org/library/os.html#os.lchmod Says that in python 2.6 there is a method os.lchmod() for changing the permissions of unix symbolic links, I am running Python 2.6 on several flavors of Linux, and non of them have os.lchmod(). My understanding is that one can not change the permissions of a sybolic link on Linux because the symlink basically 'inherits' the permissions of the file if points to. Is this ment to be used on other flavors of UNIX other than Linux? I am only really familiar with Linux, and have not played with man y other flavors on UNIX. Can other flavor change the permission of symbolic links? What I am Looking for from this bug report: =========================================== I would like to know what is happening with os.lchmod. If it is not suppose to be there, I would like it removed from the documentation. If it is mena for other flavors of unix, but not linux. I think it should be implemented as just a function that passes. Let me know what you think. Peace, Steve |
|
|
msg96252 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2009-12-11 13:06 |
lchmod seems to be a BSD-specific function. |
|
|
msg96279 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2009-12-11 23:14 |
All functions in the POSIX/os module are available only on those systems that support them, and then do exactly what the system says they should do. So if your system doesn't have lchmod, the os module won't provide such a function on your system. There are systems which do provide lchmod, e.g. NetBSD 1.3 and later. Exposing this as a no-op function on systems which don't implement it would be incorrect. If you want to wrap it with a no-op function in your application, go ahead - it's easy enough. I fail to see a bug in this report, so closing it as invalid. |
|
|
msg96280 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-12-12 03:15 |
Perhaps the bug is a small documentation bug, in that it should be "Availability: BSD-based unix"? We don't seem to have any other examples of doing that in the docs, though. |
|
|
msg96288 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2009-12-12 09:45 |
I don't see why we can't start it. I'd prefer "Some Unices" though, since you never know when e.g. Linux is going to start supporting e.g. lchmod(). |
|
|
msg96289 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2009-12-12 10:07 |
If we do that, we would probably need to acknowledge that most functions in the POSIX module are available only on some Unixes - namely all that are listed in posix_methods with conditional compilation. That, in turn, would be silly for things like getcwd where probably only minority systems (e.g. embedded systems without file system) fail to support it. I think the problem of this report really originates in the unfamiliarity of the OP with Unix implementations other than Linux, rather than in a flaw of the Python documentation. |
|
|
msg96299 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2009-12-12 17:56 |
Perhaps the top-level module description should just be clearer. Right now it is not obvious that functions marked "availability: Unix" may only be available on certain Unix flavours. |
|
|
msg96309 - (view) |
Author: steve (bluegeek) |
Date: 2009-12-12 22:57 |
Thank you for you explanation of os.lchmod() Adding a note to the documentation would be very useful. I did search the internet for an answer before posting the bug, and I was only able to find forum posts of other people having the same issue. Thank you again, peace; Steve, |
|
|
msg96633 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2009-12-19 18:16 |
Added such a note in r76891. |
|
|