Commit graph

370 commits

Author SHA1 Message Date
Miss Islington (bot)
26f7956f8f
[3.11] gh-116143: Fix race condition in pydoc _start_server (GH-116144) (#116416)
gh-116143: Fix race condition in pydoc _start_server (GH-116144)
(cherry picked from commit 02ee475ee3)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-03-06 15:07:08 +00:00
Kirill Podoprigora
ee3d8dcb00
[3.11] gh-107155: Fix help() for lambda function with return annotation (GH-115613)
(cherry picked from commit b9a9e3dd62)
2024-02-17 17:39:48 +02:00
Nikita Sobolev
c3a274b0fe
[3.11] gh-108303: Move all pydoc related files to test_pydoc (GH-114506) (#115501)
(cherry picked from commit ccc76c3e88)
2024-02-15 16:36:10 +03:00
Serhiy Storchaka
b9e90031a3
[3.11] [3.12] gh-97959: Fix rendering of routines in pydoc (GH-113941) (GH-115296) (GH-115302)
* Class methods no longer have "method of builtins.type instance" note.
* Corresponding notes are now added for class and unbound methods.
* Method and function aliases now have references to the module or the
  class where the origin was defined if it differs from the current.
* Bound methods are now listed in the static methods section.
* Methods of builtin classes are now supported as well as methods of
  Python classes.
(cherry picked from commit 2939ad02be)
(cherry picked from commit cfb79caaab)
2024-02-11 15:19:43 +00:00
Miss Islington (bot)
46081fe9b5
[3.11] gh-112007: Re-organize help utility intro message (GH-112017) (#112048)
gh-112007: Re-organize help utility intro message (GH-112017)

Most important: move how-to-quit sentence to the end and mention 'q'.
Re-group the other sentences and improve some wording.
---------

(cherry picked from commit b28bb130bb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-13 19:50:56 +00:00
Miss Islington (bot)
9e33586018
[3.11] gh-102541: Fix Helper.help("mod") for non-existent mod (GH-105934) (#106323)
gh-102541: Fix Helper.help("mod") for non-existent mod (GH-105934)

If the output arg to Helper() is a stream rather than the default None, which means 'page to stdout', the ImportError from pydoc.resolve is currently not caught in pydoc.doc. The same error is caught when output is None.
---------

(cherry picked from commit 0530f4f646)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-01 23:15:44 +00:00
Dong-hee Na
abeb589290
[3.11] gh-102541: Hide traceback in help prompt (gh-102614). (gh-105830)
(cherry picked from commit ba516e70c6)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-06-15 15:29:00 +00:00
Dong-hee Na
e2af980e19
[3.11] gh-98374: Suppress ImportError for invalid query for help() co… (gh-98472) 2022-10-20 11:43:21 +09:00
Miss Islington (bot)
579e985e75
gh-89828: Do not relay the __class__ attribute in GenericAlias (GH-93754)
list[int].__class__ returned type, and isinstance(list[int], type)
returned True. It caused numerous problems in code that checks
isinstance(x, type).
(cherry picked from commit f9433fff47)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-18 07:41:25 -07:00
Nikita Sobolev
cb6c6648be
bpo-46547: remove leaking vars into pydoc.Helper namespace (#30957)
Fixes #90705
2022-05-02 16:25:52 -06:00
Hugo van Kemenade
6881ea936e
bpo-47126: Update to canonical PEP URLs specified by PEP 676 (GH-32124) 2022-03-30 12:00:27 +01:00
Irit Katriel
63f32fae79
bpo-26120: do not exclude __future__ import in pydoc of the __future__ module itself (GH-32180) 2022-03-29 23:07:15 +01:00
Irit Katriel
15ba8167d7
bpo-26120: make pydoc exclude __future__ imports from the data block of the module (GH-30888) 2022-03-28 22:02:57 +01:00
Serhiy Storchaka
cd44afc573
bpo-40296: Fix supporting generic aliases in pydoc (GH-30253) 2022-03-18 11:05:18 +02:00
Christian Heimes
cb2b3c8d35
bpo-40280: Emscripten has no support for subprocesses (GH-29872)
Fixes ``platform`` and ``help()`` on emscripten.

Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2021-12-02 01:17:37 -08:00
Julien Palard
c91b6f57f3
bpo-10716: Migrating pydoc to html5. (GH-28651) 2021-10-09 09:36:50 +02:00
E-Paine
c9227df5a9
bpo-42278: Use tempfile.TemporaryDirectory rather than tempfile.mktemp in pydoc (GH-23200)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-29 13:07:51 +02:00
Gregory Anders
8868d48712
bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868) 2021-08-26 14:22:02 +02:00
Noah Kantrowitz
be42c06bb0
Update URLs in comments and metadata to use HTTPS (GH-27458) 2021-07-30 15:54:46 +02:00
Mariusz Felisiak
11749e2dc2
bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-27 00:11:55 +02:00
Inada Naoki
9dfefbe3e2
bpo-43651: Fix EncodingWarning in pydoc. (GH-25644) 2021-04-27 12:46:20 +09:00
Victor Stinner
9b999479c0
bpo-42988: Remove the pydoc getfile feature (GH-25015)
CVE-2021-3426: Remove the "getfile" feature of the pydoc module which
could be abused to read arbitrary files on the disk (directory
traversal vulnerability). Moreover, even source code of Python
modules can contain sensitive data like passwords. Vulnerability
reported by David Schwörer.
2021-03-29 14:40:40 +02:00
Julien Palard
eb9983c59b
bpo-42869: Avoid an HTTP redirection. (GH-24174) 2021-01-25 15:50:14 +01:00
Lysandros Nikolaou
bcd7deed91
bpo-40939: Remove PEG parser easter egg (__new_parser__) (#20802)
It no longer serves a purpose (there's only one parser) and having "new" in any name will eventually look odd. Also, it impinges on a potential sub-namespace, `__new_...__`.
2020-06-11 09:09:21 -07:00
Lysandros Nikolaou
9727694f08
bpo-40939: Generate keyword.py using the new parser (GH-20800) 2020-06-11 13:45:15 +01:00
Serhiy Storchaka
08b47c367a
bpo-40257: Revert changes to inspect.getdoc() (GH-20073) 2020-05-18 20:25:07 +03:00
Serhiy Storchaka
7e64414f57
bpo-40257: Improve help for the typing module (GH-19546)
* Show docstring for special forms.
* Show docstring for special generic aliases.
* Show documentation for __origin__ for generic aliases.
2020-04-18 17:13:21 +03:00
Serhiy Storchaka
fbf2786c4c
bpo-40257: Output object's own docstring in pydoc (GH-19479) 2020-04-15 23:00:20 +03:00
Victor Stinner
4fac7ed43e
bpo-21016: pydoc and trace use sysconfig (GH-18476)
bpo-21016, bpo-1294959: The pydoc and trace modules now use the
sysconfig module to get the path to the Python standard library, to
support uncommon installation path like /usr/lib64/python3.9/ on
Fedora.

Co-Authored-By: Jan Matějek <jmatejek@suse.com>
2020-02-12 13:02:29 +01:00
Kirill
61289d4366 bpo-38786: Add parsing of https links to pydoc (GH-17143) 2019-11-13 18:13:52 +02:00
Greg Price
fa3a38d81f Mark files as executable that are meant as scripts. (GH-15354)
This is the converse of GH-15353 -- in addition to plenty of
scripts in the tree that are marked with the executable bit
(and so can be directly executed), there are a few that have
a leading `#!` which could let them be executed, but it doesn't
do anything because they don't have the executable bit set.

Here's a command which finds such files and marks them.  The
first line finds files in the tree with a `#!` line *anywhere*;
the next-to-last step checks that the *first* line is actually of
that form.  In between we filter out files that already have the
bit set, and some files that are meant as fragments to be
consumed by one or another kind of preprocessor.

    $ git grep -l '^#!' \
      | grep -vxFf <( \
          git ls-files --stage \
          | perl -lane 'print $F[3] if (!/^100644/)' \
        ) \
      | grep -ve '\.in$' -e '^Doc/includes/' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          && chmod a+x "$f"; \
        done
2019-09-09 07:16:33 -07:00
Dan Rose
2a37f8f55b bpo-36045: builtins.help() now prefixes async for async functions (GH-12010)
Previously, it was hard to tell whether a function should be awaited. It was also incorrect (per PEP 484) to put this in the type hint for coroutine functions. Added this info to the output of builtins.help and pydoc.


https://bugs.python.org/issue36045
2019-05-24 04:38:01 -07:00
Cheryl Sabella
c95c93d4eb
bpo-20285: Improve help docs for object (GH-4759) 2019-05-24 06:43:29 -04:00
Raymond Hettinger
a694f23948
Add missing docstrings for TarInfo objects (#12555) 2019-03-27 13:16:34 -07:00
Raymond Hettinger
9dcc095f45
Fix line ending (GH-12531) 2019-03-25 00:23:39 -07:00
Raymond Hettinger
62be33870e
bpo-36401: Have help() show readonly properties separately (GH-12517) 2019-03-24 17:07:47 -07:00
Serhiy Storchaka
efcf82f945
bpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366) 2019-01-15 10:53:18 +02:00
Sanyam Khurana
b539cef31c bpo-35614: Fix pydoc help() on metaclasses (#11357) 2018-12-31 15:14:47 +10:00
Victor Stinner
2cf4c202ff
bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)
Replace time.time() with time.monotonic() in tests to measure time
delta.

test_zipfile64: display progress every minute (60 secs) rather than
every 5 minutes (5*60 seconds).
2018-12-17 09:36:36 +01:00
Serhiy Storchaka
a44d34e179
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Pydoc now does not duplicate docstrings for aliases of inherited methods.
2018-11-08 08:48:11 +02:00
Sanyam Khurana
a323cdcb33 bpo-8525: help() on a type now shows builtin subclasses (GH-5066)
For builtin types with builtin subclasses, help() on the type now shows up
to 4 of the subclasses. This partially replaces the exception hierarchy
information previously displayed in Python 2.7.
2018-10-21 17:22:02 +10:00
Berker Peksag
d04f46c59f
bpo-940286: Fix pydoc to show cross refs correctly (GH-8390) 2018-07-23 08:37:47 +03:00
Andrés Delfino
b2043bbe60 bpo-33422: Fix quotation marks getting deleted when looking up byte/string literals on pydoc. (GH-6701)
Also update the list of string prefixes.
2018-05-05 19:07:32 +03:00
Nick Coghlan
1a5c4bdb6e
bpo-33185: Improve wording and markup (GH-6477)
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to GH-6419)
2018-04-15 23:32:05 +10:00
Nick Coghlan
82a9481059
bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)
The pydoc CLI assumed -m pydoc would add the empty string
to sys.path, and hence got confused when it switched to
adding the full initial working directory instead.

This refactors the pydoc CLI path manipulation to be
more testable, and ensures it won't accidentally
remove the standard library directory containing
pydoc itself from sys.path.
2018-04-15 21:52:57 +10:00
oldk
e5681b9822 bpo-32440: Update the docs URL to https in help() (GH-5030)
In pydoc.py, the reference to Python' documentation was in http.
The link has been updated to use https.
2017-12-28 06:37:46 -08:00
Jelle Zijlstra
ac317700ce bpo-30406: Make async and await proper keywords (#1669)
Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
2017-10-05 23:24:46 -04:00
Feanil Patel
6a396c9807 bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)
New -n flag allow overriding localhost with custom value,
for example to run from containers.
2017-09-14 17:54:09 -04:00
Victor Stinner
4cab2cd0c0 bpo-31238: pydoc ServerThread.stop() now joins itself (#3151)
* bpo-31238: pydoc ServerThread.stop() now joins itself

ServerThread.stop() now joins itself to wait until
DocServer.serve_until_quit() completes and then explicitly sets
its docserver attribute to None to break a reference cycle.

* Add NEWS.d entry
2017-08-21 23:24:40 +02:00
Serhiy Storchaka
bdf6b910f9 bpo-29776: Use decorator syntax for properties. (#585) 2017-03-19 08:40:32 +02:00