Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls #107062

Merged
merged 9 commits into from
Jul 23, 2023

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jul 22, 2023

Disable links for C functions [mcr]alloc and free
@serhiy-storchaka
Copy link
Member

malloc, realloc and free are referred in many different files. Maybe add them in nitpick_ignore? And calloc for complete.

@erlend-aasland
Copy link
Contributor Author

malloc, realloc and free are referred in many different files. Maybe add them in nitpick_ignore? And calloc for complete.

Yes, I noticed. I'll add them, and I'll remove the _weakref since it does not belong to this PR really.

@erlend-aasland erlend-aasland changed the title Docs: Disable links for _weakref and C stdlib functions Docs: Disable links for some C stdlib functions Jul 22, 2023
@serhiy-storchaka
Copy link
Member

The most referred functions:

      3 :c:func:`!addstr`
      3 :c:func:`calloc`
      3 :c:func:`exec`
      3 :c:func:`function__entry`
      3 :c:func:`printf`
      3 :c:func:`sigaction`
      3 :c:func:`signal`
      3 :c:func:`sprintf`
      3 :c:func:`strerror`
      4 :c:func:`devpoll`
      4 :c:func:`lockf`
      4 :c:func:`main`
      4 :c:func:`snprintf`
      4 :c:func:`stat`
      4 :c:func:`system`
      4 :c:func:`vsnprintf`
      5 :c:func:`dlopen`
      5 :c:func:`fcntl`
      5 :c:func:`flock`
      5 :c:func:`!getopt`
      5 :c:func:`!scanf`
      6 :c:func:`realloc`
      8 :c:func:`select`
      9 :c:func:`poll`
     11 :c:func:`gmtime`
     11 :c:func:`localtime`
     18 :c:func:`fork`
     21 :c:func:`free`
     34 :c:func:`malloc`

Some of them, like getopt are only referred in one file.

@erlend-aasland erlend-aasland changed the title Docs: Disable links for some C stdlib functions Docs: Disable links for C standard library functions, OS utility functions and system calls Jul 22, 2023
@erlend-aasland erlend-aasland marked this pull request as ready for review July 22, 2023 19:50
@serhiy-storchaka serhiy-storchaka changed the title Docs: Disable links for C standard library functions, OS utility functions and system calls gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls Jul 23, 2023
@serhiy-storchaka serhiy-storchaka linked an issue Jul 23, 2023 that may be closed by this pull request
@serhiy-storchaka
Copy link
Member

  1. I am not sure that all functions referred at least 3 times should be added in nitpick_ignore. Many of them are only referred in one file (excluding NEWS entries). Memory management functions malloc, realloc and free are obvious candidates for inclusion. calloc can also be included besides it is only referred 3 times. gmtime and localtime are referred several times in two related modules, they also can be included. fork is referred in multiple files. poll is only referred in select.rst, but multiple times, it is questionable. Etc, etc. On other side, addstr is only mentioned in curses.rst, and in all three cases already with !. To me, it is an obvious candidate for not inclusion. function__entry is a strange thing, is it even a standard name?

  2. I did not differentiate between C, Posix and Windows types, Posix and Windows environment variables. It is tiresome to find where exactly the name is defined (and some are defined on multiple platforms), and it does not really matter. I only grouped by the role.

It is my thoughts. If you disagree, go ahead, but may be some of them can be useful to you.

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Jul 23, 2023

Thanks for your input. I think it makes sense to remove functions which are only mentioned a few times, and instead use ! to mark them up. I'll return to this later today.

@erlend-aasland erlend-aasland requested a review from a team as a code owner July 23, 2023 20:10
@erlend-aasland
Copy link
Contributor Author

Thanks for the review and insight, Serhiy. Highly appreciated!

@erlend-aasland erlend-aasland merged commit b447e19 into python:main Jul 23, 2023
17 checks passed
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@erlend-aasland erlend-aasland deleted the docs/fix-targets branch July 23, 2023 20:57
@miss-islington
Copy link
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker b447e19e720e6781025432a40eb72b1cc93ac944 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 23, 2023
…, OS utility functions and system calls (pythonGH-107062)

(cherry picked from commit b447e19)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

GH-107154 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Jul 23, 2023
erlend-aasland added a commit that referenced this pull request Jul 23, 2023
…s, OS utility functions and system calls (GH-107062) (#107154)

(cherry picked from commit b447e19)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

GH-107157 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 23, 2023
erlend-aasland added a commit that referenced this pull request Jul 23, 2023
…s, OS utility functions and system calls (#107062) (#107157)

(cherry picked from commit b447e19)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
mementum pushed a commit to mementum/cpython that referenced this pull request Jul 23, 2023
…, OS utility functions and system calls (python#107062)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
carljm added a commit to carljm/cpython that referenced this pull request Jul 24, 2023
* main: (73 commits)
  Thoroughly refactor the cases generator (python#107151)
  Docs: Add missing markup to Argument Clinic docs (python#106876)
  pythongh-107162: Document errcode.h usage in its comment (python#107177)
  pythongh-106320: Remove private _PyDict C API (python#107145)
  Fix PyVectorcall_Function doc versionadded (python#107140)
  Docs: Remove duplicate word in Argument Clinic howto heading (python#107169)
  pythongh-107017: Change Chapter Strings to Texts in the Introduction chapter. (python#107104)
  pythongh-106320: Remove private _PyObject C API (python#107159)
  Docs: fix typo in os.pwrite docstring (python#107087)
  pythongh-105291: Add link to migration guide for distutils (python#107130)
  pythongh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (python#107062)
  pythongh-106320: Remove _PyBytes_Join() C API (python#107144)
  pythongh-106320: Remove private _PyObject C API (python#107147)
  pythongh-106320: Remove _PyTuple_MaybeUntrack() C API (python#107143)
  pythongh-106320: Remove _PyIsSelectable_fd() C API (python#107142)
  Remove superflous whitespaces in `layout.html`. (pythonGH-107067)
  pythongh-107122: Update what's news for dbm.*dbm.clear() method (pythongh-107135)
  pythongh-107122: Add clear method to dbm.ndbm module (pythongh-107126)
  pythongh-62519: Make pgettext search plurals when translation is not found (python#107118)
  pythongh-107122: Add clear method to dbm.gdbm.module (pythongh-107127)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants