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: Docs error for 3.10
Type: behavior Stage:
Components: Documentation Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, eric.araujo, mdk, terry.reedy, usetohandletrush
Priority: normal Keywords:

Created on 2022-02-17 18:12 by usetohandletrush, last changed 2022-04-11 14:59 by admin.

Messages (4)
msg413425 - (view) Author: sjndlnv brjkbn (usetohandletrush) Date: 2022-02-17 18:12
Document for 3.10 version seems auto convert 0o777 to 511. And it's correct for 3.9

(May be due to new version of Sphinx? Seems source code for docs are correct.)

[img]https://i.imgur.com/ByWSJ6A.png[/img]
[img]https://i.imgur.com/rK0romC.png[/img]
[img]https://i.imgur.com/WXYMcrT.png[/img]
[img]https://i.imgur.com/W5YskgQ.png[/img]

It may misleading user. If we use os.mkdir(mode=511), it's not equal to use os.mkdir(mode=0o777)
msg413518 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-02-19 00:20
The conversions from 0o777 to 511 in 3.10 and 3.11 but not in 3.9 are these:

https://docs.python.org/3/library/pathlib.html#pathlib.Path.mkdir
  Path.mkdir(mode=511, parents=False, exist_ok=False)

https://docs.python.org/3/library/os.html#os.mkdir
  os.mkdir(path, mode=511, *, dir_fd=None)

I don't know whether different sphinx versions are used for different versions of the docs.
msg413533 - (view) Author: sjndlnv brjkbn (usetohandletrush) Date: 2022-02-19 05:31
I found out that this issue can be fixed by set ``autodoc_preserve_defaults`` to True [(From sphinx-doc)](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_preserve_defaults)

On the other hand. I test ``Path.mkdir(mode=511)`` on my mac. It's the same as ``Path.mkdir(mode=0o77)``

But it's not the same on my company's dev linux server.

I will double check this part on Monday.
msg413542 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2022-02-19 10:49
Octal 777 is really the same as decimal 511.
If you are calling mkdir and looking at the permissions on the created directory, you may think the mode is wrong because of umask (default permission bitmask that’s applied to the mode).  But the numbers are really equivalent, we are only talking about a doc presentation issue here, not any problem in code.
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 90938
2022-02-19 10:49:50eric.araujosetmessages: + msg413542
2022-02-19 05:31:11usetohandletrushsetmessages: + msg413533
2022-02-19 00:20:05terry.reedysetnosy: + eric.araujo, mdk, terry.reedy
messages: + msg413518
2022-02-17 18:12:21usetohandletrushcreate