Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f4a4123

Browse files
committed
Fix old-style octal literals in the docs.
1 parent 95f5686 commit f4a4123

5 files changed

Lines changed: 27 additions & 26 deletions

File tree

Doc/distutils/apiref.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ This module provides functions for operating on directories and trees of
961961
directories.
962962

963963

964-
.. function:: mkpath(name[, mode=0777, verbose=0, dry_run=0])
964+
.. function:: mkpath(name[, mode=0o777, verbose=0, dry_run=0])
965965

966966
Create a directory and any missing ancestor directories. If the directory
967967
already exists (or if *name* is the empty string, which means the current
@@ -972,7 +972,7 @@ directories.
972972
directories actually created.
973973

974974

975-
.. function:: create_tree(base_dir, files[, mode=0777, verbose=0, dry_run=0])
975+
.. function:: create_tree(base_dir, files[, mode=0o777, verbose=0, dry_run=0])
976976

977977
Create all the empty directories under *base_dir* needed to put *files* there.
978978
*base_dir* is just the a name of a directory which doesn't necessarily exist

Doc/library/cgi.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ administrator to find the directory where CGI scripts should be installed;
385385
usually this is in a directory :file:`cgi-bin` in the server tree.
386386

387387
Make sure that your script is readable and executable by "others"; the Unix file
388-
mode should be ``0755`` octal (use ``chmod 0755 filename``). Make sure that the
388+
mode should be ``0o755`` octal (use ``chmod 0755 filename``). Make sure that the
389389
first line of the script contains ``#!`` starting in column 1 followed by the
390390
pathname of the Python interpreter, for instance::
391391

@@ -394,8 +394,8 @@ pathname of the Python interpreter, for instance::
394394
Make sure the Python interpreter exists and is executable by "others".
395395

396396
Make sure that any files your script needs to read or write are readable or
397-
writable, respectively, by "others" --- their mode should be ``0644`` for
398-
readable and ``0666`` for writable. This is because, for security reasons, the
397+
writable, respectively, by "others" --- their mode should be ``0o644`` for
398+
readable and ``0o666`` for writable. This is because, for security reasons, the
399399
HTTP server executes your script as user "nobody", without any special
400400
privileges. It can only read (write, execute) files that everybody can read
401401
(write, execute). The current directory at execution time is also different (it

Doc/library/dbm.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ supported.
242242
:exc:`error` is raised if an invalid flag is specified.
243243

244244
The optional *mode* argument is the Unix mode of the file, used only when the
245-
database has to be created. It defaults to octal ``0666``.
245+
database has to be created. It defaults to octal ``0o666``.
246246

247247
In addition to the dictionary-like methods, ``gdbm`` objects have the
248248
following methods:
@@ -334,7 +334,7 @@ to simplify building this module.
334334
+---------+-------------------------------------------+
335335

336336
The optional *mode* argument is the Unix mode of the file, used only when the
337-
database has to be created. It defaults to octal ``0666`` (and will be
337+
database has to be created. It defaults to octal ``0o666`` (and will be
338338
modified by the prevailing umask).
339339

340340

Doc/library/os.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,10 @@ by file descriptors.
490490

491491
.. function:: open(file, flags[, mode])
492492

493-
Open the file *file* and set various flags according to *flags* and possibly its
494-
mode according to *mode*. The default *mode* is ``0777`` (octal), and the
495-
current umask value is first masked out. Return the file descriptor for the
496-
newly opened file. Availability: Macintosh, Unix, Windows.
493+
Open the file *file* and set various flags according to *flags* and possibly
494+
its mode according to *mode*. The default *mode* is ``0o777`` (octal), and
495+
the current umask value is first masked out. Return the file descriptor for
496+
the newly opened file. Availability: Macintosh, Unix, Windows.
497497

498498
For a description of the flag and mode values, see the C run-time documentation;
499499
flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) are defined in
@@ -823,9 +823,9 @@ Files and Directories
823823

824824
.. function:: mkfifo(path[, mode])
825825

826-
Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The default
827-
*mode* is ``0666`` (octal). The current umask value is first masked out from
828-
the mode. Availability: Macintosh, Unix.
826+
Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The
827+
default *mode* is ``0o666`` (octal). The current umask value is first masked
828+
out from the mode. Availability: Macintosh, Unix.
829829

830830
FIFOs are pipes that can be accessed like regular files. FIFOs exist until they
831831
are deleted (for example with :func:`os.unlink`). Generally, FIFOs are used as
@@ -834,7 +834,7 @@ Files and Directories
834834
doesn't open the FIFO --- it just creates the rendezvous point.
835835

836836

837-
.. function:: mknod(filename[, mode=0600, device])
837+
.. function:: mknod(filename[, mode=0o600, device])
838838

839839
Create a filesystem node (file, device special file or named pipe) named
840840
*filename*. *mode* specifies both the permissions to use and the type of node to
@@ -865,9 +865,10 @@ Files and Directories
865865

866866
.. function:: mkdir(path[, mode])
867867

868-
Create a directory named *path* with numeric mode *mode*. The default *mode* is
869-
``0777`` (octal). On some systems, *mode* is ignored. Where it is used, the
870-
current umask value is first masked out. Availability: Macintosh, Unix, Windows.
868+
Create a directory named *path* with numeric mode *mode*. The default *mode*
869+
is ``0o777`` (octal). On some systems, *mode* is ignored. Where it is used,
870+
the current umask value is first masked out. Availability: Macintosh, Unix,
871+
Windows.
871872

872873
It is also possible to create temporary directories; see the
873874
:mod:`tempfile` module's :func:`tempfile.mkdtemp` function.
@@ -880,10 +881,10 @@ Files and Directories
880881
single: UNC paths; and os.makedirs()
881882

882883
Recursive directory creation function. Like :func:`mkdir`, but makes all
883-
intermediate-level directories needed to contain the leaf directory. Throws an
884-
:exc:`error` exception if the leaf directory already exists or cannot be
885-
created. The default *mode* is ``0777`` (octal). On some systems, *mode* is
886-
ignored. Where it is used, the current umask value is first masked out.
884+
intermediate-level directories needed to contain the leaf directory. Throws
885+
an :exc:`error` exception if the leaf directory already exists or cannot be
886+
created. The default *mode* is ``0o777`` (octal). On some systems, *mode*
887+
is ignored. Where it is used, the current umask value is first masked out.
887888

888889
.. note::
889890

Doc/library/uu.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ The :mod:`uu` module defines the following functions:
2727

2828
.. function:: encode(in_file, out_file[, name[, mode]])
2929

30-
Uuencode file *in_file* into file *out_file*. The uuencoded file will have the
31-
header specifying *name* and *mode* as the defaults for the results of decoding
32-
the file. The default defaults are taken from *in_file*, or ``'-'`` and ``0666``
33-
respectively.
30+
Uuencode file *in_file* into file *out_file*. The uuencoded file will have
31+
the header specifying *name* and *mode* as the defaults for the results of
32+
decoding the file. The default defaults are taken from *in_file*, or ``'-'``
33+
and ``0o666`` respectively.
3434

3535

3636
.. function:: decode(in_file[, out_file[, mode[, quiet]]])

0 commit comments

Comments
 (0)