Commit Graph

9819 Commits

Author SHA1 Message Date
Pablo Galindo de76c07a8c
bpo-37134: Add PEP570 notation to the signature of byte{array}.translate (GH-13874) 2019-06-07 00:38:41 +01:00
Pablo Galindo c4c421d619
bpo-37134: Use PEP570 syntax for sum() (GH-13851) 2019-06-06 00:11:46 +01:00
Ashwin Ramaswami c4c15ed7a2 bpo-35551: encodings update (GH-11446) 2019-06-05 18:18:06 -04:00
Pablo Galindo 54edb04aa6 bpo-37134: Add PEP570 notation to the documentation (GH-13743) 2019-06-05 13:24:28 -07:00
Victor Stinner 1e77ab0a35
bpo-33725, multiprocessing doc: rephase warning against fork on macOS (GH-13841)
Co-Authored-By: Barry Warsaw <barry@python.org>
2019-06-05 21:59:33 +02:00
Serhiy Storchaka 142566c028
[3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
Turn deprecation warnings added in 3.8 into TypeError.
2019-06-05 18:22:31 +03:00
Victor Stinner ccf0efbb21 bpo-26836: Document os.memfd_create() name parameter (GH-13838)
https://bugs.python.org/issue26836
2019-06-05 03:24:52 -07:00
Benjamin Yeh d4cf099dff Fix documentation (GH-13721)
Based on the source code 4a686504eb/Lib/multiprocessing/pool.py (L755) AsyncResult.successful() raises a ValueError, not an AssertionError.
2019-06-05 02:08:04 -07:00
Abhilash Raj 46d88a1131 bpo-35805: Add parser for Message-ID email header. (GH-13397)
* bpo-35805: Add parser for Message-ID header.

This parser is based on the definition of Identification Fields from RFC 5322
Sec 3.6.4.

This should also prevent folding of Message-ID header using RFC 2047 encoded
words and hence fix bpo-35805.

* Prevent folding of non-ascii message-id headers.
* Add fold method to MsgID token to prevent folding.
2019-06-04 10:41:34 -07:00
Mario Corchero f0b5ae4567 bpo-30699: Improve example on datetime tzinfo instances (GH-4290)
* Improve example on tzinfo instances

Move from GMTX to TZX when naming the classes, as GMT1 might be rather
confusing as seen in the reported issue.
In addition, move to UTC over GMT and improve the tzname implementation.

* Simplify datetime with tzinfo example

Move the example in the documentation to just use timezone.utc and a
user defined Kabul timezone rather than having two user defined
timezones with DST.

Kabul timezone is still interesting as it changes its offset but not
based on DST. This is more accurate as the previous example was missing
information about the fold attribute. Additionally, implementing the fold
attribute was rather complex and probably not relevant enough for the
section "datetime with tzinfo".
2019-06-04 17:18:10 +02:00
Łukasz Langa 7f9a2ae780
Revert "bpo-34037, asyncio: add BaseEventLoop.wait_executor_on_close (GH-13786)" (#13802)
This reverts commit 0f0a30f4da.
2019-06-04 13:03:20 +02:00
Raymond Hettinger 8f4bbb5d62
Fix grammar (GH-13801) 2019-06-04 03:40:23 -07:00
Raymond Hettinger 963eb0f473
bpo-35431: Drop the k <= n requirement (GH-13798) 2019-06-04 01:23:06 -07:00
Victor Stinner 0f0a30f4da
bpo-34037, asyncio: add BaseEventLoop.wait_executor_on_close (GH-13786)
Add BaseEventLoop.wait_executor_on_close attribute: true by default.

loop.close() now waits for the default executor to finish by default.
Set loop.wait_executor_on_close attribute to False to not wait for
the executor.
2019-06-03 23:31:04 +02:00
Christian Heimes 78c7d52779
bpo-37120: Add SSLContext.num_tickets (GH-13719)
Signed-off-by: Christian Heimes <christian@python.org>
2019-06-03 21:00:10 +02:00
David Carlier 0b9956e916 bpo-37087: Adding native ID support for OpenBSD (GH-13654) 2019-06-03 17:43:33 +02:00
Julien Palard 141da44bb4
Doc fix: duplicate object description of email.message (GH-13742) 2019-06-03 17:17:03 +02:00
Matthias Bussonnier 13136e83a6 bpo-36896: Clarify that some types constructors are unstable (GH-13271) 2019-06-03 02:43:21 +02:00
Xtreak 0d70227e41 Fix typos in docs and docstrings (GH-13745) 2019-06-03 01:12:33 +02:00
Michele Angrisano e1179a5096 bpo-19184: Update the documentation of dis module. (GH-13652)
* bpo-19184: Update the documentation of dis module

* Explain the behavior of the number of arguments of RAISE_VARGARGS
  opcode.

* bpo-19184: Update blurb.

* bpo-19184: Fix typo in the dis Documentation.

* bpo-19184: Address review comments and improve the doc

* bpo-19184: Remove news file.
2019-06-02 23:34:12 +02:00
Michele Angrisano aca273e240 bpo-37014: Update docstring and Documentation of fileinput.FileInput(). (GH-13545)
* bpo-37014: Update docstring and Documentation of fileinput.FileInput()

* Explain the behavior of fileinput.FileInput() when reading stdin.

* Update blurb.

* bpo-37014: Fix typo in the docstring and documentation.
2019-06-02 23:01:49 +02:00
Mark Dickinson c52996785a
bpo-36027: Extend three-argument pow to negative second argument (GH-13266) 2019-06-02 10:24:06 +01:00
Serhiy Storchaka 5ae299ac78
bpo-37128: Add math.perm(). (GH-13731) 2019-06-02 11:16:49 +03:00
Anthony Sottile b7daabd711 Improve version added references in `typing` module docs (GH-13457) 2019-06-02 01:13:25 +01:00
Raymond Hettinger b7fade4f87
Put math.comb() docs is correct place alphabetically (GH-13734) 2019-06-01 15:01:46 -07:00
Serhiy Storchaka bdbad71b9d
bpo-20092. Use __index__ in constructors of int, float and complex. (GH-13108) 2019-06-02 00:05:48 +03:00
Evan 56624a99a9 bpo-28595: Allow shlex whitespace_split with punctuation_chars (GH-2071) 2019-06-01 20:09:22 +01:00
Serhiy Storchaka 2b843ac0ae
bpo-35431: Refactor math.comb() implementation. (GH-13725)
* Fixed some bugs.
* Added support for index-likes objects.
* Improved error messages.
* Cleaned up and optimized the code.
* Added more tests.
2019-06-01 22:09:02 +03:00
Anthony Shaw 059b9ea5ac bpo-31968: Documentation -- add clarification on the globals dict for exec() (GH-13140) 2019-06-01 08:51:58 -07:00
Stéphane Wirtel 66501058fe Doc: Correct the creation year and the credits of the Logo Programming language (GH-13520) 2019-06-01 07:41:33 -04:00
Serhiy Storchaka 70c5f2ae6e
Use more PEP 570 syntax in the documentation. (GH-13720) 2019-06-01 11:38:24 +03:00
Serhiy Storchaka 2085bd0877
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
Yash Aggarwal 4a686504eb bpo-35431: Implemented math.comb (GH-11414) 2019-06-01 00:21:27 -07:00
Windson yang 5ac0b988fd bpo-18911: clarify that the minidom XML writer receives texts but not bytes (GH-13352) 2019-06-01 08:33:16 +02:00
Mario Corchero 354227a1e9 Add option to trace to run modules (GH-5134)
Adds a new option in trace that allows tracing runnable modules. It is
exposed as `--module module_name` as `-m` is already in use for another
argument.
2019-06-01 14:49:09 +10:00
Emmanuel Arias ed9f3562b6 bpo-37105: Add deprecated-remove information on stream doc (#13672)
* Add deprecated-remove information on stream doc

According to the code on streams.py the functions:
``open_connection()``, ``start_server()``, ``open_unix_connection()``,
``start_unix_server()`` are deprecated. I infor that on
documentation.
2019-05-31 23:48:57 +03:00
Cheryl Sabella a747c3a5ed
bpo-15115: Document deprecation of email.encoders in Python 3 (GH-5354) 2019-05-31 16:18:41 -04:00
Pablo Galindo aac4d0342c
bpo-26826: Expose copy_file_range in the os module (GH-7255) 2019-05-31 19:39:47 +01:00
Akshay Sharma 4612671df2 bpo-25735: math.factorial doc should mention integer return type (GH-6420) 2019-05-31 12:41:17 -04:00
Christian Heimes 8cbb5b6625
bpo-26835: Add file sealing constants to fcntl (GH-13694)
Co-authored-by: nanjekyejoannah <nanjekyejoannah@gmail.com>
2019-05-31 18:32:33 +02:00
Makdon ffed76b6fc bpo-37094: Add example for TestCase.skipTest in unittest doc (GH-13645)
Also includes other minor test skipping doc improvements.


https://bugs.python.org/issue37094
2019-05-31 09:19:11 -07:00
Christian Heimes c7f7069e77
bpo-34271: Add ssl debugging helpers (GH-10031)
The ssl module now can dump key material to a keylog file and trace TLS
protocol messages with a tracing callback. The default and stdlib
contexts also support SSLKEYLOGFILE env var.

The msg_callback and related enums are private members. The feature
is designed for internal debugging and not for end users.

Signed-off-by: Christian Heimes <christian@python.org>
2019-05-31 11:44:05 +02:00
Ivan Levkivskyi 4c23aff065
bpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)
This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in `typing_inspect` on PyPI, I propose to add these two most commonly used functions: `get_origin()` and `get_args()`. These are essentially thin public wrappers around private APIs: `__origin__` and `__args__`.

As discussed in the issue and on the typing tracker, exposing some public helpers instead of `__origin__` and `__args__` directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility.

The implementation is very simple an is essentially a copy from `typing_inspect` with one exception: `ClassVar` was special-cased in `typing_inspect`, but I think this special-casing doesn't really help and only makes things more complicated.
2019-05-31 00:10:07 +01:00
Anthony Sottile 2a58b0636d bpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686)
https://bugs.python.org/issue5028
2019-05-30 15:06:32 -07:00
Matthias Bussonnier eea47e0939 bpo-36953: Delay removal of ABCs from collections. (GH-13409)
Bump the removal to 3.9, indicate collections.abc available since 3.3,
replace version-changed directive to deprecated-removed.


https://bugs.python.org/issue36953
2019-05-30 14:45:48 -07:00
Andrew Carr 1e36f75d63 bpo-5028: fix doc bug for tokenize (GH-11683)
https://bugs.python.org/issue5028
2019-05-30 12:31:51 -07:00
Xtreak 1b69c09248 Fix audit event typo : urllib.request -> urllib.Request (GH-13550)
As per the PEP and the [audit event raised](13d4e6a4a0/Lib/urllib/request.py (L524)) in urllib.request this should be `urllib.Request`

cc: @zooba
2019-05-30 10:58:27 -07:00
Alex Grönholm 98ef92002e bpo-36999: Add asyncio.Task.get_coro() (GH-13680)
https://bugs.python.org/issue36999
2019-05-30 08:30:09 -07:00
Giampaolo Rodola 413d955f8e
bpo-36610: shutil.copyfile(): use sendfile() on Linux only (GH-13675)
...and avoid using it on Solaris as it can raise EINVAL if offset is equal or bigger than the size of the file
2019-05-30 14:05:41 +08:00
Zackery Spytz 8f96c9f8ed bpo-37007: Implement socket.if_nametoindex(), if_indextoname() and if_nameindex() on Windows (GH-13522) 2019-05-29 14:02:37 -07:00
Zackery Spytz 43fdbd2729 bpo-26836: Add os.memfd_create() (#13567)
* bpo-26836: Add os.memfd_create()

* Use the glibc wrapper for memfd_create()

Co-Authored-By: Christian Heimes <christian@python.org>

* Fix deletions caused by autoreconf.

* Use MFD_CLOEXEC as the default value for *flags*.

* Add memset_s to configure.ac.

* Revert memset_s changes.

* Apply the requested changes.

* Tweak the docs.
2019-05-29 21:57:03 +02:00
Gregory P. Smith 0c2f930564
bpo-22385: Support output separators in hex methods. (#13578)
* bpo-22385: Support output separators in hex methods.

Also in binascii.hexlify aka b2a_hex.

The underlying implementation behind all hex generation in CPython uses the
same pystrhex.c implementation.  This adds support to bytes, bytearray,
and memoryview objects.

The binascii module functions exist rather than being slated for deprecation
because they return bytes rather than requiring an intermediate step through a
str object.

This change was inspired by MicroPython which supports sep in its binascii
implementation (and does not yet support the .hex methods).

https://bugs.python.org/issue22385
2019-05-29 11:46:58 -07:00
Hrvoje Nikšić 34f4f5efea bpo-36794: Document that Lock.acquire is fair. (GH-13082)
https://bugs.python.org/issue36794
2019-05-29 10:08:17 -07:00
Bo Bayles ca80495592 bpo-22454: Add shlex.join() (the opposite of shlex.split()) (GH-7605) 2019-05-29 09:06:11 +01:00
Xtreak 0ae022c6a4 bpo-37075: Fix string concatenation in assert_has_awaits error message (GH-13616)
* Fix the implicit string concatenation in `assert_has_awaits` error message.
* Use "await" instead of "call" in `assert_awaited_with` error message.



https://bugs.python.org/issue37075
2019-05-29 00:02:25 -07:00
Victor Stinner 8b09500345
bpo-37076: _thread.start_new_thread() calls _PyErr_WriteUnraisableMsg() (GH-13617)
_thread.start_new_thread() now logs uncaught exception raised by the
function using sys.unraisablehook(), rather than sys.excepthook(), so
the hook gets access to the function which raised the exception.
2019-05-29 02:57:56 +02:00
Pablo Galindo b76302ddd0 bpo-36540: Documentation for PEP570 - Python positional only arguments (#13202)
* bpo-36540: Documentation for PEP570 - Python positional only arguments

* fixup! bpo-36540: Documentation for PEP570 - Python positional only arguments

* Update reference for compound statements

* Apply suggestions from Carol

Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>

* Update Doc/tutorial/controlflow.rst

Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>

* Add extra bullet point and minor edits
2019-05-28 16:45:32 -07:00
Serhiy Storchaka 9e3c452639
bpo-31961: Fix support of path-like executables in subprocess. (GH-5914) 2019-05-28 22:49:35 +03:00
karl ding 1b05aa2190 Fix typo in docs for socket.CAN_RAW_FD_FRAMES (GH-13635)
There is an extra "one" in the text description for the constant
socket.CAN_RAW_FD_FRAMES
2019-05-28 11:35:26 -07:00
Joannah Nanjekye 2e33ecd7c9 bpo-22640: Add silent mode to py_compile.compile() (GH-12976) 2019-05-28 19:29:04 +03:00
Victor Stinner 17a5588740
bpo-33725: multiprocessing uses spawn by default on macOS (GH-13603)
On macOS, the multiprocessing module now uses the "spawn" start
method by default.
2019-05-28 16:02:50 +02:00
Mario Corchero 04530812e9 bpo-32299: Return patched dict when using patch.dict as a context manager (GH-11062) 2019-05-28 08:53:30 -04:00
Inada Naoki 9a7e5b1b42
bpo-35279: reduce default max_workers of ThreadPoolExecutor (GH-13618) 2019-05-28 21:02:52 +09:00
Brad 293e9f86b8 Remove outdated time.monotonic reference (GH-13264)
Per ae58649, time.monotonic is always available, making the old note outdated.
2019-05-28 06:47:24 -04:00
Andrew Svetlov bafd4b5ac8 bpo-29883: Asyncio proactor udp (GH-13440)
Follow-up for #1067


https://bugs.python.org/issue29883
2019-05-28 02:52:15 -07:00
Julien Palard 9ee2c264c3
DOC: Unnecessary plural. (GH-13613) 2019-05-28 10:35:25 +02:00
Ivan Levkivskyi 74d7f76e2c
bpo-37058: PEP 544: Add Protocol to typing module (GH-13585)
I tried to get rid of the `_ProtocolMeta`, but unfortunately it didn'y work. My idea to return a generic alias from `@runtime_checkable` made runtime protocols unpickleable. I am not sure what is worse (a custom metaclass or having some classes unpickleable), so I decided to stick with the status quo (since there were no complains so far). So essentially this is a copy of the implementation in `typing_extensions` with two modifications:
* Rename `@runtime` to `@runtime_checkable` (plus corresponding updates).
* Allow protocols that extend `collections.abc.Iterable` etc.
2019-05-28 08:40:15 +01:00
Matthias Bussonnier 3880f263d2 bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) (GH-13577)
It has been documented as deprecated and to be removed in 3.8; 

From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`.


https://bugs.python.org/issue36933
2019-05-28 00:10:59 -07:00
sbstp f0d4c64019 bpo-36686: Improve the documentation of the std* params in loop.subprocess_exec (GH-13586)
https://bugs.python.org/issue36686
2019-05-27 16:51:19 -07:00
Terry Jan Reedy df9b032f47
bpo-37039: IDLE - zoomheight fixes (GH-13576)
Move doc entry to match menu and refactor zoom function.
A followup patch will include a blurb.
2019-05-27 19:16:46 -04:00
Victor Stinner cd590a7ced
bpo-1230540: Add threading.excepthook() (GH-13515)
Add a new threading.excepthook() function which handles uncaught
Thread.run() exception. It can be overridden to control how uncaught
exceptions are handled.

threading.ExceptHookArgs is not documented on purpose: it should not
be used directly.

* threading.excepthook() and threading.ExceptHookArgs.
* Add _PyErr_Display(): similar to PyErr_Display(), but accept a
  'file' parameter.
* Add _thread._excepthook(): C implementation of the exception hook
  calling _PyErr_Display().
* Add _thread._ExceptHookArgs: structseq type.
* Add threading._invoke_excepthook_wrapper() which handles the gory
  details to ensure that everything remains alive during Python
  shutdown.
* Add unit tests.
2019-05-28 00:39:52 +02:00
Zackery Spytz 02db696732 bpo-32941: Add madvise() for mmap objects (GH-6172)
Allow mmap objects to access the madvise() system call.
2019-05-27 18:48:16 +02:00
Rémi Lapeyre 674ee12600 bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481) 2019-05-27 09:43:45 -04:00
Xtreak ff6b2e66b1 bpo-37047: Refactor AsyncMock setup logic for autospeccing (GH-13574)
Handle late binding and attribute access in unittest.mock.AsyncMock
setup for autospeccing.
2019-05-27 14:56:23 +02:00
Victor Stinner 71c52e3048
bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs.
* Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call()
  and gc delete_garbage().
2019-05-27 08:57:14 +02:00
Raymond Hettinger b821868e6d
bpo-36772 Allow lru_cache to be used as decorator without making a function call (GH-13048) 2019-05-26 11:27:35 -07:00
Antoine Pitrou 91f4380ced
bpo-36785: PEP 574 implementation (GH-7076) 2019-05-26 17:10:09 +02:00
Anthony Sottile 22ccb0b490 Fix highlighting in importlib.metadata docs (GH-13575) 2019-05-26 10:30:52 -04:00
Ivan Levkivskyi 135c6a56e5
bpo-37049: PEP 589: Add TypedDict to typing module (GH-13573)
The implementation is straightforward and essentially is just copied from `typing_extensions`.
2019-05-26 09:39:24 +01:00
Ivan Levkivskyi b891c465bb
bpo-37046: PEP 586: Add Literal to typing module (#13572)
The implementation is straightforward and essentially is just copied from `typing_extensions`.
2019-05-26 09:37:48 +01:00
Ivan Levkivskyi f367242d10
bpo-37045: PEP 591: Add final qualifiers to typing module (GH-13571)
The implementation is straightforward, it just mimics `ClassVar` (since the latter is also a name/access qualifier, not really a type). Also it is essentially copied from `typing_extensions`.
2019-05-26 09:37:07 +01:00
Julien Palard 7114c6504a
Docs: FIX broken links. (GH-13491) 2019-05-25 20:02:24 +02:00
Jason R. Coombs 1bbf7b661f bpo-34632: Add importlib.metadata (GH-12547)
Add importlib.metadata module as forward port of the standalone importlib_metadata.
2019-05-24 16:59:01 -07:00
Victor Stinner 6dbbe748e1
bpo-36829: Document test.support.catch_unraisable_exception() (GH-13554)
catch_unraisable_exception() now also removes its 'unraisable'
attribute at the context manager exit.
2019-05-25 00:09:38 +02:00
Nick Sung 13d4e6a4a0 Fix typos in Doc/library/email.generator.rst documentation (GH-13539) 2019-05-24 09:50:35 -04:00
Matěj Cepl 608876b6b1 bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
2019-05-23 22:30:00 +02:00
Steve Dower b82e17e626
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
2019-05-23 08:45:22 -07:00
Jake Tesler b121f63155 bpo-36084: Add native thread ID (TID) to threading.Thread (GH-13463)
Add native thread ID (TID) to threading.Thread objects
(supported platforms: Windows, FreeBSD, Linux, macOS).
2019-05-22 17:43:16 +02:00
Paul Dagnelie 4c7a46eb3c bpo-36972: Add SupportsIndex (GH-13448)
In order to support typing checks calling hex(), oct() and bin() on user-defined classes, a SupportIndex protocol is required. The ability to check these at runtime would be good to add for completeness sake. This is pretty much just a copy of SupportsInt with the names tweaked.
2019-05-22 15:23:01 +01:00
Victor Stinner ef9d9b6312
bpo-36829: Add sys.unraisablehook() (GH-13187)
Add new sys.unraisablehook() function which can be overridden to
control how "unraisable exceptions" are handled. It is called when an
exception has occurred but there is no way for Python to handle it.
For example, when a destructor raises an exception or during garbage
collection (gc.collect()).

Changes:

* Add an internal UnraisableHookArgs type used to pass arguments to
  sys.unraisablehook.
* Add _PyErr_WriteUnraisableDefaultHook().
* The default hook now ignores exception on writing the traceback.
* test_sys now uses unittest.main() to automatically discover tests:
  remove test_main().
* Add _PyErr_Init().
* Fix PyErr_WriteUnraisable(): hold a strong reference to sys.stderr
  while using it
2019-05-22 11:28:22 +02:00
Matthias Bussonnier 565b4f1ac7 bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)
Co-Authored-By: Yury Selivanov <yury@magic.io>
2019-05-21 16:12:02 -04:00
Batuhan Taşkaya aa32a7e111 bpo-23378: Add an extend action to argparse (GH-13305)
Add an extend action to argparse


https://bugs.python.org/issue23378
2019-05-21 10:47:42 -07:00
pxinwr f2d7ac7e5b bpo-31904: Add posix module support for VxWorks (GH-12118) 2019-05-21 12:46:37 +02:00
Victor Stinner d12e75734d
Revert "bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)" (GH-13458)
This reverts commit 4959c33d25.
2019-05-21 12:44:57 +02:00
Xtreak e7cb23bf20 Fix RuntimeWarning in unittest.mock asyncio example (GH-13449)
* This PR fixes the `RuntimeWarning` in `inspect.isawaitable(mock())` where `mock()` was not awaited.
* Fix typo in asynctest project.
2019-05-21 01:47:17 -07:00
Matthias Bussonnier d0ebf13e50 bpo-36932: use proper deprecation-removed directive (GH-13349)
.. And update some deprecation warnings with version numbers.




https://bugs.python.org/issue36932
2019-05-20 23:20:10 -07:00
Andre Delfino 3099ae4075 Remove workaround for defaults in namedtuple now that we have the defaults parameter (GH-13263) 2019-05-20 20:52:17 -04:00
Cheryl Sabella 6220c02e09
bpo-35563: Add reference links to warnings.rst (GH-11289) 2019-05-20 18:45:05 -04:00
Matthias Bussonnier 1a3faf9d97 bpo-36952: Remove the bufsize parameter in fileinput.input(). (GH-13400)
This parameter is marked as deprecated since 3.6 and for removal in 3.8.
It already had no effects.
2019-05-20 23:44:11 +03:00
Thomas Moreau c09a9f56c0 bpo-36888: Add multiprocessing.parent_process() (GH-13247) 2019-05-20 21:37:05 +02:00
Lisa Roach 77b3b7701a
bpo-26467: Adds AsyncMock for asyncio Mock library support (GH-9296) 2019-05-20 09:19:53 -07:00
Geoff Shannon 522ccef869 bpo-22865: Expand on documentation for the pty.spawn function (GH-11980) 2019-05-20 17:06:16 +02:00
Terry Jan Reedy 6d965b39b7
bpo-36958: In IDLE, print exit message (GH-13435)
Print any argument other than None or int passed to SystemExit
or sys.exit().
2019-05-19 22:52:22 -04:00
Xtreak 287b84de93 bpo-34580: Update sqlite3 examples to call close() explicitly (GH-9079)
The sqlit3.Connection object doesn't call its close() method when it's used
as a context manager.
2019-05-20 00:52:20 +03:00
Boštjan Mejak 1d5bdef550 Orthographical fix (GH-13418)
Add a missing comma.
2019-05-19 02:01:36 -07:00
Jelle Zijlstra 9892f454d1 bpo-33519: clarify that .copy() is not part of the MutableSequence ABC (GH-6965) 2019-05-18 20:17:56 -04:00
Abhishek Kumar Singh 56027ccd6b bpo-19376: Added doc mentioning `datetime.strptime()` without a year fails for Feb 29. (GH-10243) 2019-05-18 16:36:19 -04:00
Raymond Hettinger e917f2ed9a
bpo-36546: Add more tests and expand docs (#13406) 2019-05-18 10:18:29 -07:00
Mark Dickinson 73934b9da0
bpo-36887: add math.isqrt (GH-13244)
* Add math.isqrt function computing the integer square root.

* Code cleanup: remove redundant comments, rename some variables.

* Tighten up code a bit more; use Py_XDECREF to simplify error handling.

* Update Modules/mathmodule.c

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>

* Update Modules/mathmodule.c

Use real argument clinic type instead of an alias

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>

* Add proof sketch

* Updates from review.

* Correct and expand documentation.

* Fix bad reference handling on error; make some variables block-local; other tidying.

* Style and consistency fixes.

* Add missing error check; don't try to DECREF a NULL a

* Simplify some error returns.

* Another two test cases:

- clarify that floats are rejected even if they happen to be
  squares of small integers
- TypeError beats ValueError for a negative float

* Documentation and markup improvements; thanks Serhiy for the suggestions!

* Cleaner Misc/NEWS entry wording.

* Clean up (with one fix) to the algorithm explanation and proof.
2019-05-18 12:29:50 +01:00
Toshio Kuratomi e7b1136ec3 Document a workaround for a curses bug (GH-13209) 2019-05-17 15:54:02 -07:00
Géry Ogam 51a860ee01 Correct typos in the Barrier specification (GH-9395) 2019-05-17 18:44:57 -04:00
Ned Batchelder 6faad355db bpo-36908: 'This module is always available' isn't helpful. (#13297)
Makes the documentation of math and cmath module
more helpful for the beginners.
2019-05-17 15:29:13 +05:30
Stéphane Wirtel cbb6484573 Doc: Replace the deprecated highlightlang directive by highlight. (#13377)
highlightlang is deprecated since April 2018 in Sphinx.
See https://github.com/sphinx-doc/sphinx/pull/4845
2019-05-17 15:25:34 +05:30
Stefan Hoelzl 245f528a92 Doc: Add link threading.settrace to sys.settrace (GH-13345) 2019-05-17 10:50:03 +02:00
Pablo Galindo aee19f54f6
bpo-36751: Undeprecate getfullargspec (GH-13245) 2019-05-16 21:08:15 +01:00
Andrew Svetlov 68b34a7204 bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)
The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is.


https://bugs.python.org/issue36921
2019-05-16 07:52:10 -07:00
Terry Jan Reedy 8a533ffb49
Fix typos in documentation. Patch by tirkarthi. (GH-13354) 2019-05-16 01:20:37 -04:00
Xtreak 9b5a0efcdc Fix typos in documentation (#13344) 2019-05-16 00:34:24 -04:00
‮zlohhcuB treboR d9e006bcef bpo-33123: pathlib: Add missing_ok parameter to Path.unlink (GH-6191)
Similarly to how several pathlib file creation functions have an "exists_ok" parameter, we should introduce "missing_ok" that makes removal functions not raise an exception when a file or directory is already absent.  IMHO, this should cover Path.unlink and Path.rmdir.  Note, Path.resolve() has a "strict" parameter since 3.6 that does the same thing. Naming this of this new parameter tries to be consistent with the "exists_ok" parameter as that is more explicit about what it does (as opposed to "strict").


https://bugs.python.org/issue33123
2019-05-15 15:02:11 -07:00
Antoine Pitrou 1a2dd82f56
bpo-36786: Run compileall in parallel during "make install" (GH-13078) 2019-05-15 23:45:18 +02:00
Jon Janzen c981ad16b0 bpo-26707: Enable plistlib to read UID keys. (GH-12153)
Plistlib currently throws an exception when asked to decode a valid
.plist file that was generated by Apple's NSKeyedArchiver. Specifically,
this is caused by a byte 0x80 (signifying a UID) not being understood.

This fixes the problem by enabling the binary plist reader and writer
to read and write plistlib.UID objects.
2019-05-15 23:14:38 +03:00
Xtreak e307e5cd06 Reference zipimport source code from docs. (GH-13310) 2019-05-15 19:18:35 +03:00
Yavor Konstantinov 133fc89ca0 bpo-36799: Fix typo in ctypes.rst (GH-13104) 2019-05-15 17:02:13 +02:00
Gregory P. Smith e883091abf
bpo-36760: Clarify subprocess capture_output docs. (GH-13322)
Clarify how to capture stdout and stderr combined into one stream.
2019-05-14 12:33:17 -07:00
wim glenn 1a10a6b980 Simplify the ``LastUpdatedOrderedDict`` example recipe (GH-13296) 2019-05-13 18:10:13 -07:00
Anders Hovmöller 8da5ebe11e bpo-35138: Added an example for timeit.timeit with callable arguments (GH-9787)
* Update timeit.rst
2019-05-13 21:27:17 +02:00
Matthias Bussonnier b6a09ae287 bpo-36895: Undocument removed time.clock (GH-13286) 2019-05-13 21:23:07 +02:00
Brad be6939fb02 Docs: Add bz2 usage examples (GH-13258)
* Docs: Add bz2 usage examples

- Adds an "Examples of usage" section inspired by the one
  found in the gzip docs
- Corrects the descriptions for ``compresslevel`` and ``data``:
    - ``compresslevel`` must be an `int`, not any number.  For
      instance, passing a float will raise ``TypeError``
    - Notes that `data` must be bytes-like
2019-05-13 11:09:49 -07:00
Pierre Glaser 50466c6650 bpo-36867: DOC update multiprocessing.rst (GH-13289)
Followup to bpo-36867.
2019-05-13 19:20:48 +02:00
Kexuan Sun 32d1458b2e Changes to the documentation of normcase (GH-4725) 2019-05-13 07:38:20 -04:00
Victor Stinner 3aef48e315
bpo-36778: Update cp65001 codec documentation (GH-13240)
Remove cp65001 from the codecs table, list it as an alias of utf_8
and add a versionchanged markup.
2019-05-13 10:42:31 +02:00
Zackery Spytz cf599f6f6f bpo-6584: Add a BadGzipFile exception to the gzip module. (GH-13022)
Co-Authored-By: Filip Gruszczyński <gruszczy@gmail.com>
Co-Authored-By: Michele Orrù <maker@tumbolandia.net>
2019-05-13 10:50:52 +03:00
Matthias Bussonnier e2500610c6 bpo-36895: remove time.clock() as per removal notice. (GH-13270)
`time.clock()` was deprecated in 3.3, and marked for removal removal in
3.8; this thus remove it from the time module.
2019-05-12 18:34:44 -07:00
Jake Tesler 4959c33d25 bpo-36084: Add native thread ID to threading.Thread objects (GH-11993) 2019-05-12 19:08:24 +02:00
Aurelio Jargas f6e17ddffd Hide module name from local (anchor) links in shutil docs (GH-6695) 2019-05-10 22:51:45 -04:00
Rémi Lapeyre fce5ff1e18 bpo-27497: Add return value to csv.DictWriter.writeheader (GH-12306)
csv.DictWriter.writeheader() now returns the return value of the
underlying csv.Writer.writerow() method.

Patch contributed by Ashish Nitin Patil.
2019-05-10 03:50:11 +02:00
Victor Stinner d267ac20c3
bpo-36778: cp65001 encoding becomes an alias to utf_8 (GH-13230) 2019-05-10 03:19:54 +02:00
Andrew Svetlov a076e4f5e4
bpo-36802: Drop awrite()/aclose(), support await write() and await close() instead (#13099) 2019-05-09 15:14:58 -04:00
Benjamin Peterson 3aca40d3cb
closes bpo-36861: Update Unicode database to 12.1.0. (GH-13214)
Adds ㋿.
2019-05-08 20:59:35 -07:00
Pierre Glaser 289f1f80ee bpo-35900: Enable custom reduction callback registration in _pickle (GH-12499)
Enable custom reduction callback registration for functions and classes in
_pickle.c, using the new Pickler's attribute ``reducer_override``.
2019-05-08 23:08:25 +02:00
Pierre Glaser 65d98d0f53 bpo-35900: Add a state_setter arg to save_reduce (GH-12588)
Allow reduction methods to return a 6-item tuple where the 6th item specifies a
custom state-setting method that's called instead of the regular
``__setstate__`` method.
2019-05-08 21:40:25 +02:00
Brian Quinlan 39889864c0 bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows (GH-13132)
Co-Authored-By: brianquinlan <brian@sweetapp.com>
2019-05-08 14:04:53 -04:00
Julien Palard 1d4b16051f
Doc: Be explicit that Pathlib resolve was strict before 3.6. (GH-11316) 2019-05-08 17:01:11 +02:00
Jason R. Coombs b2758ff955 bpo-36832: add zipfile.Path (#13153)
* bpo-36832: add zipfile.Path

* bpo-36832: add documentation for zipfile.Path

* 📜🤖 Added by blurb_it.

* Remove module reference from blurb.

* Sort the imports

* Update docstrings and docs per recommendations.

* Rely on test.support.temp_dir

* Signal that 'root' is the parameter.

* Correct spelling of 'mod'

* Convert docstring to comment for brevity.

* Fix more errors in the docs
2019-05-08 09:45:05 -04:00
Julia Iliuk 91cc01f40e bpo-11001: updated cookie docs (GH-13086)
Used **spookylukey**'s patch from 2011-01-24



https://bugs.python.org/issue11001
2019-05-07 10:05:20 -07:00
Julien Palard e85ef7a7ea
bpo-28795: Signal documentation: Fix misleading statement. (GH-13121) 2019-05-07 17:27:48 +02:00
Toshio Kuratomi 7b3a028c35 Fix rst formatting for several links in ssl documentation (GH-13133) 2019-05-06 13:28:14 -07:00
penguindustin 9646630895 bpo-36766: Typos in docs and code comments (GH-13116) 2019-05-06 14:57:17 -04:00
Sebastian Koslowski 3921b1cc34 bpo-36275: enhance documentation for venv.create() (GH-13114) 2019-05-06 14:51:09 -04:00
Andre Delfino f7b494c4d4 Update wsgiref.rst (#10488) 2019-05-06 09:01:17 -07:00
Cheryl Sabella e152169da9 bpo-16024: Doc cleanup regarding path_fd, dir_fd, follow_symlinks (GH-5505) 2019-05-06 08:39:13 -04:00
twisteroid ambassador 88f07a804a bpo-33530: Implement Happy Eyeballs in asyncio, v2 (GH-7237)
Added two keyword arguments, `delay` and `interleave`, to
`BaseEventLoop.create_connection`. Happy eyeballs is activated if
`delay` is specified.

We now have documentation for the new arguments. `staggered_race()` is in its own module, but not exported to the main asyncio package.


https://bugs.python.org/issue33530
2019-05-05 04:14:35 -07:00
Joannah Nanjekye 6b5b013bcc bpo-26978: Implement pathlib.Path.link_to (Using os.link) (GH-12990) 2019-05-04 17:27:10 +02:00
Stefan Behnel 47541689cc
bpo-28238: Implement "{*}tag" and "{ns}*" wildcard tag selection support for ElementPath, and extend the surrounding tests and docs. (GH-12997) 2019-05-03 20:58:16 +02:00
Alexander Vasin ceb842e155 Fixed typo (GH-11522)
Given example does not run, loop variable is missing.

Secondly, this is bad example how to handle shutdown signal, because it would cause `RuntimeError: Event loop stopped before Future completed.`

Perhaps it would be better to cancel all tasks instead of closing loop directly?

Did not create issue, because question is quite simple.
2019-05-03 08:25:36 -07:00
Stefan Behnel e1d5dd645d
bpo-13611: C14N 2.0 implementation for ElementTree (GH-12966)
* Implement C14N 2.0 as a new canonicalize() function in ElementTree.

Missing features:
- prefix renaming in XPath expressions (tag and attribute text is supported)
- preservation of original prefixes given redundant namespace declarations
2019-05-01 22:34:13 +02:00
Stefan Behnel dde3eebdaa
bpo-36676: Namespace prefix aware parsing support for the ET.XMLParser target (GH-12885)
* bpo-36676: Implement namespace prefix aware parsing support for the XMLParser target in ElementTree.
2019-05-01 21:49:58 +02:00
Stefan Behnel 43851a202c
bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree. (#12883)
* bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree.

* bpo-36673: Rewrite the comment/PI factory handling for the TreeBuilder in "_elementtree" to make it use the same factories as the ElementTree module, and to make it explicit when the comments/PIs are inserted into the tree and when they are not (which is the default).
2019-05-01 21:20:38 +02:00
Pablo Galindo d5d2b45469
bpo-36751: Deprecate getfullargspec and report positional-only args as regular args (GH-13016)
* bpo-36751: Deprecate getfullargspec and report positional-only args as regular args

* Use inspect.signature in testhelpers
2019-04-30 02:01:14 +01:00
Paul Ganssle 88c0937056 bpo-36004: Add date.fromisocalendar (GH-11888)
This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.
2019-04-29 15:22:03 +02:00
Raymond Hettinger da63b321f6
bpo-36715: Add usage note for dict.fromkeys() (GH-12974) 2019-04-28 00:22:36 -07:00
Terry Jan Reedy 55d035113d
Syntax highlight IDLE html doc code example. (GH-12981)
The new markup is currently ignored by IDLE's tk doc display.
2019-04-26 23:22:36 -04:00
Mark Dickinson 7abb6c05af
bpo-36669: add matmul support to weakref.proxy (GH-12932) 2019-04-26 15:56:15 +09:00
Paul Monson 62dfd7d6fe bpo-35920: Windows 10 ARM32 platform support (GH-11774) 2019-04-25 18:36:45 +00:00
Victor Stinner d7befad328
bpo-35537: Document posix_spawn() change in subprocess (GH-11668)
Document that subprocess.Popen no longer raise an exception on error
like missing program on very specific platforms when using
os.posix_spawn() is used.
2019-04-25 14:30:16 +02:00
Mathieu Dupuy 29d018aa63 replace 'sequencial argument' by 'positional' in doc (GH-12925) 2019-04-23 22:01:09 +09:00
Raymond Hettinger fb8c7d5332
bpo-36018: Make "seed" into a keyword only argument (GH-12921) 2019-04-23 01:46:18 -07:00
Jakub Molinski b4c7f39bbf Add module specification: itemgetter -> operator.itemgetter (GH-12823) 2019-04-23 01:30:30 -07:00
Raymond Hettinger 9013ccf6d8
bpo-36546: Add statistics.quantiles() (#12710) 2019-04-23 00:06:35 -07:00
mollison 5ebfa840a1 bpo-36645: Fix ambiguous formatting in re.sub() documentation (GH-12879) 2019-04-22 01:14:45 +03:00
Fredrik Averpil 3e986de0d6 Fix typo (GH-12878)
"sychronization" -> "synchronization"
2019-04-20 16:06:38 -07:00
Stefan Behnel e8113f51a8
bpo-30485: Change the prefix for defining the default namespace in ElementPath from None to '' since there is existing code that uses that and it's more convenient to have an all-string-keys dict (e.g. when sorting items etc.). (#12860) 2019-04-18 19:05:03 +02:00
Enrico Alarico Carbognani 7e954e7de4 bpo-36651: Fixed Asyncio Event Loop documentation inconsistency (GH-12866)
# [bpo-36651](https://bugs.python.org/issue36651): Fixed Asyncio Event Loop documentation inconsistency  

In the documentation for the call_later and the call_at methods there is a note which says that the delay cannot be longer than a day, but both methods have a note saying that this limitation was removed in Python 3.8
Here I fixed this issue by removing the pre-exising note and added a versionchanged. 

To test my changes I have rebuilt the documentation with ```make html```. I did not have any errors and the effected page displayed correctly on a browser.



https://bugs.python.org/issue36651
2019-04-18 05:43:14 -07:00
cocoatomo 9941f963fe Fix wrong indentation of a paragraph in documentation (GH-12868)
This paragraph doesn't seem to be a part of code, but merged into previous code block.
2019-04-18 01:54:51 +01:00
Lihua Zhao 693c104ae7 bpo-31904: Port test_resource to VxWorks (GH-12719)
Skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU on VxWorks.
2019-04-17 17:41:33 +02:00
Matthias Bussonnier 31e8d69bfe bpo-33783: Use proper class markup for random.Random docs (GHè7817)
Signed-off-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2019-04-16 18:47:11 +02:00
Stéphane Wirtel 2b7f93b99a
bpo-36345: Update wsgiref example (GH-12562)
Use literalinclude markup to include Tools/scripts/serve.py code.
Tools/scripts/serve.py first argument on the command line is now optional.
2019-04-16 14:52:54 +02:00
Victor Stinner 74125a60b7
bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)
The imap.IMAP4.logout() method no longer ignores silently arbitrary
exceptions.

Changes:

* The IMAP4.logout() method now expects a "BYE" untagged response,
  rather than relying on _check_bye() which raises a self.abort()
  exception.
* IMAP4.__exit__() now does nothing if the client already logged out.
* Add more debug info if test_logout() tests fail.
2019-04-15 18:23:20 +02:00
Inada Naoki a3283efd30 Doc: update PendingDeprecationWarning explanation (GH-12837)
Keep the nudge towards DeprecationWarning, but remove the
"Note" markup and generally shorten the description.

Ref: https://github.com/python/cpython/pull/12505/files#r273978757
2019-04-15 22:40:23 +10:00
pxinwr f1464f4d2e bpo-31904: Port the time module on VxWorks (GH-12305)
time.clock() is not available on VxWorks.
2019-04-15 11:06:21 +02:00
pxinwr 236d0b75c4 bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833) 2019-04-15 11:02:20 +02:00
Mickaël Schoentgen 929b704738 bpo-31658: Make xml.sax.parse accepting Path objects (GH-8564) 2019-04-14 11:16:54 +02:00
Stefan Behnel e9927e1820
bpo-30485: support a default prefix mapping in ElementPath by passing None as prefix (#1823) 2019-04-14 10:09:09 +02:00
Bernt Røskar Brenna ffca16e25a bpo-36227: ElementTree.tostring() default_namespace and xml_declaration arguments (GH-12225)
Add new keyword arguments "default_namespace" and "xml_declaration" to functions ET.tostring() and ET.tostringlist(), as known from ElementTree.write().
2019-04-14 10:07:02 +02:00
Sebastian Rittau 1e8295402b bpo-35581: Document @typing.type_check_only (GH-11312) 2019-04-12 15:33:40 -07:00
Christopher Head b13552c4d7 Indicate that seek and tell are mandatory on BufferedRandom. (GH-11216)
For BufferedReader and BufferedWriter, seek and tell operations are
optional (they may or may not exist based on the underlying stream). For
BufferedRandom, they are mandatory: a BufferedRandom should not be
constructed over an unseekable underlying stream. Document this.
2019-04-12 08:50:40 -07:00
Kingsley M b015fc86f7 bpo-36549: str.capitalize now titlecases the first character instead of uppercasing it (GH-12804) 2019-04-12 08:35:39 -07:00
Michael Felt 9d949f7796 bpo-36588: On AIX, remove major version from sys.platform (GH-12787)
On AIX, sys.platform doesn't contain the major version anymore.
Always return 'aix', instead of 'aix3' .. 'aix7'.  Since
older Python versions include the version number, it is recommended to
always use sys.platform.startswith('aix').
2019-04-12 16:15:32 +02:00
Emmanuel Arias 3993ccb682 bpo-20582: add link for manpage for flags on getnameinfo() (GH-11977) 2019-04-11 14:13:37 -07:00
Inada Naoki b3c92c6ae9
bpo-36597: fix weakref example code (GH-12779)
Commit 57b1a2862 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.
2019-04-11 19:05:32 +09:00
Inada Naoki 57b1a2862a
bpo-36597: fix random doctest failure (GH-12776) 2019-04-11 17:53:49 +09:00
pewscorner efc4870149 bpo-36416: Correct bytes.rpartition documentation (GH-12543) 2019-04-11 15:58:43 +09:00
Christopher Thorne b5e2959b27 Doc: fix typo in IncrementalDecoder.setstate (GH-12724) 2019-04-11 15:09:29 +09:00
Gregory P. Smith 2fb2bc81c3
bpo-14826: document that URLopener quotes fullurl. (GH-12758) 2019-04-10 02:17:48 -07:00
Vidar Tonaas Fauske 0e10766574 bpo-31512: Add non-elevated symlink support for Windows (GH-3652) 2019-04-09 11:19:46 -07:00
Lukas Waymann c324c74887 bpo-33456: site module documentation - fix wrong default for key in pyvenv.cfg (GH-6755) 2019-04-09 08:27:36 +01:00
Matthias Bussonnier a8abe097c1 bpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762) 2019-04-09 16:17:25 +09:00
Steve Palmer 7b97ab35b2 closes bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH-11893)
Move all documentation regarding the readinto method into either io.RawIOBase or io.BufferedIOBase.

Corresponding changes to documentation in the _pyio.py module.
2019-04-08 21:35:27 -07:00
Giampaolo Rodola 8702b67dad
BPO-17561: set create_server backlog default to None (GH-12735)
It turns out doing socket.listen(0) does not equal to "choose a
reasonable default". It actually means "set backlog to 0".
As such set backlog=None as the default for socket.create_server.
Fixes the following BB failures:
https://github.com/python/cpython/pull/11784#issuecomment-481036369
Ref. BPO-1756, GH-11784.
2019-04-09 04:42:06 +02:00
Giampaolo Rodola eb7e29f2a9
bpo-35934: Add socket.create_server() utility function (GH-11784) 2019-04-09 00:34:02 +02:00