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: SystemError via chmod(symlink, ..., follow_symlinks=False)
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Anthony Sottile, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-12-11 17:45 by Anthony Sottile, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4797 merged Anthony Sottile, 2017-12-11 17:54
PR 4869 merged python-dev, 2017-12-14 16:58
Messages (6)
msg308062 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2017-12-11 17:45
While investigating https://bugs.python.org/issue31940 I noticed the following is raised as `SystemError` instead of the expected `NotImplementedError`

(note: you need a platform with fchmodat but does not support nofollow)

```
touch foo
ln -s foo bar
python3.6 -c 'import os; os.chmod("bar", 0o666, follow_symlinks=False)
```

Expected: raised `NotImplementedError`
Actual: raised `SystemError`
msg308070 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-11 19:46
Does any existing test failed on such platform?
msg308072 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2017-12-11 19:51
I noticed it when I changed the test preconditions in https://github.com/python/cpython/pull/4783

I tried changing a test to trigger this (in this branch) but I found I was just implementing exactly the test in the `skip` condition which to me didn't feel like a very valuable test.

From what I can tell, the current testsuite passes on my machine before and after this change -- only with the small reproduction.
msg308319 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-14 16:57
New changeset 233ef249cc5c18d796fb581747179c5e062b4083 by Serhiy Storchaka (Anthony Sottile) in branch 'master':
bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (#4797)
https://github.com/python/cpython/commit/233ef249cc5c18d796fb581747179c5e062b4083
msg308320 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-14 17:00
I was going to request a test, but the fix is obvious and writing a test for this case can be not easy. Thank you Anthony for your report and patch.
msg308324 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-14 17:30
New changeset d1cb1067a82b11280204e36b695e786a5a3ca221 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (GH-4797) (#4869)
https://github.com/python/cpython/commit/d1cb1067a82b11280204e36b695e786a5a3ca221
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76458
2017-12-14 17:31:17serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-12-14 17:30:52serhiy.storchakasetmessages: + msg308324
2017-12-14 17:00:52serhiy.storchakasetmessages: + msg308320
2017-12-14 16:58:08python-devsetpull_requests: + pull_request4761
2017-12-14 16:57:57serhiy.storchakasetmessages: + msg308319
2017-12-11 19:51:03Anthony Sottilesetmessages: + msg308072
2017-12-11 19:46:45serhiy.storchakasettype: behavior
components: + Extension Modules
versions: - Python 3.8
2017-12-11 19:46:28serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg308070
2017-12-11 17:54:54Anthony Sottilesetkeywords: + patch
stage: patch review
pull_requests: + pull_request4696
2017-12-11 17:45:53Anthony Sottilecreate