ImageImage

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.lchmod is not present
Type: behavior Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: barneygale, bluegeek, georg.brandl, loewis, pitrou, r.david.murray
Priority: normal Keywords:

Created on 2009-12-11 12:33 by bluegeek, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18864 merged barneygale, 2020-03-09 00:05
Messages (9)
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) * (Python committer) Date: 2009-12-11 13:06
lchmod seems to be a BSD-specific function.
msg96279 - (view) Author: Martin v. Löwis (loewis) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) Date: 2009-12-19 18:16
Added such a note in r76891.
History
Date User Action Args
2022-04-11 14:56:55adminsetgithub: 51728
2020-03-09 00:05:01barneygalesetnosy: + barneygale

pull_requests: + pull_request18222
2009-12-19 18:16:37georg.brandlsetstatus: open -> closed
resolution: not a bug -> fixed
messages: + msg96633
2009-12-12 22:57:33bluegeeksetmessages: + msg96309
2009-12-12 17:56:41pitrousetmessages: + msg96299
2009-12-12 10:07:25loewissetmessages: + msg96289
2009-12-12 09:45:50georg.brandlsetstatus: closed -> open

messages: + msg96288
2009-12-12 03:15:24r.david.murraysetnosy: + r.david.murray
messages: + msg96280
2009-12-11 23:14:18loewissetstatus: open -> closed

nosy: + loewis
messages: + msg96279

resolution: not a bug
2009-12-11 13:06:29pitrousetnosy: + pitrou
messages: + msg96252
2009-12-11 12:33:38bluegeekcreate