[Python-checkins] bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (GH-4797) (#4869)

Serhiy Storchaka webhook-mailer at python.org
Thu Dec 14 12:30:53 EST 2017


https://github.com/python/cpython/commit/d1cb1067a82b11280204e36b695e786a5a3ca221
commit: d1cb1067a82b11280204e36b695e786a5a3ca221
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2017-12-14T19:30:45+02:00
summary:

bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (GH-4797) (#4869)

(cherry picked from commit 233ef249cc5c18d796fb581747179c5e062b4083)

files:
A Misc/NEWS.d/next/Library/2017-12-11-09-53-14.bpo-32277.jkKiVC.rst
M Modules/posixmodule.c

diff --git a/Misc/NEWS.d/next/Library/2017-12-11-09-53-14.bpo-32277.jkKiVC.rst b/Misc/NEWS.d/next/Library/2017-12-11-09-53-14.bpo-32277.jkKiVC.rst
new file mode 100644
index 00000000000..765527a6553
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-12-11-09-53-14.bpo-32277.jkKiVC.rst
@@ -0,0 +1,3 @@
+Raise ``NotImplementedError`` instead of ``SystemError`` on platforms where
+``chmod(..., follow_symlinks=False)`` is not supported.  Patch by Anthony
+Sottile.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index ee27fa4dec6..821b64ccbca 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2790,6 +2790,7 @@ os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
                                                    dir_fd, follow_symlinks);
             else
                 follow_symlinks_specified("chmod", follow_symlinks);
+            return NULL;
         }
         else
 #endif



More information about the Python-checkins mailing list