Commit Graph

21227 Commits

Author SHA1 Message Date
Barry Warsaw 4c19b95734
Add What's New for issues 32303 and 32305 (GH-5994) 2018-03-05 12:37:12 -08:00
Cheryl Sabella 18fd892463 bpo-30147: Add re.escape changes to 3.7 What's New (GH-5978) 2018-03-04 18:06:57 -05:00
Joongi Kim 13cfd57dcf Fix missing coroutine declaration in the asyncio documentation. (#5964) 2018-03-03 18:43:54 +02:00
Serhiy Storchaka b21d155f57
bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930) 2018-03-02 11:53:51 +02:00
Jon Wayne Parrott bf63e8d55f bpo-30607: Use external python-doc-theme (GH-2017) 2018-03-01 16:02:50 -05:00
James Walker 982c723384 Fix typo in logging doc: picked -> pickled (GH-5942) 2018-02-28 15:46:35 -08:00
Ned Deily 45ab51c142 Fix 3.8 whatsnew changelog link 2018-02-28 13:58:38 -05:00
Serhiy Storchaka be50a7b627 Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" (#5912)
* Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)"

This reverts commit dd42cb71f2.
2018-02-27 18:03:46 -05:00
Paul Ganssle 5bd04f964b bpo-10381, bpo-32403: What's new entries for changes to datetime (gh-5814)
* Add What's New entry for addition of datetime.timezone to the C API

Closes bpo-10381

* Add what's new entry for date and datetime optimizations

Closes bpo-32403
2018-02-27 14:41:30 -05:00
Christian Heimes 698dde16f6
bpo-31453: Add setter for min/max protocol version (#5259)
OpenSSL 1.1 has introduced a new API to set the minimum and maximum
supported protocol version. The API is easier to use than the old
OP_NO_TLS1 option flags, too.

Since OpenSSL has no call to set minimum version to highest supported,
the implementation emulate maximum_version = MINIMUM_SUPPORTED and
minimum_version = MAXIMUM_SUPPORTED by figuring out the minumum and
maximum supported version at compile time.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-27 11:54:43 +01:00
Christian Heimes 9d50ab563d
bpo-32951: Disable SSLSocket/SSLObject constructor (#5864)
Direct instantiation of SSLSocket and SSLObject objects is now prohibited.
The constructors were never documented, tested, or designed as public
constructors. The SSLSocket constructor had limitations. For example it was
not possible to enabled hostname verification except was
ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED.

SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API
to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is
also deprecated.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-27 10:17:30 +01:00
Christian Heimes 90f05a527c
bpo-28124: deprecate ssl.wrap_socket() (#5888)
The ssl module function ssl.wrap_socket() has been de-emphasized
and deprecated in favor of the more secure and efficient
SSLContext.wrap_socket() method.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-27 09:21:34 +01:00
Christian Heimes 05d9fe32a1
bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (#5663)
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes

Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and
TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2. Other tests currently
fail because the threaded or async test servers stop after failure.

I'm going to address these issues when OpenSSL 1.1.1 reaches beta.

OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-27 08:55:39 +01:00
animalize 19e7d48ce8 bpo-32394: Remove some TCP options on old version Windows. (GH-5523) 2018-02-26 10:10:36 -08:00
Mario Corchero fbee88244e bpo-31454: Include information about "import X as Y" in Modules tutorial (GH-4041) 2018-02-25 11:11:12 -08:00
Cheryl Sabella 84c4b0cc67 bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
By default `print` adds spaces between its arguments.
2018-02-25 11:06:01 -08:00
Cheryl Sabella 186b606d8a bpo-17232: Clarify docs for -O and -OO command line options (#5839)
The 'optimization' is for space in the executable file, not for run time.
2018-02-24 22:04:40 -05:00
Christian Heimes 6cdb7954b0
bpo-30622: Improve NPN support detection (#5859)
The ssl module now detects missing NPN support in LibreSSL.

Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org>
Signed-off-by: Christian Heimes <christian@python.org>
2018-02-24 22:12:40 +01:00
Christian Heimes 11a1493bc4 [bpo-28414] Make all hostnames in SSL module IDN A-labels (GH-5128)
Previously, the ssl module stored international domain names (IDNs)
as U-labels. This is problematic for a number of reasons -- for
example, it made it impossible for users to use a different version
of IDNA than the one built into Python.

After this change, we always convert to A-labels as soon as possible,
and use them for all internal processing. In particular, server_hostname
attribute is now an A-label, and on the server side there's a new
sni_callback that receives the SNI servername as an A-label rather than
a U-label.
2018-02-23 17:35:08 -08:00
Mariatta 98f42aac23
bpo-32923: Unittest doc: replace `whilst` with `while` (GH-5833)
`whilst` and `while` are both english words, `whilst` is not as commonly used.
This can be confusing to readers whose primary language is not english.
2018-02-23 09:51:11 -08:00
cocoatomo 0febc05373 bpo-32087: Doc: Make "deprecated-removed" directive translatable (GH-4473) 2018-02-23 20:47:19 +09:00
Serhiy Storchaka 520b7ae27e
bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter to compiler. (GH-5006)
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Antoine Pitrou <antoine@python.org>
2018-02-22 23:33:30 +02:00
Benjamin Peterson e9edee0b65
bpo-32008: don't use PROTOCOL_TLSv1 in example (GH-5789)
It's bad form to pin to an old version of TLS. ssl.SSLContext has the right
protocol default, so let's not pass anyway.
2018-02-20 21:55:01 -08:00
Harshul jain 52c6b89796 bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176) 2018-02-21 13:30:01 +09:00
Zackery Spytz 7a1e1786f9 bpo-32500: Correct the documentation for PySequence_Size() and PySequence_Length() (GH-5767)
Dropped the part that says: "For objects that do not provide sequence protocol".
2018-02-20 09:24:29 -08:00
Terry Jan Reedy 3fb813d2c6 bpo-31333: Fix typo in whatsnew/3.7.rst (GH-5744) 2018-02-18 21:46:49 +00:00
TROUVERIE Joachim e8eb972514 Correct venv doc (fix #32540) (#5736) 2018-02-18 11:52:36 -05:00
Ivan Levkivskyi 03e3c340a0
bpo-31333: Re-implement ABCMeta in C (#5273)
This adds C versions of methods used by ABCMeta that
improve performance of various ABC operations.
2018-02-18 12:41:58 +00:00
Andrew Svetlov 17ab8f0e8e
Fix a typo in asyncio docs (#5721) 2018-02-17 19:44:35 +02:00
Gerrit Holl 243d6d7126 DOC: fix documentation for copyright and credits (GH-5706)
Adapt documentation for `copyright` and `credits` to reality.  Previously, the documentation implied that all each of `copyright`,
`credits`, and `license`, would print a message to call the object in order to see the full text.  In reality, only `license` exhibits this
behaviour, and `copyright` and `credit` print their full text either when printed, displayed, or called.
2018-02-16 19:48:57 -08:00
Zackery Spytz 6887d86e9a bpo-32860: Fix a missing asterisk in the documentation for glob.iglob() (GH-5712) 2018-02-16 19:39:51 -08:00
Yury Selivanov bd093355a6
bpo-32436: Add docs for contextvars (#5685) 2018-02-16 11:47:54 -05:00
xpvpc b65cb163d6 Correct the code example in Python 3.7's What's New (GH-5696)
There was an extra dash in the example for re.sub().
2018-02-16 08:46:39 -08:00
Barry Warsaw 997b8c140e
Update and sync importlib.resources documentation (#5694) 2018-02-16 10:45:39 -05:00
Eitan Adler 3384d38d51 Fix installation instructions for *nix (GH-5605)
Remove pkg_add -r python from FreeBSD installation section.
Moved to OpenBSD.
2018-02-13 18:44:01 -08:00
Zackery Spytz 88c38a4049 bpo-27846: Delete incorrect note in base64 docs (GH-5666)
This note incorrectly stated that "Base64 has an expansion factor of 6
to 4" (it is actually 4 to 3). It was decided to remove the note.
2018-02-14 03:08:54 +03:00
Nick Coghlan aec7532ed3
bpo-30579: Docs for dynamic traceback creation (GH-5653) 2018-02-13 18:10:58 +10:00
Коренберг Марк 7766b96ab8 bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (#5449) 2018-02-12 14:47:42 -05:00
Pablo Galindo e14c010378 bpo-32815: Improve docs on the subprocess API *text* parameter (GH-5622)
Describe *text* as an alias for *universal_newlines* in more places that people are likely to be referred to.
2018-02-11 12:58:23 -08:00
Cheryl Sabella 988fb28431 bpo-11015: Update test.support documentation (GH-5610) 2018-02-11 23:10:42 +10:00
sblondon 8d1f2f4038 bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609)
The new link is given in a red box on the old page.
2018-02-10 17:39:43 -05:00
Serhiy Storchaka a445feb729
bpo-30688: Support \N{name} escapes in re patterns. (GH-5588)
Co-authored-by: Jonathan Eunice <jonathan.eunice@gmail.com>
2018-02-10 00:08:17 +02:00
Serhiy Storchaka 5bb0005f9f
Make formatting of some return codes conforming to the general style. (#5587) 2018-02-09 13:31:19 +02:00
Alan D Moore a48e78a0b7 bpo-32585: Add tkinter.ttk.Spinbox. (#5221) 2018-02-09 02:03:55 +02:00
Brice Gros fc1ce810f1 bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564)
Fixes the documentation for `subprocess.check_output()` not mentioning that the encoding and errors parameters were added in 3.6.
2018-02-06 16:46:29 -08:00
Paul Ganssle 22864bc8e4 Add What's new entry for datetime.fromisoformat (#5559)
Documents bpo-15873
2018-02-05 21:28:46 -05:00
Serhiy Storchaka 6c85efa5a6
bpo-32749: Make dbm.dumb databases more cosistent with other dbm databases. (#5497) 2018-02-05 22:47:31 +02:00
Dag Heyman c309bcfb9f Fix typo in whatsnew/3.7.rst (GH-5551)
now longer -> no longer
2018-02-05 09:39:33 -05:00
Mariatta 7a561afd2c
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)
`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.
2018-02-05 04:29:02 -05:00
Cheryl Sabella d1f318105b bpo-8722: Document __getattr__ behavior with AttributeError in property (GH-4754)
When `__getattr__` is implemented, attribute lookup will always fall back to that,
even if the initial failure comes from `__getattribute__` or a descriptor's `__get__`
method (including property methods).
2018-02-05 12:03:22 +10:00
Raymond Hettinger ca6c125f10
Fix typo -- missing "not" (GH-5528) 2018-02-04 09:15:01 -08:00
Serhiy Storchaka 07ca9afaa8
bpo-10544: Disallow "yield" in comprehensions and generator expressions. (GH-4564) 2018-02-04 10:53:48 +02:00
nathankerr96 8b5fa289fd bpo-32720: Fixed the definition for width and precision in format mini-language doc (GH-5482)
Changed the definition of width and precision from "integer" to "digit+" in format mini-language doc.
2018-02-04 00:42:08 -05:00
Leo Arias c3d9508ff2 bpo-32746: Fix multiple typos (GH-5144)
Fix typos found by codespell in docs, docstrings, and comments.
2018-02-03 19:36:10 -05:00
Raymond Hettinger 589c718a8e
bpo-32739: Show default value for rotate() (GH-5485) 2018-02-03 08:46:28 -08:00
Cheryl Sabella 66771422d0 bpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265)
Modify RE examples in documentation to use raw strings to prevent DeprecationWarning.
Add text to REGEX HOWTO to highlight the deprecation.  Approved by Serhiy Storchaka.
2018-02-02 16:16:27 -05:00
Barry Warsaw bbbcf8693b
bpo-32303 - Consistency fixes for namespace loaders (#5481)
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.

https://bugs.python.org/issue32303
https://bugs.python.org/issue32305
2018-02-02 15:15:58 -05:00
Yury Selivanov 383b32fe10
Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495
This reverts commit 72a0d218dc.

The reverted commit had a few issues so it was unanimously decided
to undo it. See the bpo issue for details.
2018-02-02 09:31:06 -05:00
Andrew Svetlov 3d4dbd8f01
Implement TimerHandle.when() (#5473) 2018-02-01 19:59:32 +02:00
Serhiy Storchaka 97f1ca1673
[3.8] bpo-31508: Remove support of arguments in tkinter.ttk.Treeview.selection. (GH-3651)
It was deprecated in 3.6.
2018-02-01 18:49:21 +02:00
Serhiy Storchaka 12e7cd8a51
bpo-32565: Add missed versionadded directives for all new opcodes. (#5199) 2018-02-01 13:48:33 +02:00
Stéphane Wirtel ab328756d7 bpo-32722: Remove useless example in the Classes tutorial (#5446)
In the tutorial about the Generator expression, there is an example with
a dict comprehension and not with a generator expression, just removed
the code.
2018-02-01 15:31:07 +08:00
Ned Deily 07a1892f82 Update Doc build to 3.8 2018-01-31 18:12:38 -05:00
Ned Deily 5489bdad51 Start of 3.8.0a0 2018-01-31 17:44:09 -05:00
Cheryl Sabella b299393cc3 bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
The f-string example for using datetime format specifier does not match the given output.
Changed the format from %b to %B so it matches the output of "January".
2018-01-31 16:37:51 -05:00
Xiang Zhang a29ddf4078
Make site documentation more clear (#5461)
Mention only ImportError caused by importing sitecustomize.py/usercustomize.py
themselves will be silently ignored.
2018-01-31 23:50:50 +08:00
Bernhard M. Wiedemann 84521047e4 bpo-30693: zip+tarfile: sort directory listing (#2263)
tarfile and zipfile now sort directory listing to generate tar and zip archives
in a more reproducible way.

See also https://reproducible-builds.org/docs/stable-inputs/ on that topic.
2018-01-31 11:17:10 +01:00
Stéphane Wirtel 67adb31a41 bpo-32724: Fix references to commands in Doc/pdb.rst (GH-5444)
Some commands are specified in the documentation, but there is no direct
references.
2018-01-30 11:34:33 +02:00
John Jolly 066df4fd45 bpo-22908: Add seek and tell functionality to ZipExtFile (GH-4966)
This allows for nested zip files, tar files within zip files, zip files within tar files, etc.

Contributed by: John Jolly
2018-01-30 00:51:35 -08:00
Anders Lorentsen dd42cb71f2 bpo-31961: subprocess now accepts path-like args (GH-4329)
Allow os.PathLike args in subprocess APIs.
2018-01-29 23:27:28 -08:00
Bo Bayles ce0f33d045 bpo-32102 Add "capture_output=True" to subprocess.run (GH-5149)
Add "capture_output=True" option to subprocess.run, this is equivalent to
setting stdout=PIPE, stderr=PIPE but is much more readable.
2018-01-29 22:40:39 -08:00
Bo Bayles ce237c7d58 bpo-21417: Add compresslevel= to the zipfile module (GH-5385)
This allows the compression level to be specified when writing zipfiles
(for the entire file *and* overridden on a per-file basis).

Contributed by Bo Bayles
2018-01-29 21:54:07 -08:00
Julien Palard 9424dcbb3e bpo-32701: Clarify the quotetabs flag in quopri documentation (GH-5401) 2018-01-29 19:36:06 -08:00
Mark Shannon 332cd5ee4f bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181) 2018-01-29 16:41:04 -08:00
Christian Heimes b6e43af669
bpo-28134: Auto-detect socket values from file descriptor (#1349)
Fix socket(fileno=fd) by auto-detecting the socket's family, type,
and proto from the file descriptor. The auto-detection can be overruled
by passing in family, type, and proto explicitly.

Without the fix, all socket except for TCP/IP over IPv4 are basically broken:

>>> s = socket.create_connection(('www.python.org', 443))
>>> s
<socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('2003:58:bc4a:3b00:56ee:75ff:fe47:ca7b', 59730, 0, 0), raddr=('2a04:4e42:1b::223', 443, 0, 0)>
>>> socket.socket(fileno=s.fileno())
<socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('2003:58:bc4a:3b00::%2550471192', 59730, 0, 2550471192), raddr=('2a04:4e42:1b:0:700c:e70b:ff7f:0%2550471192', 443, 0, 2550471192)>

Signed-off-by: Christian Heimes <christian@python.org>
2018-01-29 22:37:58 +01:00
Pablo Galindo 72a0d218dc bpo-31356: Add context manager to temporarily disable GC (GH-4224) 2018-01-29 12:37:09 -08:00
Raymond Hettinger e6d342156d
bpo-25988: Deprecate exposing collections.abc in collections GH-5414 2018-01-29 08:27:49 -08:00
Christian Heimes 892d66e422
bpo-31429: Define TLS cipher suite on build time (#3532)
Until now Python used a hard coded white list of default TLS cipher
suites. The old approach has multiple downsides. OpenSSL's default
selection was completely overruled. Python did neither benefit from new
cipher suites (ChaCha20, TLS 1.3 suites) nor blacklisted cipher suites.
For example we used to re-enable 3DES.

Python now defaults to OpenSSL DEFAULT cipher suite selection and black
lists all unwanted ciphers. Downstream vendors can override the default
cipher list with --with-ssl-default-suites.

Signed-off-by: Christian Heimes <christian@python.org>
2018-01-29 14:10:18 +01:00
Victor Stinner db8189bb8d
bpo-31233, bpo-31151: Document socketserver changes (#5417)
socketserver.ForkingMixIn.server_close() and
socketserver.ThreadingMixIn.server_close() now waits until all child
processes and non-daemonic threads complete.
2018-01-29 12:10:22 +01:00
Victor Stinner 2914bb32e2
bpo-20891: Py_Initialize() now creates the GIL (#4700)
The GIL is no longer created "on demand" to fix a race condition when
PyGILState_Ensure() is called in a non-Python thread.
2018-01-29 11:57:45 +01:00
cocoatomo 2a3260bb03 Fix minor markup typo (#5407) 2018-01-29 00:30:48 -08:00
Yury Selivanov 07627e9a6a
bpo-32251: Fix docs (#5408) 2018-01-28 23:51:08 -05:00
Gregory P. Smith f5b04a360e
Document the error return of PyLong_As* APIs. (#5396)
Document the error return of PyLong_As* APIs.

A frequent Python C API usage error is neglecting to check the return
value and/or PyErr_Occurred().
2018-01-28 17:48:31 -08:00
Steve Dower 15ea3a6a32
bpo-32699: Improves doc for .pth files in presense of a ._pth file (#5399) 2018-01-29 10:34:09 +11:00
Yury Selivanov f11b460d87
bpo-32373: Add socket.getblocking() method. (#4926) 2018-01-28 17:27:38 -05:00
Yury Selivanov 631fd38dbf
bpo-32251: Implement asyncio.BufferedProtocol. (#4755) 2018-01-28 16:30:26 -05:00
Yury Selivanov 0ceb717689
Revert "bpo-32221: makeipaddr(): remove interface part + speedup (GH-4724)" (#5394)
This reverts commit 47c0b1f7d4.
2018-01-28 16:08:32 -05:00
larryhastings f36ba12809
bpo-32697: Definition order of kwonly params is now guaranteed preserved. (#5391)
Definition order of kwonly params is now guaranteed preserved.
2018-01-28 11:13:09 -08:00
Yury Selivanov bec2372b7e
bpo-32327: Revert loop.run_in_executor behaviour: return a Future. (#5392)
I've run some tests on 3.7 asyncio and it appears that too many
things assume that run_in_executor returns a Future.
2018-01-28 14:09:40 -05:00
Xiang Zhang 79db11ce99
Fix PyTrace_RETURN documentation (GH-5384)
It will be triggered when propagating an exception.
2018-01-28 22:54:42 +08:00
Eric V. Smith 4d0296649a
Add example for PEP 557. (GH-5383) 2018-01-28 09:25:45 -05:00
jcea 6c51d51880
bpo-32659: Solaris "stat" should support "st_fstype" (#5307)
* bpo-32659: Solaris "stat" should support "st_fstype"

* Add 'versionadded'
2018-01-28 14:00:08 +01:00
Xiang Zhang 255f7a26da bpo-32649: Add C API docs for per-opcode tracing & profiling (GH-5360)
Updating the C API docs was missed when the per-opcode
tracing & profiling support was initially added.
2018-01-28 19:53:38 +10:00
Xiang Zhang 9ed0aee27c
bpo-32687: Fix wrong meaning of args for PyTrace_LINE/CALL in documentation (#5361) 2018-01-28 15:38:21 +08:00
Eric V. Smith c4b1248308
Pep 557 What's New (GH-5371)
Add PEP 557 Data CLasses to What's New.
2018-01-27 20:30:37 -05:00
Коренберг Марк 47c0b1f7d4 bpo-32221: makeipaddr(): remove interface part + speedup (GH-4724) 2018-01-27 17:20:50 -05:00
Elvis Pranskevichus ee72ac0683 bpo-32622: Fix AbstractEventLoop.sendfile signature in documentation. (GH-5368) 2018-01-27 17:11:10 -05:00
Andrew Svetlov 7c684073f9
bpo-32622: Implement loop.sendfile() (#5271) 2018-01-27 21:22:47 +02:00
Pablo Galindo 4defba3b95 bpo-31368: Expose preadv and pwritev in the os module (#5239) 2018-01-27 17:16:37 +01:00
Xiang Zhang 60da99b8e2
bpo-32532: Improve documentation of settrace and setprofile (#5359)
Mention in the documentation of settrace and setprofile that errors in the
registered handlers will cause themselves unset.
2018-01-27 23:04:47 +08:00