@@ -3173,6 +3173,9 @@ os.chmod
3173
3173
3174
3174
mode: int
3175
3175
Operating-system mode bitfield.
3176
+ Be careful when using number literals for *mode*. The conventional UNIX notation for
3177
+ numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
3178
+ Python.
3176
3179
3177
3180
*
3178
3181
@@ -3198,7 +3201,7 @@ dir_fd and follow_symlinks may not be implemented on your platform.
3198
3201
static PyObject *
3199
3202
os_chmod_impl (PyObject * module , path_t * path , int mode , int dir_fd ,
3200
3203
int follow_symlinks )
3201
- /*[clinic end generated code: output=5cf6a94915cc7bff input=989081551c00293b ]*/
3204
+ /*[clinic end generated code: output=5cf6a94915cc7bff input=674a14bc998de09d ]*/
3202
3205
{
3203
3206
int result ;
3204
3207
@@ -3328,7 +3331,12 @@ os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
3328
3331
os.fchmod
3329
3332
3330
3333
fd: int
3334
+ The file descriptor of the file to be modified.
3331
3335
mode: int
3336
+ Operating-system mode bitfield.
3337
+ Be careful when using number literals for *mode*. The conventional UNIX notation for
3338
+ numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
3339
+ Python.
3332
3340
3333
3341
Change the access permissions of the file given by file descriptor fd.
3334
3342
@@ -3337,7 +3345,7 @@ Equivalent to os.chmod(fd, mode).
3337
3345
3338
3346
static PyObject *
3339
3347
os_fchmod_impl (PyObject * module , int fd , int mode )
3340
- /*[clinic end generated code: output=afd9bc05b4e426b3 input=8ab11975ca01ee5b ]*/
3348
+ /*[clinic end generated code: output=afd9bc05b4e426b3 input=b5594618bbbc22df ]*/
3341
3349
{
3342
3350
int res ;
3343
3351
int async_err = 0 ;
0 commit comments