Skip to content

gh-107959: clarify Unix-availability of os.lchmod() #107960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

calestyo
Copy link
Contributor

@calestyo calestyo commented Aug 15, 2023

POSIX specifies that implementations are not required to support changing the file mode of symbolic links, but may do so.
Consequently, lchmod() is not part of POSIX (but mentioned for implementations which do support the above).

The current wording of the availability of os.lchmod() is rather vague and improved to clearly tell which POSIX/Unix/BSD-like support the function in general (those that support changing the file mode of symbolic links). Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.


📚 Documentation preview 📚: https://cpython-previews--107960.org.readthedocs.build/

@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Aug 15, 2023
@calestyo calestyo force-pushed the improve-lchmod-docs branch 2 times, most recently from 1bd9fff to dc0025a Compare August 15, 2023 03:02
@calestyo
Copy link
Contributor Author

Well... I guess that comes out when one has apparently no deep knowledge of rst syntax and was too lazy to install all build dependencies ^^

Any idea how one properly adds some comment to the availability?

@calestyo calestyo marked this pull request as draft August 15, 2023 03:09
@merwok
Copy link
Member

merwok commented Aug 15, 2023

Ah that’s not how the directive is designed! The value must be Unix. I think. Extra info must be added in a regular paragraph.

Process detail: please don’t use force pushes for Python PRs, it makes it harder to see changes over time, and github creates notifications with non-working links for reviewers. PRs are always squash merged in the end so there is no need to rewrite history for a PR. See https://devguide.python.org/getting-started/pull-request-lifecycle/index.html

@merwok merwok added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 15, 2023
POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

Co-authored-by: Adam Turner <[email protected]>
Signed-off-by: Christoph Anton Mitterer <[email protected]>
@calestyo calestyo force-pushed the improve-lchmod-docs branch from f3c2508 to 47a799c Compare August 15, 2023 14:21
@calestyo
Copy link
Contributor Author

Sorry for another force push... but that all became to messy to me and I had rebased my branch to main meanwhile.

The new single commit should include the suggested availability line from @AA-Turner as well as a note about the rationale behind, which I think combines the best of both and makes it easy to understand for people.

@calestyo calestyo marked this pull request as ready for review August 15, 2023 14:25
@serhiy-storchaka serhiy-storchaka merged commit f14e3d5 into python:main Dec 13, 2023
@miss-islington-app
Copy link

Thanks @calestyo for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-app
Copy link

bedevere-app bot commented Dec 13, 2023

GH-113066 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 13, 2023
…-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

(cherry picked from commit f14e3d5)

Co-authored-by: Christoph Anton Mitterer <[email protected]>
Signed-off-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Dec 13, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 13, 2023
…-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

(cherry picked from commit f14e3d5)

Co-authored-by: Christoph Anton Mitterer <[email protected]>
Signed-off-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 13, 2023

GH-113067 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 13, 2023
serhiy-storchaka pushed a commit that referenced this pull request Dec 13, 2023
…) (GH-113066)

gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

(cherry picked from commit f14e3d5)

Signed-off-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
serhiy-storchaka pushed a commit that referenced this pull request Dec 13, 2023
…) (GH-113067)

gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

(cherry picked from commit f14e3d5)

Signed-off-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@calestyo calestyo deleted the improve-lchmod-docs branch December 13, 2023 21:13
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

Signed-off-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…-107960)

POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

Signed-off-by: Christoph Anton Mitterer <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants