Commit Graph

22598 Commits

Author SHA1 Message Date
Dong-hee Na 44046fe4fc bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225) 2019-08-12 19:41:08 +02:00
Ismail S f9590edfea Fix docs for assert_called and assert_called_once (#15197) 2019-08-12 01:57:03 -05:00
Raymond Hettinger f03b4c8a48
bpo-37819: Add Fraction.as_integer_ratio() (GH-15212) 2019-08-11 14:40:59 -07:00
Gregory P. Smith b4be87a04a bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)
DeprecationWarning will continue to be emitted for invalid escape
sequences in string and bytes literals just as it did in 3.7.

SyntaxWarning may be emitted in the future. But per mailing list
discussion, we don't yet know when because we haven't settled on how to
do so in a non-disruptive manner.

(Applies 4c5b6bac24 to the master branch).
(This is https://github.com/python/cpython/pull/15142 for master/3.9)


https://bugs.python.org/issue32912



Automerge-Triggered-By: @gpshead
2019-08-10 00:19:07 -07:00
Raymond Hettinger e43e7ed364
bpo-35892: Add usage note to mode() (GH-15122) 2019-08-08 01:23:05 -07:00
Géry Ogam 362f5350eb Update pickle.rst (GH-14128)
* Edits for readability and grammar
2019-08-06 22:02:23 -07:00
sweeneyde e9cbcd0018 bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for ratio method (GH-13482)
https://bugs.python.org/issue37004
2019-08-06 21:37:08 -07:00
Raymond Hettinger 610a4823cc
bpo-37646: Document that eval() cannot access nested scopes (GH-15117) 2019-08-06 17:56:22 -07:00
Géry Ogam cfebfef2de Improve signal documentation (GH-14274)
* add a missing ``.. availability::`` reST explicit markup;
* more consistent "see man page" sentences.
2019-08-06 14:12:22 -07:00
Raymond Hettinger 4f9ffc9d1a
bpo-37759: First round of major edits to Whatsnew 3.8 (GH-15127) 2019-08-05 13:33:19 -07:00
Terry Jan Reedy 14070299cd
bpo-37748: Re-order the Run menu. (GH-15115)
Put the most common choice, Run Module, at the top.
2019-08-04 16:45:15 -04:00
Raymond Hettinger adf02b36b3
Update itertools docs (GH-15114)
* Remove suggestion that is less relevant now that global lookups are much faster
* Add link for installing the recipes
2019-08-04 13:35:58 -07:00
Serhiy Storchaka 18b711c5a7
bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)
The collection's item is now always at the left and
the needle is on the right of ==.
2019-08-04 14:12:48 +03:00
Serhiy Storchaka 17e52649c0
bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
2019-08-04 12:38:46 +03:00
Ngalim Siregar c5fa44944e bpo-37444: Update differing exception between builtins and importlib (GH-14869)
Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure.


https://bugs.python.org/issue37444



Automerge-Triggered-By: @brettcannon
2019-08-02 22:46:02 -07:00
Joannah Nanjekye 854d0a4b98 bpo-36487: Make C-API docs clear about what the main interpreter is. (gh-12666) 2019-08-02 09:50:22 -06:00
mental 2491134029 bpo-37726: Prefer argparse over getopt in stdlib tutorial (#15052) 2019-08-01 07:17:30 -07:00
David H ed5e8e06cb bpo-37730: Fix usage of NotImplemented instead of NotImplementedError in docs. (GH-15062) 2019-08-01 01:49:55 +03:00
Hai Shi 1b29af83bc bpo-34101: Add doc of PyBuffer_GetPointer (GH-14994) 2019-07-31 16:48:15 +02:00
karl ding 31c4fd2a10 bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)
Expose the CAN_BCM SocketCAN constants used in the bcm_msg_head struct
flags (provided by <linux/can/bcm.h>) under the socket library.

This adds the following constants with a CAN_BCM prefix:

  * SETTIMER
  * STARTTIMER
  * TX_COUNTEVT
  * TX_ANNOUNCE
  * TX_CP_CAN_ID
  * RX_FILTER_ID
  * RX_CHECK_DLC
  * RX_NO_AUTOTIMER
  * RX_ANNOUNCE_RESUME
  * TX_RESET_MULTI_IDX
  * RX_RTR_FRAME
  * CAN_FD_FRAME

The CAN_FD_FRAME flag was introduced in the 4.8 kernel, while the other
ones were present since SocketCAN drivers were mainlined in 2.6.25. As
such, it is probably unnecessary to guard against these constants being
missing.
2019-07-31 10:47:16 +02:00
Vinay Sajip 472eced677
Refined Qt GUI example in the logging cookbook. (GH-15045) 2019-07-31 07:36:45 +01:00
Terry Jan Reedy 5982b7201b
bpo-33821: Update IDLE section of What's New 3.7 (#15036)
* bpo-33821: Update IDLE section of What's New 3.7

* Fix roles.
2019-07-31 01:04:29 -04:00
Terry Jan Reedy a72ca90eb9
bpo-33822: Add IDLE section of What's New 3.8 (#15035)
* bpo-33822: Add IDLE section of What's New 3.8

* Fix role.
2019-07-31 01:03:53 -04:00
Min ho Kim c4cacc8c5e Fix typos in comments, docs and test names (#15018)
* Fix typos in comments, docs and test names

* Update test_pyparse.py

account for change in string length

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Apply suggestion: Dealloccte -> Deallocate

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Update posixmodule checksum.

* Reverse idlelib changes.
2019-07-30 18:16:13 -04:00
Jake Tesler 84846b0187 bpo-36084: Add threading Native ID information to What's New documentation (GH-14845) 2019-07-30 23:41:46 +02:00
Pablo Galindo 9211e2fd81 bpo-37268: Add deprecation notice and a DeprecationWarning for the parser module (GH-15017)
Deprecate the parser module and add a deprecation warning triggered on import and a warning block in the documentation.





https://bugs.python.org/issue37268



Automerge-Triggered-By: @pablogsal
2019-07-30 04:04:01 -07:00
Nick Coghlan 17a058ed6f
Remove trailing .0 from version changed note (GH-14987) 2019-07-28 21:40:47 +10:00
Raymond Hettinger 6b5f1b496f
bpo-37691: Let math.dist() accept sequences and iterables for coordinates (GH-14975) 2019-07-27 14:04:29 -07:00
Vinay Sajip 1ed915e8ae
Add Qt GUI example to the logging cookbook. (GH-14978) 2019-07-27 13:46:53 +01:00
Derek Keeler 91e4957509 bpo-32910: Remove implementation detail in venv documentation. (GH-14968) 2019-07-26 14:57:11 -07:00
Steve Dower 9d9893a1c8
bpo-35524: Update Windows installer image in docs (GH-14966) 2019-07-26 13:03:58 -07:00
Tzu-ping Chung 544fa15ea1 Swap 'if' branches so content matches to condition in importlib example (GH-14947)
Prior to this change the guard on an 'elif' used an assignment expression whose value was used in a later 'else' block, causing some confusion for people.

(Discussion on Twitter: https://twitter.com/brettsky/status/1153861041068994566.)

Automerge-Triggered-By: @brettcannon
2019-07-25 10:20:33 -07:00
Stefan Behnel a3697db010
bpo-34160: explain how to deal with attribute order in ElementTree (GH-14867)
* Fix the formatting in the documentation of the tostring() functions.

* bpo-34160: Document that the tostring() and tostringlist() functions also preserve the attribute order now.

* bpo-34160: Add an explanation of how users should deal with the attribute order.
2019-07-24 20:22:50 +02:00
Brett Cannon 2f224a077a
Touch up venv docs (GH-14922) 2019-07-23 14:34:32 -07:00
Tal Einat 7123ea009b
bpo-17535: IDLE editor line numbers (GH-14030) 2019-07-23 15:22:11 +03:00
Vinay Sajip d309352c6f
Update logging cookbook to show multiple worker processes using the concurrent.futures module. (#14905) 2019-07-22 12:14:50 +01:00
Raymond Hettinger b530a4460b
Add examples to elucidate the formulas (GH-14898) 2019-07-21 16:32:00 -07:00
Min ho Kim 96e12d5f4f Fix typos in docs, comments and test assert messages (#14872) 2019-07-21 16:12:33 -04:00
Ned Deily 22f0483d44
Bpo-37644: update suspicious.csv for distutils/examples (GH-14885) 2019-07-21 20:01:56 +02:00
Raymond Hettinger 8dbe563aa6
bpo-37624: Document weight assumptions for random.choices() (GH-14855) 2019-07-19 01:56:42 -07:00
aldwinaldwin 8f040b7a9f bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850)
Move the Editors and IDE section out of the Unix section, to its own section.


https://bugs.python.org/issue37610
2019-07-18 18:23:17 -07:00
Joseph Fox-Rabinovitz bd26a4466b Docs: Correct formatting of a multiline code block (GH-13806) 2019-07-17 11:13:01 +03:00
sgal 1d8b04edfd bpo-37599: Remove a vague statement in documentation of Integer Objects (#14786)
* Remove a vague statement in documentation

* Remove another vague sentence

A sentence starting with "So it should be possible..." shouldn't be in the docs either.

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Include the removal of the previous line

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Remove an extra space
2019-07-16 08:15:17 -07:00
Ilya Kamenshchikov a0f7119f15 bpo-37352: Minor word-smithing for design.rst (GH #14730) 2019-07-16 08:13:38 -07:00
David Jones 6a61714cde Replace backquote with command substitution in subprocess doc example (GH-13941)
Replace backquotes with POSIXy command substitution in example.
2019-07-16 07:55:19 -07:00
Giovanni Cappellotto 52693c10e8 bpo-37284: Add note to sys.implementation doc (GH-14328)
Add a brief note to indicate that any new required attributes must go through the PEP process.





https://bugs.python.org/issue37284
2019-07-15 07:37:09 -07:00
Hai Shi 40d2226a69 Remove redundant docs of PyEval_EvalFrameEx (GH-14765) 2019-07-14 10:20:56 +02:00
Steve Dower 68c74d05c1
bpo-37571: Remove extra space in ctypes docs (GH14764) 2019-07-14 10:09:45 +02:00
Michele Angrisano 6b929580eb bpo-37571: Add 'b' to prevent the TypeError exception. (GH-14721)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
2019-07-14 09:55:11 +02:00
Carl Bordum Hansen 8efade91b1 bpo-36261: Improve example of the preamble field in email docs (GH-14751) 2019-07-14 09:46:18 +02:00
Zac Hatfield-Dodds dffca9e925 bpo-26967: fix flag grouping with allow_abbrev=False (GH-14316)
The `allow_abbrev` option for ArgumentParser is documented and intended to disable support for unique prefixes of --options, which may sometimes be ambiguous due to deferred parsing.

However, the initial implementation also broke parsing of grouped short flags, such as `-ab` meaning `-a -b` (or `-a=b`).  Checking the argument for a leading `--` before rejecting it fixes this.

This was prompted by pytest-dev/pytest#5469, so a backport to at least 3.8 would be great 😄  
And this is my first PR to CPython, so please let me know if I've missed anything!


https://bugs.python.org/issue26967
2019-07-13 22:35:58 -07:00
Sviatoslav Sydorenko e44184749c bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir (GH-1163)
Hi,

I've faced an issue w/ `mailbox.Maildir()`. The case is following:
1. I create a folder with `tempfile.TemporaryDirectory()`, so it's empty
2. I pass that folder path as an argument when instantiating `mailbox.Maildir()`
3. Then I receive an exception happening because "there's no such file or directory" (namely `cur`, `tmp` or `new`) during interaction with Maildir

**Expected result:** subdirs are created during `Maildir()` instance creation.

**Actual result:** subdirs are assumed as existing which leads to exceptions during use.

**Workaround:** remove the actual dir before passing the path to `Maildir()`. It will be created automatically with all subdirs needed.

**Fix:** This PR. Basically it adds creation of subdirs regardless of whether the base dir existed before.


https://bugs.python.org/issue30088
2019-07-13 07:47:14 -07:00
Giovanni Cappellotto dc3f99fa77 bpo-37548: Document range of atan, acos and asin (GH-14717) 2019-07-13 14:59:55 +01:00
Milan Oberkirch b5bbb8a740 bpo-37580: Fix typo in http.cookiejar documentation (GH-14731)
[bpo-37580](https://bugs.python.org/issue37580): Markup typo in http.cookiejar doc





https://bugs.python.org/issue37580
2019-07-13 03:17:16 -07:00
Robert DiPietro fb6c1f8d3b Fix typo in re.escape documentation (GH-14722) 2019-07-13 16:35:04 +08:00
Brett Cannon 0827064c95 bpo-37521: No longer treat insertion into sys.modules as optional in importlib examples (GH-14723)
Fix importlib examples to insert any newly created modules via importlib.util.module_from_spec() immediately into sys.modules instead of after calling loader.exec_module().

Thanks to Benjamin Mintz for finding the bug.


https://bugs.python.org/issue37521
2019-07-12 15:35:34 -07:00
Mariatta 7cbef72902 closes bpo-37554: Remove `q:q` in os.rst documentation (GH-14692)
https://bugs.python.org/issue37554
2019-07-11 10:31:19 -07:00
Tal Einat 79042ac434
bpo-34369: make kqueue.control() docs better reflect that timeout is positional-only (GH-9499) 2019-07-11 17:00:34 +03:00
Jeroen Demeyer 59ad110d7a bpo-37547: add _PyObject_CallMethodOneArg (GH-14685) 2019-07-11 17:59:05 +09:00
Benjamin Peterson 2a3d4d9c53
Document default parameter of .seek() in the signature. (GH-14691) 2019-07-10 19:43:04 -07:00
Victor Stinner 91b4f7ab7f
bpo-37526: Add support.catch_threading_exception() (GH-14664)
Context manager catching threading.Thread exception using
threading.excepthook.
2019-07-09 13:00:23 +02:00
Julien Palard 66b4150f6f
Doc: Fix example title. (GH-14639) 2019-07-08 23:08:07 +02:00
Julien Palard 2da622ff77
Doc: Fix: Proper UpperCamelCase and lowercase. (GH-14644)
Initial report by Michael Blankenship on docs@
2019-07-08 23:06:32 +02:00
Jeroen Demeyer 762f93ff2e bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267) 2019-07-08 17:19:25 +09:00
Hai Shi f6cdd3ff68 bpo-37513: Change ValueError to TypeError in an example in ctypes doc (GH-14615) 2019-07-07 23:40:07 +08:00
Terry Jan Reedy a9b40e4546
bpo-37478: Add missing 'and'. (GH-14631) 2019-07-06 22:44:01 -04:00
Kyle Stanley 0717b4d9b3 bpo-37478: Specify possible exceptions for os.chdir() (GH-14611) 2019-07-06 21:20:15 -04:00
Terry Jan Reedy 6f2a8c0857
bpo-37456: Slash ('/') is now part of syntax. (GH-14627) 2019-07-06 18:13:02 -04:00
Terry Jan Reedy f8709e804d
bpo-37487: Fix PyList_GetItem index description. (GH-14623)
0 is a legal index.
2019-07-06 17:40:27 -04:00
Tal Einat fcf1d003bf
bpo-26806: add 30 to the recursion limit in IDLE's shell (GH-13944)
This is done to compensate for the extra stack frames added by
IDLE itself, which cause problems when setting the recursion limit
to low values.

This wraps sys.setrecursionlimit() and sys.getrecursionlimit()
as invisibly as possible.
2019-07-06 15:35:24 +03:00
Terry Jan Reedy 45bc61b971
bpo-37149: Replace dead link for online Tkinter reference (GH-14616)
Also fix a name misspelling.
2019-07-06 02:31:54 -04:00
Hai Shi 39a5d17a7f closes bpo-37508: Fix name of type in memory.rst. (GH-14604) 2019-07-05 21:03:13 -07:00
Victor Stinner 1da4462765
bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)
The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
2019-07-05 10:44:12 +02:00
Tim Hoffmann a55f75a6e3 Use OSError subclasses in os documentation (GH-14262) 2019-07-05 11:41:35 +03:00
thatneat 2f19e82fbe bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__ (GH-14545)
* bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__
2019-07-04 11:28:37 -07:00
Victor Stinner b4e68960b9
bpo-37266: Add bpo number to the What's New entry (GH614584)
To get more info about this change.
2019-07-04 18:30:19 +02:00
Jeroen Demeyer 7f41c8e0dd bpo-37493: use _PyObject_CallNoArg in more places (GH-14575) 2019-07-04 19:35:31 +09:00
Jeroen Demeyer 196a530e00 bpo-37483: add _PyObject_CallOneArg() function (#14558) 2019-07-04 19:31:34 +09:00
aldwinaldwin b607d992e7 bpo-37459: importlib docs improperly reference get_resource_loader() (#14568)
* bpo-37459: importlib docs improperly reference get_resource_loader()
2019-07-03 17:58:45 -07:00
ILJI CHOI 0f6f73ff3c Fix typo in 3.9's Whats new. Pyton -> Python (GH-14567) 2019-07-02 19:36:01 -07:00
Hai Shi aeecf38066 bpo-37441: Fix wrong PyErr_SetImportErrorSubclass signature in doc (GH-14453) 2019-07-03 09:56:07 +08:00
Steve Dower e226e83d36
bpo-37363: Add audit events on startup for the run commands (GH-14524) 2019-07-01 16:03:53 -07:00
Vinay Sajip 0f4e813282
bpo-37470: Document more clearly the error handling for QueueHandler.emit(). (GH-14532) 2019-07-01 20:45:01 +01:00
Vinay Sajip e6b64b756f
bpo-37469: Document usability of SimpleQueue with QueueHandler and QueueListener. (GH-14521) 2019-07-01 18:45:07 +01:00
Victor Stinner 36242fd871
bpo-36763: Add PyConfig_SetWideStringList() (GH-14444) 2019-07-01 19:13:50 +02:00
Pierre Glaser ec6c1bd049 bpo-37209: Add pickle entry for 3.8 whatsnew (GH-14503) 2019-07-01 15:51:57 +02:00
Miro Hrončok 72cd653c4e bpo-10945: Drop support for bdist_wininst on non-Windows systems (GH-14506)
bdist_wininst depends on MBCS codec, unavailable on non-Windows,
and bdist_wininst have not worked since at least Python 3.2, possibly
never on Python 3.

Here we document that bdist_wininst is only supported on Windows,
and we mark it unsupported otherwise to skip tests.

Distributors of Python 3 can now safely drop the bdist_wininst .exe files
without the need to skip bdist_wininst related tests.
2019-07-01 14:12:40 +02:00
Vinay Sajip 84de34e39e
bpo-32934: Clarified meaning of 'capacity' for BufferingHandler and MemoryHandler. (GH-14498) 2019-07-01 12:41:21 +01:00
Pablo Galindo 4a2edc34a4 bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set PyCode_New as a compatibility wrapper (GH-13959)
Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper
2019-07-01 12:35:05 +02:00
Christian Heimes d1bd6e79da bpo-37440: Enable TLS 1.3 post-handshake auth in http.client (GH-14448)
Post-handshake authentication is required for conditional client cert authentication with TLS 1.3.


https://bugs.python.org/issue37440
2019-06-30 23:32:24 -07:00
Krishna Oza 12b436e3b0 bpo-36168: Lowercase the word "subsequent" in get_value doc (GH-14485)
Subsequent -> subsequent

https://bugs.python.org/issue36168
2019-06-30 23:04:20 -07:00
Andrew Svetlov 0d671c04c3
bpo-35621: Support running subprocesses in asyncio when loop is executed in non-main thread (GH-14344) 2019-06-30 12:54:59 +03:00
tmblweed eb97b9211e bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469)
* Added documentation for textwrap.dedent behavior.
* Remove an obsolete note about pre-2.5 behavior from the docstring.
2019-06-29 21:20:03 -07:00
Andre Delfino 3e6583061c Make StreamHandler.terminator more discoverable (GH-14359) 2019-06-29 22:59:49 +01:00
Andre Delfino 18a2fc6f23 Fix indentation in logging.handlers.setStream (GH-14358) 2019-06-29 22:57:39 +01:00
Brett Cannon f9f8e3ce70
bpo-37403: Touch up venv docs (GH-14458)
Add a versionadded for PS Core and note that `.venv` is a common virtual environment name.
2019-06-28 12:14:31 -07:00
Jeroen Demeyer b1263d5a60 bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228) 2019-06-28 18:49:00 +09:00
Hai Shi b4bee03087 bpo-37432: Doc: Fix signature of PyObject_Del() (GH-14430) 2019-06-28 18:02:56 +09:00
Steve Dower 44f91c388a
bpo-37390: Add audit event table to documentations (GH-14406)
Also updates some (unreleased) event names to be consistent with the others.
2019-06-27 10:47:59 -07:00
Carl Bordum Hansen 06a8916cf4 bpo-37376: pprint support for SimpleNamespace (GH-14318)
https://bugs.python.org/issue37376
2019-06-26 16:13:18 -07:00
Serhiy Storchaka 2d88e63bfc
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. (GH-14390) 2019-06-26 19:07:44 +03:00
Victor Stinner 69150669f2
bpo-37414: Remove sys.callstats() (GH-14398)
Remove the undocumented sys.callstats() function. Since Python 3.7,
it was deprecated and always returned None. It required a special
build option CALL_PROFILE which was already removed in Python 3.7.
2019-06-26 18:01:10 +02:00
Steve Dower 7a177c08ab
Improve Windows commands in tutorial (GH-14379) 2019-06-26 08:55:57 -07:00
Victor Stinner 689830ee62
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
The os.getcwdb() function now uses the UTF-8 encoding on Windows,
rather than the ANSI code page: see PEP 529 for the rationale. The
function is no longer deprecated on Windows.

os.getcwd() and os.getcwdb() now detect integer overflow on memory
allocations. On Unix, these functions properly report MemoryError on
memory allocation failure.
2019-06-26 17:31:12 +02:00
Victor Stinner 22eb689cf3
bpo-37388: Development mode check encoding and errors (GH-14341)
In development mode and in debug build, encoding and errors arguments
are now checked on string encoding and decoding operations. Examples:
open(), str.encode() and bytes.decode().

By default, for best performances, the errors argument is only
checked at the first encoding/decoding error, and the encoding
argument is sometimes ignored for empty strings.
2019-06-26 00:51:05 +02:00
Victor Stinner 3939c321c9
bpo-20443: _PyConfig_Read() gets the absolute path of run_filename (GH-14053)
Python now gets the absolute path of the script filename specified on
the command line (ex: "python3 script.py"): the __file__ attribute of
the __main__ module, sys.argv[0] and sys.path[0] become an absolute
path, rather than a relative path.

* Add _Py_isabs() and _Py_abspath() functions.
* _PyConfig_Read() now tries to get the absolute path of
  run_filename, but keeps the relative path if _Py_abspath() fails.
* Reimplement os._getfullpathname() using _Py_abspath().
* Use _Py_isabs() in getpath.c.
2019-06-25 15:02:43 +02:00
Xtreak 080b6b40fa bpo-37392: Update the dir(sys) in module tutorial (GH-14365) 2019-06-25 14:16:54 +02:00
Pablo Galindo de9b606c90
Fix minor spelling error in What's new for Python 3.8 (GH-14371) 2019-06-25 11:55:23 +01:00
Pablo Galindo b51b7137fa
bpo-35224: Add What's new entry for evaluation order in dict comprehensions (GH-14319) 2019-06-25 02:41:58 +01:00
Victor Stinner 36456df138
bpo-37392: Remove sys.setcheckinterval() (GH-14355)
Remove sys.getcheckinterval() and sys.setcheckinterval() functions.
They were deprecated since Python 3.2. Use sys.getswitchinterval()
and sys.setswitchinterval() instead.

Remove also check_interval field of the PyInterpreterState structure.
2019-06-25 03:01:08 +02:00
David K. Hess 9fc720e5e4 bpo-4963: Fix for initialization and non-deterministic behavior issues in mimetypes (GH-3062) 2019-06-24 16:46:59 -07:00
Xtreak 6793cce155 bpo-36889: Document asyncio Stream and StreamServer (GH-14203) 2019-06-24 21:16:58 +03:00
Steve Dower 60419a7e96
bpo-37363: Add audit events for a range of modules (GH-14301) 2019-06-24 08:42:54 -07:00
Gabe Appleton 2ac3bab2a6 bpo-37345: Add formal UDPLITE support (GH-14258)
At the moment you can definitely use UDPLITE sockets on Linux systems, but it would be good if this support were formalized such that you can detect support at runtime easily.

At the moment, to make and use a UDPLITE socket requires something like the following code:

```
>>> import socket
>>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136)
>>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136)
>>> a.bind(('localhost', 44444))
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.setsockopt(136, 10, 16)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.setsockopt(136, 10, 32)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.setsockopt(136, 10, 64)
>>> b.sendto(b'test'*256, ('localhost', 44444))
```

If you look at this through Wireshark, you can see that the packets are different in that the checksums and checksum coverages change.

With the pull request that I am submitting momentarily, you could do the following code instead:

```
>>> import socket
>>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE)
>>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE)
>>> a.bind(('localhost', 44444))
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.set_send_checksum_coverage(16)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.set_send_checksum_coverage(32)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.set_send_checksum_coverage(64)
>>> b.sendto(b'test'*256, ('localhost', 44444))
```

One can also detect support for UDPLITE just by checking

```
>>> hasattr(socket, 'IPPROTO_UDPLITE')
```


https://bugs.python.org/issue37345
2019-06-24 02:58:56 -07:00
Ben Darnell 9ffca670ed asyncio: Fix docs for default event loop (#14308)
When the Windows default event loop changed, `asyncio-policy.rst` was updated but `asyncio-eventloop.rst` was missed.
2019-06-22 10:38:20 -07:00
Jörn Heissler c8a35417db bpo-35224: Reverse evaluation order of key: value in dict comprehensions (GH-14139)
… as proposed in PEP 572; key is now evaluated before value.





https://bugs.python.org/issue35224
2019-06-22 07:40:55 -07:00
Steve Dower f5690925df bpo-37351: Removes libpython38.a from standard Windows distribution (#14276) 2019-06-21 14:28:46 -07:00
Brad 8b2aa1fdde Use `python -m pip install` in porting guide and venv docs (GH-13257)
This is to help prevent people from accidentally installing into the wrong Python interpreter if they are not aware of which Python interpreter `pip` points to.
2019-06-21 11:20:21 -07:00
Aeros d0068000b2 Docs: Improved phrasing (GH-14069)
* Docs: Improved phrasing 

Removed usage of second person pronouns in the section and made the assumption of "uneasiness" in code style transition more neutral.

* Removed trailing whitespace on line 34
2019-06-20 21:43:07 -07:00
Victor Stinner c68e3fb15d Update What's New in Python 3.9 (GH-14253)
* Mention bpo of PyImport_Cleanup removal
* Fix bpo number of PyByteArray_Init removal
2019-06-20 13:41:25 -07:00
Hai Shi bc5caf88ca bpo-37342: Fix the incorrect nb_index's type in typeobj documentation (GH-14241)
It was listed as `binaryfunc`. It should be `unaryfunc`.
2019-06-19 20:32:23 -07:00
Victor Stinner af41c567af
Update What's New in Python 3.8 (GH-14239)
* Mention issue in which ByByteArray_Init() has been removed.
* Fix typo
2019-06-20 01:44:58 +02:00
Harmon 35068bd059 Add missing single quote in io.TextIOWrapper.reconfigure documentation (GH-14246)
Add a missing single quote character in the documentation for `io.TextIOWrapper.reconfigure`.
2019-06-19 14:01:26 -07:00
Vinay Sajip f06b569305
bpo-37331: Clarify format of socket handler messages in the documentation. (GH-14234) 2019-06-19 15:29:57 +01:00
Vinay Sajip 0150001653
bpo-37258: Not a bug, but added a unit test and updated documentation. (GH-14229) 2019-06-19 11:46:53 +01:00
Victor Stinner 987a0dcfa1
bpo-36710: Remove PyImport_Cleanup() function (GH-14221)
* Rename PyImport_Cleanup() to _PyImport_Cleanup() and move it to the
  internal C API. Add 'tstate' parameters.
* Remove documentation of _PyImport_Init(), PyImport_Cleanup(),
  _PyImport_Fini(). All three were documented as "For internal use
  only.".
2019-06-19 10:36:10 +02:00
Ivan Levkivskyi 809ff1181c
Document typing.ForwardRef (GH-14216) 2019-06-19 01:31:51 +01:00
Ivan Levkivskyi 47c2de7725
Document changes in PyNode_AddChild and PyParser_AddToken (GH-14214)
I didn't find any entries in the docs about these functions, so I just mentioned them, in "What's New".
2019-06-19 01:17:47 +01:00
Mike Gleen 6b9c204ee7 bpo-34903: Document that some strptime formats only require 1 digit (GH-14149)
For datetime.datetime.strptime(), the leading zero for some two-digit formats is optional.

This adds a footnote to the strftime/strptime documentation to reflect this fact, and adds some tests to ensure that it is true.

bpo-34903
2019-06-18 19:14:57 +01:00
Cheryl Sabella 201bc2d18b bpo-5680: IDLE: Customize running a module (GH-13763)
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
2019-06-17 22:24:10 -04:00
Victor Stinner ac7b1a3f32
bpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169)
aifc.openfp() alias to aifc.open(), sunau.openfp() alias to
sunau.open(), and wave.openfp() alias to wave.open() have been
removed. They were deprecated since Python 3.7.
2019-06-18 00:00:24 +02:00
Tal Einat 5bff3c86ab bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)
Measure required height by quickly maximizing once per screen.
A search for a better method failed.
2019-06-17 15:41:00 -04:00
Cooper Lees 4acdbf11b1 bpo-34556: Add --upgrade-deps to venv module (#13100)
Add --upgrade-deps to venv module
- This allows for pip + setuptools to be automatically upgraded to the latest version on PyPI
- Update documentation to represent this change

bpo-34556: Add --upgrade to venv module
2019-06-17 19:18:13 +01:00
Vinay Sajip ca7b504a4d
bpo-37111: Add 'encoding' and 'errors' parameters to logging.basicCon… (GH-14008) 2019-06-17 17:40:52 +01:00
Victor Stinner 5352cc41fa
bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)
Explain in the doc why PyObject_CallNoArgs() should be preferred over
other existing ways to call a function without any arguments.
2019-06-17 17:15:36 +02:00
Serhiy Storchaka 231aad3849
bpo-37315: Deprecate accepting floats in math.factorial(). (GH-14147) 2019-06-17 16:57:27 +03:00
Victor Stinner 1ce2656f13
bpo-37194: Complete PyObject_CallXXX() docs (GH-14156)
Mention explicitly that PyObject_CallXXX() functions raise an
exception an failure.
2019-06-17 14:58:10 +02:00
Victor Stinner 2ff58a24e8
bpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)
Add a new public PyObject_CallNoArgs() function to the C API: call a
callable Python object without any arguments.

It is the most efficient way to call a callback without any argument.
On x86-64, for example, PyObject_CallFunctionObjArgs(func, NULL)
allocates 960 bytes on the stack per call, whereas
PyObject_CallNoArgs(func) only allocates 624 bytes per call.

It is excluded from stable ABI 3.8.

Replace private _PyObject_CallNoArg() with public
PyObject_CallNoArgs() in C extensions: _asyncio, _datetime,
_elementtree, _pickle, _tkinter and readline.
2019-06-17 14:27:23 +02:00
Victor Stinner 8bf08ee45b
bpo-37312: Remove _dummy_thread and dummy_threading modules (GH-14143)
Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.
2019-06-17 14:18:43 +02:00
Jeroen Demeyer 5600b5e1b2 bpo-28805: document METH_FASTCALL (GH-14079) 2019-06-17 02:03:22 +09:00
Julien Palard 552951563c
Doc: Remove an ugly space before a dot. (GH-14123) 2019-06-16 10:25:05 +02:00
Julien Palard cfa0394b97 Doc: Deprecation header: More precise wording. (GH-14109) 2019-06-15 10:21:37 -04:00
Alex Gaynor 6ef4d323bd Update link in colorsys docs to be https (GH-14062) 2019-06-15 07:09:36 -07:00
Julien Palard 7d23dbe6d1
Doc: Bump Sphinx verison. (#13785)
To reflect the one we're using in production.
2019-06-15 15:41:58 +02:00
Géry Ogam f475729a71 Update weakref.rst (GH-14098) 2019-06-15 04:33:23 -07:00
Victor Stinner 7efc526e5c
bpo-36707: Document "m" removal from sys.abiflags (GH-14090) 2019-06-15 03:24:41 +02:00
Victor Stinner bd5798f6d4
Document C API changes in What's New in Python 3.8 (GH-14092) 2019-06-14 19:43:43 +02:00
Victor Stinner 066e5b1a91
bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)
In a subinterpreter, spawning a daemon thread now raises an
exception. Daemon threads were never supported in subinterpreters.
Previously, the subinterpreter finalization crashed with a Pyton
fatal error if a daemon thread was still running.

* Add _thread._is_main_interpreter()
* threading.Thread.start() now raises RuntimeError if the thread is a
  daemon thread and the method is called from a subinterpreter.
* The _thread module now uses Argument Clinic for the new function.
* Use textwrap.dedent() in test_threading.SubinterpThreadingTests
2019-06-14 18:55:22 +02:00
Victor Stinner 212646cae6
bpo-37261: Document sys.unraisablehook corner cases (GH-14059)
Document reference cycle and resurrected objects issues in
sys.unraisablehook() and threading.excepthook() documentation.

Fix test.support.catch_unraisable_exception(): __exit__() no longer
ignores unraisable exceptions.

Fix test_io test_writer_close_error_on_close(): use a second
catch_unraisable_exception() to catch the BufferedWriter unraisable
exception.
2019-06-14 18:03:22 +02:00
Steve Dower 21a92f8cda
Implement Windows release builds in Azure Pipelines (GH-14065) 2019-06-14 08:29:20 -07:00