Commit Graph

13166 Commits

Author SHA1 Message Date
Skip Montanaro 00d7109075
Normalize heading underline in multiprocessing.rst (#114923)
This gets rid of the mildly confusing `>>>>>>>' underlines which look vaguely like `diff` punctuation.
2024-02-02 17:56:00 -08:00
Terry Jan Reedy 1183f1e6bf
gh-114913: Add newline to subprocess doc (#114941)
*creationflags* is a separate topic from *startupinfo*.
Start sentence with 'If given', like previous sentence.
2024-02-02 23:14:32 +00:00
John Belmonte 73d20cafb5
Correct timedelta description (GH-101417)
It only represents the difference between two datetime or
date objects, not between two time objects.
2024-02-02 23:42:17 +02:00
Serhiy Storchaka b27812d632
Fix indentation of "versionchanged" in datetime.rst (GH-114933) 2024-02-02 23:09:16 +02:00
Serhiy Storchaka c12240ed28
gh-114728: Fix documentation for comparison of objects in datetime module (GH-114749) 2024-02-02 20:53:24 +02:00
Steven Ward ee66c33349
gh-114909: Add --first-weekday option to usage message (#114910) 2024-02-02 17:13:00 +02:00
Justin Williams d29f57f603
gh-103360: Add link in stdtypes.rst to escape sequences in lexical_analysis.rst (GH-103638) 2024-02-02 15:32:46 +02:00
Michal Kaptur 53339a0ef7
Move "format" param doc of shutil.make_archive() on its own paragraph (GH-103829) 2024-02-02 10:00:18 +00:00
Oleg Iarygin 500ede0117
gh-89891: Refer SharedMemory implementation as POSIX (GH-104678)
It only uses POSIX API.
2024-02-01 19:57:36 +00:00
Nikita Sobolev dc01b919c7
gh-101100: Fix sphinx warnings in `howto/logging.rst` (#114846)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-01 20:37:55 +02:00
Skip Montanaro c9c6e04380
Correct description of inheriting from another class (#114660)
"inherits <someclass>" grates to this reader. I think it should be "inherits from <someclass>".
2024-02-01 10:07:16 -08:00
Nicholas Hollander e9dab65638
gh-105031: Clarify datetime documentation for ISO8601 (GH-105049) 2024-02-01 17:24:15 +00:00
Christophe Nanteuil de6f97cd35
Fix typos in ElementTree documentation (GH-108848)
PI objects instead of comment objects.
2024-02-01 11:34:04 +02:00
Skip Montanaro 586057e9f8
gh-67230: Add versionadded notes for QUOTE_NOTNULL and QUOTE_STRINGS (#114816)
As @GPHemsley pointed out, #29469 omitted `versionadded` notes for the 2 new items.
2024-01-31 22:11:16 -05:00
Pradyot Ranjan ff8939e5ab
gh-114811: Change '\*' to '*' in warnings.rst (#114819)
Regression in 3.12.
2024-01-31 20:48:39 -05:00
Aidan Holm a79a27242f
gh-111112: Avoid potential confusion in TCP server example. (#111113)
Improve misleading TCP server docs and example.

socket.recv(), as documented by the Python reference documentation,
returns at most `bufsize` bytes, and the underlying TCP protocol means
there is no guaranteed correspondence between what is sent by the client
and what is received by the server.

This conflation could mislead readers into thinking that TCP is
datagram-based or has similar semantics, which will likely appear to
work for simple cases, but introduce difficult to reproduce bugs.
2024-01-31 16:42:38 -08:00
Bradley Reynolds 1836f674c0
Add note to `sys.orig_argv` clarifying the difference from `sys.argv` (#114630)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-01-31 13:33:28 -08:00
Skip Montanaro 7a93db4425
gh-101100: Fix class reference in library/test.rst (GH-114769)
The text clearly seems to be referencing `TestFuncAcceptsSequencesMixin`,
for which no target is available. Name the class properly and suppress
the dangling reference.
2024-01-31 11:33:10 +02:00
Erlend E. Aasland c8cf5d7d14
Docs: mark up dbm.gnu.open() and dbm.ndbm.open() using param list (#114762) 2024-01-31 07:59:34 +01:00
Skip Montanaro 3911b42cc0
gh-101100: Fix references in csv docs (GH-114658)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-30 21:54:37 +00:00
Barney Gale fda7445ca5
GH-70303: Make `pathlib.Path.glob('**')` return both files and directories (#114684)
Return files and directories from `pathlib.Path.glob()` if the pattern ends
with `**`. This is more compatible with `PurePath.full_match()` and with
other glob implementations such as bash and `glob.glob()`. Users can add a
trailing slash to match only directories.

In my previous patch I added a `FutureWarning` with the intention of fixing
this in Python 3.15. Upon further reflection I think this was an
unnecessarily cautious remedy to a clear bug.
2024-01-30 19:52:53 +00:00
Steven Ward 2c089b09ac
gh-112240: Add option to calendar module CLI to specify the weekday to start each week (GH-112241) 2024-01-29 16:58:21 +00:00
Serhiy Storchaka 39c766b579
Fix more references to datetime and time classes (GH-114717)
They could be confused with references to datetime and time modules.
2024-01-29 18:20:13 +02:00
Soumendra Ganguly e351ca3c20
gh-85984: Add POSIX pseudo-terminal functions. (GH-102413)
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-01-29 16:10:28 +00:00
Skip Montanaro e8b8f5e9c2
gh-101100: Fix datetime reference warnings (GH-114661)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-29 16:43:44 +02:00
Shantanu 3b86891fd6
gh-110893: Improve the documentation for __future__ module (#114642)
nedbat took issue with the phrasing "real module". I'm actually fine
with that phrasing, but I do think the `__future__` page should be clear
about the way in which the `__future__` module is special. (Yes, there
was a footnote linking to the future statements part of the reference,
but there should be upfront discussion).

I'm sympathetic to nedbat's claim that no one really cares about
`__future__._Feature`, so I've moved the interesting table up to the
top.
2024-01-29 01:37:28 -08:00
Stanley d7d0d13cd3
gh-89159: Add some TarFile attribute types (GH-114520)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2024-01-29 09:19:22 +00:00
Bhushan Mohanraj d00fbed68f
Fix indentation in `__post_init__` documentation. (gh-114666) 2024-01-28 15:10:32 -05:00
Skip Montanaro 5ecfd750b4
Correction Skip Montanaro's email address (#114677) 2024-01-28 14:51:25 +00:00
Nikita Sobolev 6a8944acb6
gh-101100: Fix sphinx warnings in `library/email.mime.rst` (GH-114635) 2024-01-27 10:45:40 +02:00
Barney Gale 7e31d6dea2
gh-88569: add `ntpath.isreserved()` (#95486)
Add `ntpath.isreserved()`, which identifies reserved pathnames such as "NUL", "AUX" and "CON".

Deprecate `pathlib.PurePath.is_reserved()`.

---------

Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2024-01-26 18:14:24 +00:00
Erlend E. Aasland 6c2b419fb9
Docs: rework the dbm.dumb introduction (#114550)
- consistently use correct parameter markup
- consistently use submodule name as database name
- improve accuracy of the dbm.dumb.open() spec
- remove dumbdbm class refs and replace them with generic "database object"
- use parameter list for dbm.dumb.open()
2024-01-26 19:12:48 +01:00
Erlend E. Aasland 0bd8297a22
Docs: mark up dbm.open() with param list (#114601)
Also consolidate following paragraphs regarding database objects.
2024-01-26 16:11:45 +01:00
Ned Batchelder 30b7b4f73c
Docs: 'still' is a better word than 'nonetheless' (#114598) 2024-01-26 13:42:49 +00:00
Erlend E. Aasland 8710faeac2
Docs: fix versionchanged directives for dbm.open() and dbm.whichdb() (#114594) 2024-01-26 12:36:37 +00:00
Erlend E. Aasland 4cf068ed08
Docs: reword dbm.ndbm introduction (#114549)
- add abbreviation directives for NDBM and GDBM
- consistently spell NDBM as NDBM
- silence broken ndbm class refs
- improve accuracy of dbm.ndbm.open() spec
- use replacement text for NDBM/GDBM file format incompatibility note
2024-01-26 13:35:56 +01:00
Erlend E. Aasland 65cf5dce11
Docs: rework dbm introduction (#114551)
- add refs to other parts of the docs (dict, bytes, etc.)
- clarify whichdb() return value by using list markup
- silence refs to example or generic submodule methods (keys, get, etc.)
2024-01-26 11:15:34 +01:00
Erlend E. Aasland 06c5de36f2
Docs: reword dbm.gnu introduction (#114548)
Also...
- consistently spell GDBM as GDBM
- silence gdbm class refs
- improve accuracy of dbm.gdbm.open() spec
2024-01-26 11:05:08 +01:00
Barney Gale b69548a0f5
GH-73435: Add `pathlib.PurePath.full_match()` (#114350)
In 49f90ba we added support for the recursive wildcard `**` in
`pathlib.PurePath.match()`. This should allow arbitrary prefix and suffix
matching, like `p.match('foo/**')` or `p.match('**/foo')`, but there's a
problem: for relative patterns only, `match()` implicitly inserts a `**`
token on the left hand side, causing all patterns to match from the right.
As a result, it's impossible to match relative patterns from the left:
`PurePath('foo/bar').match('bar/**')` is true!

This commit reverts the changes to `match()`, and instead adds a new
`full_match()` method that:

- Allows empty patterns
- Supports the recursive wildcard `**`
- Matches the *entire* path when given a relative pattern
2024-01-26 01:12:46 +00:00
Nikita Sobolev d96358ff9d
gh-114315: Make `threading.Lock` a real class, not a factory function (#114479)
`threading.Lock` is now the underlying class and is constructable rather than the old
factory function. This allows for type annotations to refer to it which had no non-ugly
way to be expressed prior to this.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-01-25 19:46:32 +00:00
Ned Batchelder 07ef63fb6a
Doc/library/sys.monitoring.rst: remove contradictory paragraph. (GH-113619) 2024-01-25 14:38:43 +00:00
plokmijnuhby 6888cccac0
gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745) 2024-01-24 21:58:34 +02:00
Mark Shannon 981d172f7f
GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)
* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
2024-01-24 15:10:17 +00:00
Erlend E. Aasland 6fadd68da5
Docs: mark up the FTP_TLS() docs with param list (#114510)
Also turn sentence about prot_p() into a note.
2024-01-24 16:06:14 +01:00
Thomas Grainger 127a497852
gh-104360: remove reference to removed module-level wrap_socket (GH-104361)
* remove reference to removed module-level wrap_socket
* drive by typo fix
2024-01-24 15:24:00 +01:00
Nikita Sobolev 8744ecf589
gh-101100: Fix sphinx warnings in `concurrent.futures.rst` (#114521) 2024-01-24 15:30:50 +02:00
Nikita Sobolev 1e4f00ebd8
gh-101100: Fix sphinx warnings in `asyncio-task.rst` (#114469)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-24 00:23:34 -07:00
Daniel Hollas 82cd8fee31
Fix a typo in the contextlib documentation (#114507) 2024-01-24 05:16:31 +01:00
Erlend E. Aasland 8c265408c5
Docs: use placeholders in dbm flag param docs (#114482)
Also correct the default flag param for dbm.dumb.open();
it's 'c', not 'r'.
2024-01-23 20:54:44 +01:00
Erlend E. Aasland 01105c7c4f
Docs: mark up FTP.connect() and FTP.login() with param lists (#114395)
Use rst substitutions to reduce raw text duplication.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-23 13:57:23 +00:00
Erlend E. Aasland 5277d4c7db
Docs: mark up FTP.retrbinary and FTP.storbinary with param lists (#114399)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2024-01-23 14:53:35 +01:00
Nikita Sobolev 7d21cae964
gh-101100: Fix sphinx warnings in `Doc/library/locale.rst` (#114425)
* gh-101100: Fix sphinx warnings in `Doc/library/locale.rst`

* Remove `/` from signatures
2024-01-23 13:05:27 +02:00
Barney Gale b822b85ac1
GH-105900: Fix `pathlib.Path.symlink_to(target_is_directory=...)` docs (#114035)
Clarify that *target_is_directory* only matters if the target doesn't
exist.
2024-01-23 05:30:16 +00:00
Barney Gale 32c227470a
GH-82695: Clarify `pathlib.Path.mkdir()` documentation (#114032)
Remove a double negative in the documentation of `mkdir()`'s *exist_ok*
parameter.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-23 02:31:09 +00:00
Barney Gale 3a61d24062
GH-99334: Explain that `PurePath.is_relative_to()` is purely lexical. (#114031) 2024-01-23 01:06:44 +00:00
Ville Skyttä 9af9ac153a
gh-66944: Note that the `contextlib.closing` example is for illustrative purposes (#112198)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-23 01:00:53 +00:00
Géry Ogam 647b6cc7f1
Docs: minor amendments to runpy.rst (#18416)
- Add missing single quote in inline code
- Align parameter formatting with style guide recommendations
- Fix punctuation around parenthesised sentence
2024-01-23 00:00:26 +00:00
Erlend E. Aasland 1d7bddd961
Docs: align usage of versionadded/versionchanged with recommended practice (#114409)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2024-01-22 21:40:26 +00:00
Serhiy Storchaka 1b719b39b9
gh-114321: Expose more constants in the fcntl module (GH-114322) 2024-01-22 18:09:22 +02:00
Kirill Podoprigora 6d30cbee01
Docs: Fix typo in code snippet (GH-114421) 2024-01-22 17:56:30 +02:00
Serhiy Storchaka 650f9e4c94
gh-114115: Update documentation of array.array (GH-114117)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-22 08:42:50 +00:00
Gregory P. Smith fd49e22670
gh-114328: tty cbreak mode should not alter ICRNL (#114335)
The terminal CR -> NL mapping setting should be inherited in cbreak mode as OSes do not specify altering it as part of their stty cbreak mode definition.
2024-01-21 15:25:52 -08:00
Erlend E. Aasland 336030161a
Docs: align sqlite3 docs with versionadded/versionchanged recommendations (#114400)
When a parameter is added to a function or method, use the 'versionchanged'
directive, not 'versionadded'.
2024-01-21 19:54:19 +00:00
Erlend E. Aasland de17cf444a
Docs: link to sys.stdout in ftplib docs (#114396) 2024-01-21 17:41:21 +00:00
Nikita Sobolev 38768e4cdd
gh-114384: Align sys.set_asyncgen_hooks signature in docs to reflect implementation (#114385) 2024-01-21 13:49:49 +01:00
Erlend E. Aasland 96c15b1c8d
Docs: mark up FTP() constructor with param list (#114359)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-21 12:27:33 +01:00
Erlend E. Aasland fbc28748ea
Docs: mark up the FTP debug levels as a list (#114360)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-21 09:19:31 +00:00
Erlend E. Aasland 8f4f773647
Docs: Add missing line continuation to FTP_TLS class docs (#114352)
Regression introduced by b1ad5a5d4.
2024-01-20 19:39:44 +00:00
Erlend E. Aasland b1ad5a5d44
Docs: structure the ftplib reference (#114317)
Introduce the following headings and subheadings:

- Reference
  * FTP objects
  * FTP_TLS objects
  * Module variables
2024-01-20 16:06:52 +01:00
David H. Gutteridge 567a85e9c1
gh-114332: Fix the flags reference for ``re.compile()`` (#114334)
The GH-93000 change set inadvertently caused a sentence in re.compile()
documentation to refer to details that no longer followed. Correct this
with a link to the Flags sub-subsection.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-20 11:17:41 +00:00
Barney Gale 6313cdde58
GH-79634: Accept path-like objects as pathlib glob patterns. (#114017)
Allow `os.PathLike` objects to be passed as patterns to `pathlib.Path.glob()` and `rglob()`. (It's already possible to use them in `PurePath.match()`)

While we're in the area:

- Allow empty glob patterns in `PathBase` (but not `Path`)
- Speed up globbing in `PathBase` by generating paths with trailing slashes only as a final step, rather than for every intermediate directory.
- Simplify and speed up handling of rare patterns involving both `**` and `..` segments.
2024-01-20 02:10:25 +00:00
Nikita Sobolev 9c93350f58
gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (#112109)
Co-authored-by: Brett Cannon <brett@python.org>
2024-01-18 16:58:11 +01:00
Miyashita Yosuke ba683c22ec
gh-114231: Fix indentation in enum.rst (#114232) 2024-01-18 09:23:15 +00:00
Terry Jan Reedy 8cda72037b
gh-114211: Update EmailMessage doc about ordered keys (#114224)
Ordered keys are no longer unlike 'real dict's.
2024-01-18 02:25:22 +00:00
Christophe Nanteuil 7573c44c32
Fix typo in tkinter.ttk.rst (GH-106157) 2024-01-17 18:23:25 +00:00
Terry Jan Reedy 4a32275389
gh-72284: Revise lists in IDLE doc (#114174)
Tkinter is a fact, not necessarily a feature.

Reorganize editor key bindings in a logical order
and remove those that do not work, at least on Windows.

Improve shell bindings list.
2024-01-17 07:52:32 +00:00
Erlend E. Aasland 8d26db45df
gh-112043: Align concurrent.futures.Executor.map docs with implementation (#114153)
The first parameter is named 'fn', not 'func'.
2024-01-17 01:31:16 +00:00
Steffen Zeile 05008c27b7
gh-88531 Fix dataclass __post_init__/__init__ interplay documentation (gh-107404)
* Simplify __post_init__ example usage. It applies to all base classes, not just dataclasses.
2024-01-16 20:17:34 -05:00
Barney Gale 45e527dfb5
GH-110109: pathlib docs: bring `from_uri()` and `as_uri()` together. (#110312)
This is a very soft deprecation of `PurePath.as_uri()`. We instead document
it as a `Path` method, and add a couple of sentences mentioning that it's
also available in `PurePath`.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-16 22:51:57 +00:00
Erlend E. Aasland 6e84f3b56f
gh-94220: Align fnmatch docs with the implementation and amend markup (#114152)
- Align the argument spec for fnmatch functions with the actual
  implementation.
- Update Sphinx markup to recent recommandations.
- Add link to 'iterable' glossary entry.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-16 22:35:09 +00:00
Barney Gale 7092b3f131
GH-78988: Document `pathlib.Path.glob()` exception propagation. (#114036)
We propagate the `OSError` from the `is_dir()` call on the top-level
directory, and suppress all others.
2024-01-16 22:28:54 +00:00
Erlend E. Aasland b1db6278cf
Docs: Improve multiprocessing.SharedMemory reference (#114093)
Align the multiprocessing shared memory docs with Diatáxis's
recommendations for references.

- use a parameter list for the SharedMemory.__init__() argument spec
- use the imperative mode
- use versionadded, not versionchanged, for added parameters
- reflow touched lines according to SemBr
2024-01-16 16:43:13 +00:00
Serhiy Storchaka d2d8332f71
gh-113626: Add allow_code parameter in marshal functions (GH-113648)
Passing allow_code=False prevents serialization and de-serialization of
code objects which is incompatible between Python versions.
2024-01-16 18:05:15 +02:00
Erlend E. Aasland af85274086
Docs: Align multiprocessing.shared_memory docs with Sphinx recommendations (#114103)
- add :class: and :mod: markups where needed
- fix incorrect escaping of a star in ShareableList arg spec
- mark up parameters with stars: *val*
- mark up list of built-in types using list markup
- remove unneeded parentheses from :meth: markups
2024-01-16 12:35:35 +00:00
Zackery Spytz 8fd287b18f
gh-78502: Add a trackfd parameter to mmap.mmap() (GH-25425)
If *trackfd* is False, the file descriptor specified by *fileno*
will not be duplicated.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-16 08:51:46 +01:00
Sergey B Kirpichev 4f24b92aa0
gh-114070: correct the specification of ``digit`` in the float() docs (#114080) 2024-01-15 14:19:59 -08:00
Ronald Oussoren 2010d45327
gh-113666: Adding missing UF_ and SF_ flags to module 'stat' (#113667)
Add some constants to module 'stat' that are used on macOS.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-15 12:22:43 +01:00
Hugo van Kemenade c2808431b3
gh-101100: Fix Sphinx warnings in `howto/urllib2.rst` and `library/http.client.rst` (#114060) 2024-01-14 20:38:53 +00:00
Barney Gale e4ff131e01
GH-44626, GH-105476: Fix `ntpath.isabs()` handling of part-absolute paths (#113829)
On Windows, `os.path.isabs()` now returns `False` when given a path that
starts with exactly one (back)slash. This is more compatible with other
functions in `os.path`, and with Microsoft's own documentation.

Also adjust `pathlib.PureWindowsPath.is_absolute()` to call
`ntpath.isabs()`, which corrects its handling of partial UNC/device paths
like `//foo`.

Co-authored-by: Jon Foster <jon@jon-foster.co.uk>
2024-01-13 07:36:05 +00:00
Stanley 3aa4b839e4
gh-89159: Document missing TarInfo members (#91564) 2024-01-12 23:19:57 +00:00
Pierre Equoy e97da8677f
Link to the glossary for "magic methods" in ``MagicMock`` (#111292)
The MagicMock documentation mentions magic methods several times without
actually pointing to the term in the glossary. This can be helpful for
people to fully understand what those magic methods are.
2024-01-12 22:54:36 +00:00
Gregory P. Smith b44b9d9900
gh-113971: Make `zipfile.ZipInfo._compresslevel` public as `.compress_level` (#113969)
Make zipfile.ZipInfo.compress_level public.

A property is used to retain the behavior of the ._compresslevel.

People constructing zipfile.ZipInfo instances to pass into existing APIs to control per-file compression levels already treat this as public, there was never a reason for it not to be.

I used the more modern name compress_level instead of compresslevel as the keyword argument on other ZipFile APIs is called to be consistent with compress_type and a general long term preference of not runningwordstogether without a separator in names.
2024-01-12 20:15:05 +00:00
Ronald Oussoren 79970792fd
gh-113868: Add a number of MAP_* flags from macOS to module mmap (#113869)
The new flags were extracted from the macOS 14.2 SDK.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-12 16:56:18 +01:00
Raymond Hettinger 53d2e1f26c
Improve kde graph with better caption and number formatting (gh-113967) 2024-01-11 18:25:18 -06:00
Adam Turner c9b8a22f34
GH-107678: Improve Unicode handling clarity in ``library/re.rst`` (#107679) 2024-01-11 23:56:10 +00:00
Zackery Spytz b4d4aa9e8d
gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-11 22:39:47 +00:00
Raymond Hettinger 2f126a70f3
Update KDE recipe to match the standard use of the h parameter (gh-#113958) 2024-01-11 16:21:21 -06:00
AN Long ec23e90082
gh-112419: Document removal of sys.meta_path's 'find_module' fallback (#112421)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-11 09:43:35 +00:00
Victor Stinner 1d75fa43a2
gh-77046: os.pipe() sets _O_NOINHERIT flag on fds (#113817)
On Windows, set _O_NOINHERIT flag on file descriptors
created by os.pipe() and io.WindowsConsoleIO.

Add test_pipe_spawnl() to test_os.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2024-01-10 23:02:17 +01:00
Serhiy Storchaka 89cee94b31
gh-89850: Add default C implementations of persistent_id() and persistent_load() (GH-113579)
Previously the C implementation of pickle.Pickler and pickle.Unpickler
classes did not have such methods and they could only be used if
they were overloaded in subclasses or set as instance attributes.

Fixed calling super().persistent_id() and super().persistent_load() in
subclasses of the C implementation of pickle.Pickler and pickle.Unpickler
classes. It no longer causes an infinite recursion.
2024-01-10 15:30:37 +02:00
Serhiy Storchaka a8629816c6
gh-113664: Improve style of Big O notation (GH-113695)
Use cursive to make it looking like mathematic formulas.
2024-01-10 15:01:18 +02:00
Stefano Rivera 3a9096c337
GH-113661: unittest runner: Don't exit 5 if tests were skipped (#113856)
The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
2024-01-09 19:50:01 +00:00
Raymond Hettinger 2fd2e74793
Simplify binomial approximation example with random.binomialvariate() (gh-113871) 2024-01-09 13:02:07 -06:00
William Andrea f3d5d4aa8f
Docs: Link tokens in the format string grammars (#108184)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-01-09 02:47:59 +00:00
Ronald Oussoren c6ca562138
gh-113791: Expose CLOCK_MONOTONIC_RAW_APPROX and CLOCK_UPTIME_RAW_APROX on macOS in the time module (#113792) 2024-01-08 20:44:00 +01:00
Raymond Hettinger aef375f56e
Minor algebraic simplification for the totient() recipe (gh-113822) 2024-01-08 13:16:22 -06:00
Erlend E. Aasland 35fa13d48b
gh-113755: Fully adapt gcmodule.c to Argument Clinic (#113756)
Adapt the following functions to Argument Clinic:

- gc.set_threshold
- gc.get_referrers
- gc.get_referents
2024-01-08 18:32:34 +01:00
AN Long bbf214df23
gh-113537: support loads str in plistlib.loads (#113582)
Add support for loading XML plists from a string value instead of a only bytes value.
2024-01-06 10:26:59 +01:00
Serhiy Storchaka d99d871225
gh-113360: Fix the documentation of module's attribute __test__ (GH-113393)
It can only be a dict since Python 2.4.
2024-01-06 00:23:16 +02:00
Hugo van Kemenade eb53750757
gh-101100: Fix Sphinx warnings in `library/pyclbr.rst` (#113739)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-01-05 19:15:07 +00:00
Hugo van Kemenade e56c53334f
gh-101100: Fix Sphinx warnings for 2.6 deprecations and removals (#113725)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-01-05 13:31:28 +00:00
Alex Waygood f1f8392432
Document the `co_lines` method on code objects (#113682)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-01-03 19:29:24 +00:00
Rodrigo Girão Serrão 4de468cce1
`functools.partial` docs: Use the more common spelling for "referenceable" (#113675) 2024-01-03 12:50:44 +00:00
AN Long b4b2cc1012
gh-53502: add a new option aware_datetime in plistlib to loads or dumps aware datetime. (#113363)
* add options to loads and dumps aware datetime in plistlib
2024-01-01 19:51:24 +01:00
Ronald Oussoren d0b0e3d2ef
gh-113536: Expose `os.waitid` on macOS (#113542)
* gh-113536: Expose `os.waitid` on macOS

This API has been available on macOS for a long time, but was
explicitly excluded due to unspecified problems with the API
in ancient versions of macOS.

* Document that the API is available on macOS starting in Python 3.13
2024-01-01 19:38:29 +01:00
Hugo van Kemenade 30a6d79fb8
gh-101100: Fix Sphinx warnings in `library/configparser.rst` (#113598)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-31 10:57:33 -07:00
Delgan 471aa75241
Update ConfigParser docs defining valid section name (#110506) 2023-12-30 16:18:06 -07:00
Ronald Oussoren f48a1bcb29
gh-89414: Document that SIGCLD is not available on macOS (#113580)
Document that SIGCLD is not available on macOS
2023-12-30 16:19:47 +01:00
John Hawkinson db1c882239
Doc/library/os.rst: `os.waitid` absent on MacOS (#104558)
* Doc/library/os.rst: `os.waitid` absent on MacOS

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2023-12-28 20:36:20 +01:00
Hugo van Kemenade 8e5d70f4b6
gh-101100: Fix Sphinx warnings in library/random.rst (#112981)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-28 12:29:12 -07:00
Inada Naoki bfee2f77e1
gh-73427: deprecate `_enablelegacywindowsfsencoding` (#107729) 2023-12-28 17:31:19 +09:00
Stanley 0651936ae2
gh-67641: Clarify documentation on bytes vs text with non-seeking tarfile stream (GH-31610) 2023-12-27 17:16:36 +00:00
Hugo van Kemenade 4acf825058
gh-101100: Fix Sphinx warnings in `library/cmd.rst` (#113502)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-27 12:17:30 +02:00
Hugo van Kemenade fb02b66960
gh-101100: Fix Sphinx warnings in `library/calendar.rst` (#113500) 2023-12-27 09:36:17 +00:00
Hugo van Kemenade 2b53c767de
gh-101100: Fix Sphinx warnings in `library/bisect.rst` (#113496) 2023-12-26 14:12:15 -07:00
Serhiy Storchaka e87cadc1ce
gh-66515: mailbox.MH now supports folders withou the ".mh_sequences" file (GH-804)
(for example Claws Mail IMAP-cache folders).
2023-12-26 11:15:14 +02:00
Raymond Hettinger b5dc0f83ad
Misc minor improvements to the itertools recipes (gh-113477) 2023-12-25 16:26:04 -06:00
Zackery Spytz 3f5eb3e6c7
bpo-21360: mailbox.Maildir now ignores files with a leading dot (GH-11833)
The maildir format specification states that files with a leading dot
should be ignored.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-25 17:07:51 +02:00
denballakh f7c5a7a0f9
fix bullet-list in `LOAD_SUPER_ATTR` documentation on `dis` page (#113461) 2023-12-24 12:28:39 -08:00
Serhiy Storchaka 1f06baeabd
gh-113191: Add support of os.fchmod() on Windows (GH-113192)
Also support a file descriptor in os.chmod().
2023-12-24 10:57:11 +00:00
Ronald Oussoren 593b4d81d2
gh-74573: document that ndbm can silently corrupt databases on macOS (#113354)
* gh-74573: document that ndbm can silently corrupt databases on macOS

The system ndbm implementation on macOS has an undocumented limitation
on the size of values and can silently corrupt database files when those
are exceeded.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-12-23 13:33:34 +01:00
F-park bdc8d667ab
gh-112925: Fix error in example of `datetime.time.fromisoformat` and add doctest marker (GH-112931) 2023-12-23 12:44:27 +02:00
Yan Yanchii 4a3d2419bb
gh-113212: Improve error message & document zero-arg super inside nested functions and generator expressions (GH-113307) 2023-12-22 17:12:08 +02:00
Jason R. Coombs 2d91409c69
gh-113174: Sync with importlib_metadata 7.0 (#113175)
* Sync with importlib_metadata 7.0.0

* Add blurb

* Update docs to reflect changes.

* Link datamodel docs for object.__getitem__

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Add what's new for removed __getattr__

* Link datamodel docs for object.__getitem__

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Add exclamation point, as that seems to be used for other classes.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-21 15:04:05 -05:00
Jan Brasna 24f8ff28a3
Docs: OpenSSL wording ambiguity (#113296) 2023-12-21 00:50:25 -07:00
Kir 11ee912327
gh-113255: Clarify docs for `typing.reveal_type` (#113286)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-12-20 17:21:23 +00:00
David Greaves 22b8945d76
Fix typo in collections.abc docs example (#113310)
Calling the instance reference arg for the __next__ method, "next", seems misleading as it would normally just be "self"
2023-12-20 09:51:16 +00:00
Hugo van Kemenade 76bef3832b
gh-101100: Fix Sphinx warnings in `library/ast.rst` (#113289)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-19 15:44:57 +00:00
ryan-duve 76d757b38b
gh-113234: tomllib docs: reorder conversion table & add remaining types (GH-113236) 2023-12-19 11:29:55 +01:00
dreamflow 59f0766ae5
gh-108113: [docs] mention PyCF_OPTIMIZED_AST in ast Compiler Flags (#113241) 2023-12-18 16:14:15 +00:00
Hugo van Kemenade f428c4dafb
gh-101100: Fix Sphinx warnings in library/tarfile.rst (#113237)
Fix Sphinx warnings in library/tarfile.rst
2023-12-18 08:57:45 +02:00
Jakub Kulík 2b93f52242
gh-113117: Support posix_spawn in subprocess.Popen with close_fds=True (#113118)
Add support for `os.POSIX_SPAWN_CLOSEFROM` and
`posix_spawn_file_actions_addclosefrom_np` and have the `subprocess` module use
them when available.  This means `posix_spawn` can now be used in the default
`close_fds=True` situation on many platforms.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2023-12-17 21:34:57 +00:00
Taylor Packard 21d52995ea
gh-112890: `unittest` Test Discovery page updated "`unittest` dropped the namspace packages support" (GH-113195) 2023-12-17 13:14:21 +02:00
Jakub Kulík 48c907a15c
gh-113119 fix environment handling in subprocess.Popen when posix_spawn is used (#113120)
* Allow posix_spawn to inherit environment form parent environ variable.

With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
2023-12-17 05:19:05 +00:00
Raymond Hettinger 1583c40be9
gh-113202: Add a strict option to itertools.batched() (gh-113203) 2023-12-16 09:13:50 -06:00
Mark Dickinson fe479fb8a9
gh-67790: Support basic formatting for Fraction (#111320)
PR #100161 added fancy float-style formatting for the Fraction type,
but left us in a state where basic formatting for fractions (alignment,
fill, minimum width, thousands separators) still wasn't supported.

This PR adds that support.

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-16 10:58:31 +00:00
Terry Jan Reedy 84df3172ef
gh-113046: Revise csv.reader doc (#113207)
Clarify nature of csvfile.
2023-12-16 03:12:39 -05:00
Raymond Hettinger 40574da019
Add reshape() recipe to demonstrate a use case for batched() and chained.from_iterable() (gh-113198) 2023-12-15 18:03:44 -06:00
Akshat Khandelwal 00d2b6d1fc
gh-110746: Improve markup in ``tkinter.ttk.rst`` (#111236)
* gh-110746: Improve markup in tkinter.ttk.rst

* gh-110746: Improve markup in tkinter.ttk.rst

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-12-15 21:53:16 +01:00
Alex Waygood 1addde0c69
gh-101100: Fix various Sphinx warnings for dunder references in the `library/` directory (#113163) 2023-12-15 19:15:34 +02:00
Alex Waygood c2c4879b0a
gh-101100: Fix Sphinx nitpicks in `library/numbers.rst` (#113162) 2023-12-15 19:05:12 +02:00
Victor Stinner 4a153a1d3b
[CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (#111116)
Detect email address parsing errors and return empty tuple to
indicate the parsing error (old API). Add an optional 'strict'
parameter to getaddresses() and parseaddr() functions. Patch by
Thomas Dwyer.

Co-Authored-By: Thomas Dwyer <github@tomd.tel>
2023-12-15 16:10:40 +01:00
Alex Waygood 7bb00f053e
gh-101100: Fix Sphinx nitpicks in `library/rlcompleter.rst` (#113125) 2023-12-15 10:57:23 +02:00
Raymond Hettinger 5f7d7353b4
Optimize unique_justseen() recipe for a common case. (gh-113147) 2023-12-14 17:27:39 -06:00
Alex Waygood 25061f5c98
gh-101100: Cleanup `mailbox` docs (#113124) 2023-12-14 14:10:26 -07:00
Raymond Hettinger becad9a2a1
Remove itertool recipe with low pedagogical value (gh-113138) 2023-12-14 14:36:40 -06:00
Alex Waygood 006355b2a9
gh-101100: Fix Sphinx nitpicks in `library/collections.abc.rst` (#113116) 2023-12-14 19:25:55 +00:00
Raymond Hettinger 93cf7358d9
Add recipe for totient() to demonstrate unique_justseen() and factor(). (gh-113131) 2023-12-14 13:15:29 -06:00
Ronald Oussoren 22511f77c2
gh-105912: document gotcha with using os.fork on macOS (#112871)
* gh-105912: document gotcha with using os.fork on macOS

Using ``fork(2)`` on macOS when also using higher-level
system APIs in the parent proces can crash on macOS because
those system APIs are not written to handle this usage
pattern.

There's nothing we can do about this other than documenting
the problem.

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-12-14 20:14:50 +01:00
Alex Waygood d9e1b5794a
gh-101100: Fix Sphinx nitpicks in `library/traceback.rst` (#113106) 2023-12-14 14:10:35 +00:00
Serhiy Storchaka 29f7eb4859
gh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod() on Windows (GH-113049) 2023-12-14 13:28:37 +02:00
Daniel Wysocki b3c21265fa
Fixing typo in DocTestRunner docs (GH-112326) 2023-12-14 12:07:37 +02:00
Stephen Gildea 4d5d9acb22
gh-90890: Reorder mailbox.Maildir method documentation (GH-113071)
When new mailbox.Maildir methods were added for 3.13.0a2, their
documentation was added at the end of the mailbox.Maildir section
instead of grouping them with other methods Maildir adds to Mailbox.

This commit moves the new methods' documentation adjacent to
documentation for existing Maildir-specific methods, so that
the "special remarks" for common methods remains at the end.
2023-12-14 09:53:08 +02:00
Christoph Anton Mitterer f14e3d59c9
gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960)
POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-12-13 21:55:31 +02:00
Alex Waygood d05a180350
gh-101100: Improve docs on exception attributes (GH-113057)
* Improve docs on exception attributes

* thanks sphinx-lint

* fix doctests

* argh, okay, give up on doctests

* Various improvements
2023-12-13 10:59:36 -08:00
Raymond Hettinger 2111795d0c
Use match/case in grouper() recipe (gh-113059)
Use match/case in grouper() reciper
2023-12-13 12:11:52 -06:00
Irit Katriel 428c9812cb
gh-112962: in dis module, put cache information in the Instruction instead of creating fake Instructions to represent it (#113016) 2023-12-13 12:00:21 +00:00
Hugo van Kemenade 3531ea441b
gh-101100: Fix Sphinx warning in references with asterisks (#113029)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-13 09:24:55 +02:00
beavailable 3aea6c4823
gh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485) 2023-12-13 03:23:29 +00:00
Serhiy Storchaka fe9991bb67
gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000) 2023-12-12 18:31:04 +02:00
Ronald Oussoren 0d2fe6bab0
gh-87286: Add a number of LOG_* constants to syslog (#24432)
* bpo-43120: Add a number of LOG_* constants to syslog

This adds a number of syslog facilities to the syslogmodule.c.
These values are available on macOS.

* Switch contant documentation to the data directive

This fixes a CI warning and matches the pattern
used in the documentation for ``os``.

* Update Doc/library/syslog.rst


Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-12 10:25:51 +01:00
achhina a01022af23
GH-83162: Rename re.error for better clarity. (#101677)
Renamed re.error for clarity, and kept re.error for backward compatibility.
Updated idlelib files at TJR's request.
---------

Co-authored-by: Matthias Bussonnier <mbussonnier@ucmerced.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-11 15:45:08 -05:00
Alex Waygood 4c5b9c107a
gh-101100: Improve documentation on function attributes (#112933)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-11 12:00:42 +02:00
Hugo van Kemenade 7595d47722
gh-101100: Fix Sphinx warning in library/http.cookies.rst (#112908)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-10 05:53:26 -07:00
Alex Waygood 96f64a2b1b
gh-101100: Improve documentation of `TracebackType` attributes (#112884) 2023-12-09 22:43:53 +00:00
Alex Waygood 54410e6bd9
gh-101100: Fix Sphinx nitpicks in `library/tempfile.rst` (#112886)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-09 22:08:01 +00:00
Taylor Packard ed8720ace4
gh-112758: Updated pathlib documentation for PurePath.match (#112814) 2023-12-08 18:13:17 +00:00
Alex Waygood ed21d0c1f4
gh-101100: Improve documentation for attributes on instance methods (#112832) 2023-12-08 13:18:53 +00:00
Alex Waygood e4c0876033
gh-101100: Fix Sphinx nits in `library/contextlib.rst` (#112870) 2023-12-08 13:17:57 +00:00
Alex Waygood 3cdcc2edf8
gh-101100: Fix Sphinx nitpicks in `library/shelve.rst` (#112836) 2023-12-08 14:31:11 +02:00
Serhiy Storchaka 4ac1e8fb25
Add a versionchanged directive for gh-94692 (GH-112846)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-08 10:18:15 +02:00
Alex Waygood 2c3906bc4b
gh-101100: Silence Sphinx warnings when `ntpath` or `posixpath` are referenced (#112833) 2023-12-07 20:57:30 +00:00
Tian Gao 3d712a9f4c
gh-102980: Redirect output of pdb's `interact` command, add tests and improve docs (#111194) 2023-12-07 11:19:33 +00:00
Alex Waygood 3870d19d15
gh-101100: Fix Sphinx nitpicks in `library/reprlib.rst` (#112811) 2023-12-06 20:16:12 +00:00
Alex Waygood e9707d3c3d
gh-101100: Improve documentation of code object attributes (#112781) 2023-12-06 20:15:46 +00:00
Alex Waygood e3f670e137
gh-101100: Fix most Sphinx nitpicks in the glossary and `stdtypes.rst` (#112757) 2023-12-06 08:44:06 +00:00
Alex Waygood d109f637c0
gh-101100: Properly document frame object attributes (#112735) 2023-12-05 19:27:59 +00:00
Jurjen N. E. Bos c2e2df8356
Minor stylistic edit to the grouper recipe (gh112759) 2023-12-05 12:44:06 -06:00
Ethan Furman de6bca9564
gh-112328: [Enum] Make some private attributes public. (GH-112514)
* [Enum] Make some private attributes public.

- ``_EnumDict`` --> ``EnumDict``
- ``EnumDict._member_names`` --> ``EnumDict.member_names``
- ``Enum._add_alias_``
- ``Enum._add_value_alias_``

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-05 08:27:36 -08:00
Alex Waygood 2f20cafdbf
gh-101100: Fix many easily solvable Sphinx nitpicks in the datamodel docs (#112737) 2023-12-05 09:59:52 +00:00
Jeffrey Kintscher 268415bbb3
gh-81441: shutil.rmtree() FileNotFoundError race condition (GH-14064)
Ignore missing files and directories while enumerating
directory entries in shutil.rmtree().

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 09:33:51 +00:00
pan324 81ee026091
gh-82300: Add track parameter to multiprocessing.shared_memory (#110778)
Add a track parameter to shared memory to allow resource tracking via the side-launched resource tracker process to be disabled on platforms that use it (POSIX).

This allows people who do not want automated cleanup at process exit because they are using the shared memory with processes not participating in Python's resource tracking to use the shared_memory API.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-12-05 00:11:44 -08:00
Constantin Hong aa5bee30ab
gh-102130: Support tab completion in cmd for Libedit. (GH-107748)
---

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-12-05 08:24:56 +01:00
Kamil Turek a1551b48ee
gh-103363: Add follow_symlinks argument to `pathlib.Path.owner()` and `group()` (#107962) 2023-12-04 19:42:01 +00:00
Alex Waygood 9560e0d6d7
gh-101100: Fix Sphinx nitpicks in `library/abc.rst` (#112703) 2023-12-04 12:42:24 +00:00
Serhiy Storchaka c74e9fb189
gh-110275: Named tuple's __replace__() now raises TypeError for invalid arguments (GH-110299) 2023-12-04 13:30:32 +02:00
Alex Waygood cda737924f
gh-101100: Fix Sphinx nitpicks in `library/functions.rst` (#112669) 2023-12-04 11:05:20 +00:00
Serhiy Storchaka dee7beeb4f
bpo-34392: Add sys. _is_interned() (GH-8755) 2023-12-04 11:09:06 +02:00
Hugo van Kemenade 489aeac3a2
gh-101100: Fix Sphinx warning in `library/gettext.rst` (#112668)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-03 20:23:09 +00:00
Alex Waygood 45650d1c47
gh-101100: Fix most Sphinx nitpicks in `inspect.rst` (#112662) 2023-12-03 17:32:49 +00:00
Alex Waygood 4ed46d2244
Run more `inspect.rst` code snippets in CI (#112654) 2023-12-03 11:50:22 +00:00
Alex Waygood fc9e24b01f
gh-112316: improve docs for `inspect.signature` and `inspect.Signature` (#112631) 2023-12-03 01:37:34 -08:00
Nikita Sobolev a9574c68f0
gh-112139: Add `inspect.Signature.format` and use it in `pydoc` (#112143)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-12-02 15:39:43 -08:00
Nikita Sobolev a74daba7ca
gh-112316: Improve docs of `inspect.signature` and `Signature.from_callable` (#112317)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-02 13:13:44 +00:00
William Wen 939fc6d6ea
gh-106922: Support multi-line error locations in traceback (attempt 2) (#112097) 2023-12-01 22:18:16 +00:00
Tian Gao c2982380f8
gh-112510: Add `readline.backend` for the backend readline uses (GH-112511)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Donghee Na <donghee.na92@gmail.com>
2023-12-01 14:05:55 +00:00
Alperen Serkan Aksöz 730d450d43
gh-112502: Docs: Improve docs for gc.collect method (#112562)
* Docs: Improve docs for gc.collect method

* Update gc.rst
2023-11-30 21:04:00 +00:00
Jelle Zijlstra d4a6229afe
gh-104003: Implement PEP 702 (#104004)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-29 09:38:29 -08:00
Grant Ramsay e413daf5f6
gh-112454: Disable TLS-PSK if OpenSSL was built without PSK support (#112491)
If OpenSSL was built without PSK support, the python TLS-PSK
methods will raise "NotImplementedError" if called.

Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported
2023-11-28 16:15:39 -08:00
Hugo van Kemenade 3fdf7ae3d1
gh-110930: Correct book title by Alan D. Moore (#112490) 2023-11-28 16:46:00 +02:00
Irit Katriel 2c68011780
gh-112332: Deprecate TracebackException.exc_type, add exc_type_str. (#112333) 2023-11-28 08:03:25 +00:00
Alex Waygood 2e632fa07d
Docs: fix markup for `importlib.machinery.NamespaceLoader` (#112479) 2023-11-28 00:15:23 +00:00
Eugene Toder 562d7149c6
Correct documentation for AF_PACKET (#112339)
Protocol in the address tuple should *not* be in the network-byte-order, because it is converted internally[1].

[1] 89ddea4886/Modules/socketmodule.c (L2144)

network byte order doesn't make sense for a python level int anyways. It's a fixed size C serialization concept.
2023-11-27 15:42:37 -08:00
Serhiy Storchaka 4dcfd02bed
gh-68166: Add support of "vsapi" in ttk.Style.element_create() (GH-111393) 2023-11-27 20:57:33 +02:00
Jacob Walls 99a73c3465
gh-76912: Raise OSError from any failure in getpass.getuser() (#29739)
* bpo-32731: Raise OSError from any failure in getpass.getuser()
Previously, if the username was not set in certain environment variables, ImportError escaped on Windows systems, and it was possible for KeyError to escape on other systems if getpwuid() failed.
2023-11-27 10:05:55 -08:00
Adam Turner ffe1b2d07b
GH-101100: Fix reference warnings for ``socket`` methods (#110114)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 16:36:54 +02:00
Tom Levy fb79e1ed4a
Docs: fix typo in doc for sqlite3.Cursor.execute (#112442) 2023-11-27 09:27:47 +00:00
Grant Ramsay e954ac7205
gh-63284: Add support for TLS-PSK (pre-shared key) to the ssl module (#103181)
Add support for TLS-PSK (pre-shared key) to the ssl module.

---------

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-11-27 04:01:44 +00:00
Hugo van Kemenade 3faf8e586d
gh-101100: Fix Sphinx reference warnings (GH-112416)
* Fix Sphinx warning in library/xml.rst

Direct use of the pyexpat module is deprecated, but this is how to check the version for security purposes

* Fix Sphinx warning in library/importlib.resources.rst

* Use italics for parameters

* Link to the exception

* Fix Sphinx warning in library/gzip.rst

* Document message and header defect base classes to fix Sphinx warning in library/email.headerregistry.rst

* Restore feed_eof() doc to fix Sphinx warning in library/asyncio-stream.rst

* Fix Sphinx warning in extending/newtypes.rst

* Fix Sphinx warning in c-api/set.rst

On stdtypes.rst, set and frozenset are documented together and the frozenset has the working refs
2023-11-25 15:40:19 -08:00
Hugo van Kemenade 0303a9fa79
gh-101100 : Fix Sphinx warnings in `library/doctest.rst` (#112399)
* Fix Sphinx warnings in library/doctest.rst

* Don't link to self, and wrap a line

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Link to load_tests protocol

* Link to option flags

* Wrap line

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-25 20:08:32 +02:00
Hugo van Kemenade 6b961b8cea
gh-101100: Define `_tkinter` module to fix references (#112382)
Define _tkinter module to fix references
2023-11-25 08:18:02 +02:00
Hugo van Kemenade d525d01e27
gh-101100: Define `test.regrtest` module to fix references (#112381)
Define test.regrtest module to fix references
2023-11-25 08:17:31 +02:00
Irit Katriel fafae08cc7
gh-59254: mention in open() doc that line buffering is for writing (#112318) 2023-11-24 18:59:41 +01:00
Irit Katriel 10e1a0c916
gh-112137: change dis output to display labels instead of offsets (#112138) 2023-11-22 22:36:55 +00:00
Sebastian Rittau 6c47eaccfa
Fix docstring and var name of itertools recipe (#112113)
`prepend()` works with arbitrary iterables, not only iterators. In fact,
the example given uses a `list`, which is iterable, but not an iterator.
2023-11-22 07:35:36 +02:00
Tian Gao 46500c42f0
GH-111963: Clarify sys.monitoring.free_tool_id's limitations (GH-112291) 2023-11-21 14:58:30 -08:00
Junya Okabe 9d70831cb7
gh-110745: add a newline argument to pathlib.Path.read_text (#110880)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2023-11-21 22:32:38 +00:00
Alex Ptakhin 6bf8f20344
gh-110383: Fix documentation profile cumtime fix (#112221)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-19 02:56:54 -07:00
Charlie Zhao dabc0d77b2
Fix typo in documentation of `importlib.metadata` (GH-112099)
Fix minor typo in importlib doc
2023-11-17 15:11:30 -08:00
Victor Stinner 7c50800241
gh-110481, doc: Add "immortal" term to the glossary (#112180) 2023-11-17 15:09:19 +01:00
Terry Jan Reedy 8cd70eefc7
gh-112165: Fix typo in `__main__.py` (#112183)
Change '[2]' to '[1]' to get second argument.
2023-11-16 20:05:16 -05:00
Luis Pedro Coelho 81ab0e8a4a
[doc] Make subprocess.wait documentation more precise (#98700)
[doc] Make subprocess.wait doc more precise

An active loop is only used when the `timeout` parameter is used on
POSIX.

When no timeout is used, the code calls `os.waitpid` internally (which puts
the process on a sleep status). On Windows, the internal Windows API
call accepts a timeout parameter, so that is delegated to the OS.
2023-11-16 05:04:46 -08:00
Terry Jan Reedy e31d65e0b7
gh-111622: Fix doc for items views (#112051)
They are set-like even when some values are not hashable,
but work even better when all are.
2023-11-14 07:41:20 +00:00
Barney Gale d5491a6eff
GH-110417: Fix `glob` docs ordering (#110418)
Fix incorrect placement of `translate()` docs from cf67ebf.

Move "see also: pathlib" admonition to the bottom of the page, alongside one for fnmatch. This helps the module introduction flow more naturally into the function descriptions.

Add an "Examples" subheading just before the examples. This makes it more obvious that examples aren't specifically related to the preceding documentation of `escape()` and `translate()`.
2023-11-13 17:48:16 +00:00
Barney Gale cf67ebfb31
GH-72904: Add `glob.translate()` function (#106703)
Add `glob.translate()` function that converts a pathname with shell wildcards to a regular expression. The regular expression is used by pathlib to implement `match()` and `glob()`.

This function differs from `fnmatch.translate()` in that wildcards do not match path separators by default, and that a `*` pattern segment matches precisely one path segment. When *recursive* is set to true, `**` pattern segments match any number of path segments, and `**` cannot appear outside its own segment.

In pathlib, this change speeds up directory walking (because `_make_child_relpath()` does less work), makes path objects smaller (they don't need a `_lines` slot), and removes the need for some gnarly code.

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-11-13 17:15:56 +00:00
Stephen Gildea 38035fed9b
gh-90890: New methods to access mailbox.Maildir message info and flags (#103905)
New methods to access mailbox.Maildir message info and flags:
get_info, set_info, get_flags, set_flags, add_flag, remove_flag.

These methods speed up accessing a message's info and/or flags and are
useful when it is not necessary to access the message's contents,
as when iterating over a Maildir to find messages with specific flags.

---------

* Add more str type checking
* modernize to f-strings instead of %

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-11-11 17:41:33 +00:00
Łukasz Langa 3932b0f7b1
gh-110722: Make `-m test -T -j` use sys.monitoring (GH-111710)
Now all results from worker processes are aggregated and
displayed together as a summary at the end of a regrtest run.

The traditional trace is left in place for use with sequential
in-process test runs but now raises a warning that those
numbers are not precise.

`-T -j` requires `--with-pydebug` as it relies on `-Xpresite=`.
2023-11-10 18:17:45 +01:00
Zac Hatfield-Dodds d61313bdb1
gh-103791: handle `BaseExceptionGroup` in `contextlib.suppress()` (#111910) 2023-11-10 13:32:36 +00:00
Samuel Thibault 0802fd6c8e
gh-81925: Implement native thread ids for kFreeBSD (#111761)
---------

Co-authored-by: Antoine Pitrou <antoine@python.org>
2023-11-09 21:02:30 +01:00
Donghee Na 6046aec377
gh-111835: Add seekable method to mmap.mmap (gh-111852) 2023-11-09 20:13:35 +09:00
Serhiy Storchaka 005d1e8fc8
gh-68166: Tkinter: Add tests and examples for element_create() (GH-111453)
* Remove mention of "vsapi" element type from the documentation.
* Add tests for element_create() and other ttk.Style methods.
* Add examples for element_create() in the documentation.
2023-11-08 18:25:58 +02:00
Pierre Ossman (ThinLinc team) 74b868f636
gh-111246: Remove listening Unix socket on close (#111483)
Try to clean up the socket file we create so we don't add unused noise to the file system.
2023-11-08 08:10:10 -08:00
Jelle Zijlstra 8ab7ad6308
Glossary: Add "static type checker" (#111837)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-08 14:38:36 +00:00
Serhiy Storchaka 70afb8d732
gh-85098: Implement functional CLI of symtable (#109112)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-11-07 16:32:16 +00:00
方糖 c3e19c3a62
gh-111729: update generic syntax for `typing.Concatenate` sample code in `Doc/library/typing.rst` (#111734)
use new generic syntax
2023-11-06 16:53:17 -08:00
Charles Machalow ba8aa1fd37
gh-109466: Add ipv6_mapped property to IPv4Address (#109467)
Adds the `IPv4Address.ipv6_mapped` property.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-05 16:50:31 +00:00
Tian Gao 853b4b549d
gh-111719: Add extra check for alias command (#111720) 2023-11-04 23:05:22 +00:00
Nikita Sobolev ccc8caa858
gh-111681: minor fixes to typing doctests; remove unused imports in `test_typing` (#111682)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-03 12:23:33 +00:00
Irit Katriel d49aba5a7a
gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state (#111648) 2023-11-03 10:01:36 +00:00
Terry Jan Reedy 0d3df272fb
gh-54434: Make difflib.rst doctests pass. (#111677) 2023-11-03 02:20:39 -04:00