Commit Graph

21568 Commits

Author SHA1 Message Date
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
Christian Heimes 61d478c71c
bpo-31399: Let OpenSSL verify hostname and IP address (#3462)
bpo-31399: Let OpenSSL verify hostname and IP

The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and
X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses.

* Remove match_hostname calls
* Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host()
* Add documentation for OpenSSL 1.0.2 requirement
* Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform.
* Add hostname_checks_common_name

Signed-off-by: Christian Heimes <christian@python.org>
2018-01-27 15:51:38 +01:00
Christian Heimes d0e31b980f
bpo-32454: socket closefd (#5048)
Add close(fd) function to the socket module

Signed-off-by: Christian Heimes <christian@python.org>
2018-01-27 09:54:13 +01:00
Christian Heimes 2f050c7e1b
bpo-32433: Optimized HMAC digest (#5023)
The hmac module now has hmac.digest(), which provides an optimized HMAC
digest for short messages. hmac.digest() is up to three times faster
than hmac.HMAC().digest().

Signed-off-by: Christian Heimes <christian@python.org>
2018-01-27 09:53:43 +01:00
INADA Naoki a49ac99029
bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342) 2018-01-27 14:06:21 +09:00
Cheryl Sabella 85527cf50a bpo-27505: Add change notes in module attribute docs (GH-5320)
Make it clear that setting __class__ on a module has worked since 3.5,
but support for __getattr__ and __dir__ on module instances requires 3.7+

Patch by Cheryl Sabella.
2018-01-27 12:40:52 +10:00
Yury Selivanov 43c47fe096
bpo-32670: Enforce PEP 479. (#5327) 2018-01-26 15:24:24 -05:00
Guido van Rossum 95e4d58913 String annotations [PEP 563] (#4390)
* Document `from __future__ import annotations`
* Provide plumbing and tests for `from __future__ import annotations`
* Implement unparsing the AST back to string form

This is required for PEP 563 and as such only implements a part of the
unparsing process that covers expressions.
2018-01-26 08:20:18 -08:00
mwidjaja 863b1e4d0e bpo-29237: Create enum for pstats sorting options (GH-5103) 2018-01-25 20:49:56 -08:00
Bo Bayles 2fc98ae115 bpo-32304: Fix distutils upload for sdists ending with \x0d (GH-5264)
Patch by Bo Bayles.
2018-01-25 19:02:03 -05:00
Yury Selivanov c9070d03f5
bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)
* bpo-32662: Implement Server.start_serving() and Server.serve_forever()

New methods:

* Server.start_serving(),
* Server.serve_forever(), and
* Server.is_serving().

Add 'start_serving' keyword parameter to loop.create_server() and
loop.create_unix_server().
2018-01-25 18:08:09 -05:00
Ilya Kulakov 1aa094f740 bpo-29302: Implement contextlib.AsyncExitStack. (#4790) 2018-01-25 15:51:18 -05:00
Brett Cannon cab0b2b053
bpo-29708: Add What's New entries for SOURCE_DATE_EPOCH and py_compile (GH-5306) 2018-01-24 17:13:24 -08:00
Andrew Svetlov fe133aad52
bpo-32391: Implement StreamWriter.wait_closed() (#5281) 2018-01-25 00:30:30 +02:00
Paul Ganssle 04af5b1ba9 bpo-10381: Add timezone to datetime C API (#5032)
* Add timezone to datetime C API

* Add documentation for timezone C API macros

* Add dedicated tests for datetime type check macros

* Remove superfluous C API test

* Drop support for TimeZoneType in datetime C API

* Expose UTC singleton to the datetime C API

* Update datetime C-API documentation to include links

* Add reference count information for timezone constructors
2018-01-24 17:29:30 -05:00
Bernhard M. Wiedemann ccbe5818af bpo-29708: Setting SOURCE_DATE_EPOCH forces hash-based .pyc files (GH-5200)
To support reproducible builds, the setting of of SOURCE_DATE_EPOCH triggers the py_compile module -- and by extension, compileall -- to forcibly compile with hash-based .pyc files. This eliminates the possibility of timestamp-based .pyc files which vary between builds.
2018-01-24 13:26:18 -08:00
Barry Warsaw 6f6eb35f9b
bpo-32248 - Implement `ResourceReader` and `get_resource_reader()` for zipimport (#5248) 2018-01-24 15:36:21 -05:00
Barry Warsaw d499031f5f
bpo-32651 Recommend getpass.getuser() (#5301)
* bpo-32651 - In the documentation for os.getlogin(), recommend getpass.getuser()
2018-01-24 12:51:29 -05:00
Pablo Galindo 131fd7f96c bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056) 2018-01-24 20:57:49 +08:00
Victor Stinner 9089a26591
bpo-29240: PyUnicode_DecodeLocale() uses UTF-8 on Android (#5272)
PyUnicode_DecodeLocaleAndSize(), PyUnicode_DecodeLocale() and
PyUnicode_EncodeLocale() now use always use the UTF-8 encoding on
Android, instead of the current locale encoding.

On Android API 19, mbstowcs() and wcstombs() are broken and cannot be
used.
2018-01-22 19:07:32 +01:00
Victor Stinner 13ff24582c
bpo-32593: Drop FreeBSD 9 and older support (#5232)
Drop support of FreeBSD 9 and older.
2018-01-22 18:32:50 +01:00
Ethan Furman a4b1bb4801
bpo-31801: Enum: add _ignore_ as class option (#5237)
* bpo-31801:  Enum:  add _ignore_ as class option

_ignore_ is a list, or white-space seperated str, of names that will not
be candidates for members; these names, and _ignore_ itself, are removed
from the final class.

* bpo-31801:  Enum:  add documentation for _ignore_

* bpo-31801: Enum: remove trailing whitespace

* bpo-31801: Enum: fix bulleted list format

* bpo-31801: add version added for _ignore_
2018-01-22 07:56:37 -08:00
Nathaniel J. Smith fc2f407829 bpo-32591: Add native coroutine origin tracking (#5250)
* Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth
* Use coroutine origin information in the unawaited coroutine warning
* Stop using set_coroutine_wrapper in asyncio debug mode
* In BaseEventLoop.set_debug, enable debugging in the correct thread
2018-01-21 09:44:07 -05:00
Sanyam Khurana 338cd83c5d bpo-25910: Link redirections in docs (#1933)
Fixes some redirection links in docs.
2018-01-20 01:25:37 +01:00
Andrew Svetlov 7464e87a65
bpo-32410: Make SendfileNotAvailableError exception public (#5243) 2018-01-19 20:04:29 +02:00
Andrew Svetlov 6b5a27975a
bpo-32410: Implement loop.sock_sendfile() (#4976) 2018-01-16 19:59:34 +02:00
Antoine Pitrou 94e1696d04
bpo-14976: Reentrant simple queue (#3346)
Add a queue.SimpleQueue class, an unbounded FIFO queue with a reentrant C implementation of put().
2018-01-16 00:27:16 +01:00
Victor Stinner cb064fc232
bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174)
* Add _Py_GetLocaleconvNumeric() function: decode decimal_point and
  thousands_sep fields of localeconv() from the LC_NUMERIC encoding,
  rather than decoding from the LC_CTYPE encoding.
* Modify locale.localeconv() and "n" formatter of str.format() (for
  int, float and complex to use _Py_GetLocaleconvNumeric()
  internally.
2018-01-15 15:58:02 +01:00
Victor Stinner 7ed7aead95
bpo-29240: Fix locale encodings in UTF-8 Mode (#5170)
Modify locale.localeconv(), time.tzname, os.strerror() and other
functions to ignore the UTF-8 Mode: always use the current locale
encoding.

Changes:

* Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx(). On decoding or
  encoding error, they return the position of the error and an error
  message which are used to raise Unicode errors in
  PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale().
* Replace _Py_DecodeCurrentLocale() with _Py_DecodeLocaleEx().
* PyUnicode_DecodeLocale() now uses _Py_DecodeLocaleEx() for all
  cases, especially for the strict error handler.
* Add _Py_DecodeUTF8Ex(): return more information on decoding error
  and supports the strict error handler.
* Rename _Py_EncodeUTF8_surrogateescape() to _Py_EncodeUTF8Ex().
* Replace _Py_EncodeCurrentLocale() with _Py_EncodeLocaleEx().
* Ignore the UTF-8 mode to encode/decode localeconv(), strerror()
  and time zone name.
* Remove PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
  and PyUnicode_EncodeLocale() now ignore the UTF-8 mode: always use
  the "current" locale.
* Remove _PyUnicode_DecodeCurrentLocale(),
  _PyUnicode_DecodeCurrentLocaleAndSize() and
  _PyUnicode_EncodeCurrentLocale().
2018-01-15 10:45:49 +01:00
Cheryl Sabella ee3b83547c bpo-26330: Update shutil.disk_usage() documentation (GH-5184)
Clarify that on Windows, path must be a directory.
On Unix, path can be a file or a directory.
2018-01-14 21:08:37 -08:00
Cheryl Sabella b3dd18d403 bpo-15221: Update os.path.is*() documentation (GH-5185)
`os.path.is*()` can return False if the file can't be accessed.
The behaviour is documented in details in `os.path.exists()`.
Link to `os.path.exists()` from `os.path.is*()`.
2018-01-14 20:57:51 -08:00
Raymond Hettinger d37258dd2e
Add itertools recipe for directly finding the n-th combination (#5161) 2018-01-13 10:35:40 -08:00
Julian Kahnert 0f31c74fcf Improve enum.Flag code example (GH-5167)
The code example that demonstrate how to use enum.Flag was missing
the import of enum.auto.
2018-01-12 19:35:57 -08:00
Brett Cannon bca42186b6
bpo-32248: Introduce the concept of Loader.get_resource_reader() (GH-5108) 2018-01-12 15:08:59 -08:00
İsmail Arılık 3764bb075a Lexical Analysis ref doc: Fix a typo in the string concatenation internal link (GH-5157)
In lexical analysis reference documentation, the internal link to
the string literal concatenation section was written as`.. _string-catenation:`.
Changed that to `.. _string-concatenation:`.
2018-01-11 22:18:54 -08:00
Raymond Hettinger 0c3be9651f
bpo-31145: Use dataclasses to create a prioritization wrapper (#5153) 2018-01-11 22:06:34 -08:00
Raymond Hettinger 02556fbade
bpo-32467: Let collections.abc.ValuesView inherit from Collection (#5152) 2018-01-11 21:53:49 -08:00
Raymond Hettinger 3948207c61
bpo-32320: Add default value support to collections.namedtuple() (#4859) 2018-01-10 21:45:19 -08:00
Nick Coghlan 9b99747386
bpo-31975 (PEP 565): Show DeprecationWarning in __main__ (GH-4458)
- primary change is to add a new default filter entry for
  'default::DeprecationWarning:__main__'
- secondary change is an internal one to cope with plain
  strings in the warning module's internal filter list
  (this avoids the need to create a compiled regex object
  early on during interpreter startup)
- assorted documentation updates, including many more
  examples of configuring the warnings settings
- additional tests to ensure that both the pure Python and
  the C accelerated warnings modules have the expected
  default configuration
2018-01-08 12:45:02 +10:00
Paul Ganssle 85ac726a40 Cleanup grammar in unittest.mock.seal documentation (#5107) 2018-01-06 15:25:34 +02:00
Mario Corchero 9f1e5f1b7f bpo-32206: Pdb can now run modules (GH-4752)
Add a new argument "-m" to the pdb module to allow
users to run `python -m pdb -m my_module_name`.

This relies on private APIs in the runpy module to work,
but we can get away with that since they're both part of
the standard library and can be updated together if
the runpy internals get refactored.
2018-01-06 17:53:05 +10:00
Nathaniel J. Smith 735ae8d139 bpo-29137: Remove fpectl module (#4789)
This module has never been enabled by default, never worked correctly
on x86-64, and caused ABI problems that caused C extension
compatibility. See bpo-29137 for details/discussion.
2018-01-05 23:15:34 -08:00
Benjamin Peterson 65f2a6dcc2
advance copyright years to 2018 (#5094) 2018-01-04 22:34:19 -08:00
Serhiy Storchaka 87be28f4a1
bpo-31672: Restore the former behavior when override flags in Template. (#5099)
Overriding flags to 0 will make the default pattern matching only
lower case letters.
2018-01-04 19:20:11 +02:00
Serhiy Storchaka fbb490fd2f
bpo-32308: Replace empty matches adjacent to a previous non-empty match in re.sub(). (#4846) 2018-01-04 11:06:13 +02:00
Emily Morehouse f190eb59e6 bpo-32452: clarify term 'brackets' in generator tutorial (#5079)
Updates documentation for generator expressions in classes tutorial: Clarify usage of ambiguous term "brackets" by replacing with "square brackets". Updated subsequent lines to respect line breaks. (#5079)
2018-01-01 20:34:53 -05:00
Barry Warsaw deae6b451f
bpo-32248 - Implement importlib.resources (#4911)
Port importlib_resources to importlib.resources
2017-12-30 15:18:06 -05:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 1634fc289a bpo-32418: Add get_loop() method on Server, AbstractServer classes (#4997)
* Add abstract get_loop() method to Server, AbstractServer classes.
* Add test cases for get_loop() method in Server, AbstractServer classes
* Add documentation for get_loop() method
2017-12-30 17:09:32 +02:00
Yury Selivanov f111b3dcb4
bpo-23749: Implement loop.start_tls() (#5039) 2017-12-30 00:35:36 -05:00
Benjamin Peterson bbdb17d19b
return the new file descriptor from os.dup2 (closes bpo-32441) (#5041) 2017-12-29 13:13:06 -08:00
Yury Selivanov ca9b36cd1a
bpo-32415: Add asyncio.Task.get_loop() and Future.get_loop() (#4992) 2017-12-23 15:04:15 -05:00
Sebastian Pucilowski a8d25a1645 Fix trivial typo in pickle.rst (#4955) 2017-12-21 11:00:49 +02:00
Paul Ganssle 09dc2f508c bpo-15873: Implement [date][time].fromisoformat (#4699)
Closes bpo-15873.
2017-12-21 00:33:49 -05:00
INADA Naoki 507434fd50
bpo-15216: io: TextIOWrapper.reconfigure() accepts encoding, errors and newline (GH-2343) 2017-12-21 09:59:53 +09:00
Andrew Svetlov 51eb1c6b9c
bpo-29970: Make ssh_handshake_timeout None by default (#4939)
* Make ssh_handshake_timeout None by default.
* Raise ValueError if ssl_handshake_timeout is used without ssl.
* Raise ValueError if ssl_handshake_timeout is not positive.
2017-12-20 20:24:43 +02:00
Antoine Pitrou a7a751dd7b
bpo-32306: Clarify c.f.Executor.map() documentation (#4947)
The built-in map() function collects function arguments lazily, but concurrent.futures.Executor.map() does so eagerly.
2017-12-20 19:06:20 +01:00
Marcel Plch 776407fe89 bpo-31901: atexit callbacks should be run at subinterpreter shutdown (#4611)
Change atexit behavior and PEP-489 multiphase init support.
2017-12-20 11:17:58 +01:00
KatherineMichel f4e21a2a72 Improve the F-strings and format specifier documentation (GH-4931)
Mention that the format-specifier mini language in f-strings
is the same one used by str.format.
2017-12-19 13:03:09 -08:00
Neil Aspinall f7686c1f55 bpo-29970: Add timeout for SSL handshake in asyncio
10 seconds by default.
2017-12-19 21:45:42 +02:00
Antoine Pitrou 4b965930e8
bpo-32377: improve __del__ docs and fix mention about resurrection (#4927)
* Fix #32377: improve __del__ docs and fix mention about resurrection

* Mention that CPython only calls __del__ once.
2017-12-19 19:48:45 +01:00
Yury Selivanov 9818142b1b
bpo-32331: Fix socket.type when SOCK_NONBLOCK is available (#4877) 2017-12-18 20:02:54 -05:00
Yury Selivanov d757aaf9dd
bpo-32356: idempotent pause_/resume_reading; new is_reading method. (#4914) 2017-12-18 17:03:23 -05:00
Segev Finer b2a6083eb0 bpo-19764: Implemented support for subprocess.Popen(close_fds=True) on Windows (#1218)
Even though Python marks any handles it opens as non-inheritable there
is still a race when using `subprocess.Popen` since creating a process
with redirected stdio requires temporarily creating inheritable handles.
By implementing support for `subprocess.Popen(close_fds=True)` we fix
this race.

In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST
which is available since Windows Vista. Which allows to pass an explicit
list of handles to inherit when creating a process.

This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]`
which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST
directly.
2017-12-18 10:28:19 +01:00
Nathaniel J. Smith 902ab80b59 bpo-30050: Allow disabling full buffer warnings in signal.set_wakeup_fd (#4792) 2017-12-17 23:10:18 -05:00
Andrew Svetlov 44d1a5912e
bpo-32250: Implement asyncio.current_task() and asyncio.all_tasks() (#4799) 2017-12-16 21:58:38 +02:00
Victor Stinner 9454060e84
bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)
bpo-29240, bpo-32030: If the encoding change (C locale coerced or
UTF-8 Mode changed), Py_Main() now reads again the configuration with
the new encoding.

Changes:

* Add _Py_UnixMain() called by main().
* Rename pymain_free_pymain() to pymain_clear_pymain(), it can now be
  called multipled times.
* Rename pymain_parse_cmdline_envvars() to pymain_read_conf().
* Py_Main() now clears orig_argc and orig_argv at exit.
* Remove argv_copy2, Py_Main() doesn't modify argv anymore. There is
  no need anymore to get two copies of the wchar_t** argv.
* _PyCoreConfig: add coerce_c_locale and coerce_c_locale_warn.
* Py_UTF8Mode is now initialized to -1.
* Locale coercion (PEP 538) now respects -I and -E options.
2017-12-16 04:54:22 +01:00
Brett Cannon 4ac5150e06
bpo-32248: Implement importlib.abc.ResourceReader (GH-4892) 2017-12-15 16:29:35 -08:00
Raymond Hettinger 6693d7af66
Minor wording tweak for itertools documentation (#4893) 2017-12-15 13:17:55 -08:00
Mariatta d924fa523d
F-strings docs: link to Format Specifiers (GH-4888)
Link to the Format Specification Mini Language section from f-strings' documentation.
2017-12-15 10:07:01 -08:00
Victor Stinner 642d67b4f2
bpo-32329: Add versionchanged to -R option doc (#4884) 2017-12-15 16:29:01 +01:00
Serhiy Storchaka 3327a2ddf1
bpo-32265: Classify class and static methods of builtin types. (#4776)
Add types.ClassMethodDescriptorType for unbound class methods.
2017-12-15 14:13:41 +02:00
Serhiy Storchaka a5552f023e
bpo-32240: Add the const qualifier to declarations of PyObject* array arguments. (#4746) 2017-12-15 13:11:11 +02:00
Ville Skyttä 297fd876aa bpo-28393: Update encoding lookup docs wrt bpo-27938 (#4871) 2017-12-15 11:19:23 +01:00
Andrew Svetlov f74ef458ab
bpo-32311: Implement asyncio.create_task() shortcut (#4848)
* Implement functionality
* Add documentation
2017-12-15 07:04:38 +02:00
Yury Selivanov 19a44f63c7
bpo-32327: Convert asyncio functions documented as coroutines to coroutines. (#4872) 2017-12-14 20:53:26 -05:00
Victor Stinner 358e5e17a5
bpo-32329: Fix -R option for hash randomization (#4873)
bpo-32329, bpo-32030:

* The -R option now turns on hash randomization when the
  PYTHONHASHSEED environment variable is set to 0 Previously, the
  option was ignored.
* sys.flags.hash_randomization is now properly set to 0 when hash
  randomization is turned off by PYTHONHASHSEED=0.
* _PyCoreConfig_ReadEnv() now reads the PYTHONHASHSEED environment
  variable. _Py_HashRandomization_Init() now only apply the
  configuration, it doesn't read PYTHONHASHSEED anymore.
2017-12-15 00:51:22 +01:00
Giuseppe Scrivano 96a5e50a5d bpo-32143: add f_fsid to os.statvfs() (#4571)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2017-12-14 17:46:46 -05:00
Yury Selivanov 02a0a19206
bpo-32314: Implement asyncio.run() (#4852) 2017-12-14 09:42:21 -05:00
Mike 53f7a7c281 bpo-32297: Few misspellings found in Python source code comments. (#4803)
* Fix multiple typos in code comments

* Add spacing in comments (test_logging.py, test_math.py)

* Fix spaces at the beginning of comments in test_logging.py
2017-12-14 13:04:53 +02:00
Ivan Levkivskyi 5364b5cd75
bpo-32225: Implementation of PEP 562 (#4731)
Implement PEP 562: module __getattr__ and __dir__.
The implementation simply updates module_getattro and
module_dir.
2017-12-14 11:59:44 +01:00
INADA Naoki 7ea143ae79
bpo-29469: Move constant folding to AST optimizer (GH-2858) 2017-12-14 16:47:20 +09:00
Jelle Zijlstra 176baa326b bpo-30241: implement contextlib.AbstractAsyncContextManager (#1412) 2017-12-13 20:19:17 -05:00
jimmy 4f29f3c84b trivial: link updates in documentation (#2765) 2017-12-13 14:37:51 +02:00
Victor Stinner 91106cd9ff
bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)
* Add -X utf8 command line option, PYTHONUTF8 environment variable
  and a new sys.flags.utf8_mode flag.
* If the LC_CTYPE locale is "C" at startup: enable automatically the
  UTF-8 mode.
* Add _winapi.GetACP(). encodings._alias_mbcs() now calls
  _winapi.GetACP() to get the ANSI code page
* locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8
  mode. As a side effect, open() now uses the UTF-8 encoding by
  default in this mode.
* Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding
  in the UTF-8 Mode.
* Update subprocess._args_from_interpreter_flags() to handle -X utf8
* Skip some tests relying on the current locale if the UTF-8 mode is
  enabled.
* Add test_utf8mode.py.
* _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to
  return also the length (number of wide characters).
* pymain_get_global_config() and pymain_set_global_config() now
  always copy flag values, rather than only copying if the new value
  is greater than the old value.
2017-12-13 12:29:09 +01:00
Sebastian Rittau c3e070f849 bpo-32284: Fix documentation of BinaryIO and TextIO (#4832) 2017-12-13 10:39:55 +02:00
Victor Stinner 747f48e2e9
bpo-32230: Set sys.warnoptions with -X dev (#4820)
Rather than supporting dev mode directly in the warnings module, this
instead adjusts the initialisation code to add an extra 'default'
entry to sys.warnoptions when dev mode is enabled.

This ensures that dev mode behaves *exactly* as if `-Wdefault` had
been passed on the command line, including in the way it interacts
with `sys.warnoptions`, and with other command line flags like `-bb`.

Fix also bpo-20361: have -b & -bb options take precedence over any
other warnings options.

Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
2017-12-12 22:59:48 +01:00
Serhiy Storchaka 4ae06c5337
bpo-32241: Add the const qualifire to declarations of umodifiable strings. (#4748) 2017-12-12 13:55:04 +02:00
Nitish Chandra 5ce0a2a100 bpo-31942: Document optional support of start and stop attributes in Sequence.index method (#4277) 2017-12-12 11:22:30 +01:00
Łukasz Langa e56975351b
bpo-32227: functools.singledispatch supports registering via type annotations (#4733) 2017-12-11 13:56:31 -08:00
Andrew Svetlov 8874342cf3
bpo-32258: Replace 'yield from' to 'await' in asyncio docs (#4779)
* Replace 'yield from' to 'await' in asyncio docs

* Fix docstrings
2017-12-11 17:35:49 +02:00
Yury Selivanov abae67ebc2
Add asyncio.get_running_loop() function. (#4782) 2017-12-11 10:07:44 -05:00
Yury Selivanov 9edad3c701
bpo-32272: Remove asyncio.async() function. (#4784) 2017-12-11 10:03:48 -05:00
Sanyam Khurana 1b74f9b77a bpo-22671: Clarify and test default read method implementations (#4568)
Original patch written by Martin Panter, enhanced by Sanyam Khurana.
2017-12-11 14:42:09 +01:00
Pablo Galindo 77106b2c21 bpo-32114: Updated the documentation for get_event_loop to reflect the policy change (#4510) 2017-12-10 12:34:59 -05:00
Benjamin Peterson 42aa93b8ff
closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)
Python now supports checking bytecode cache up-to-dateness with a hash of the
source contents rather than volatile source metadata. See the PEP for details.

While a fairly straightforward idea, quite a lot of code had to be modified due
to the pervasiveness of pyc implementation details in the codebase. Changes in
this commit include:

- The core changes to importlib to understand how to read, validate, and
  regenerate hash-based pycs.

- Support for generating hash-based pycs in py_compile and compileall.

- Modifications to our siphash implementation to support passing a custom
  key. We then expose it to importlib through _imp.

- Updates to all places in the interpreter, standard library, and tests that
  manually generate or parse pyc files to grok the new format.

- Support in the interpreter command line code for long options like
  --check-hash-based-pycs.

- Tests and documentation for all of the above.
2017-12-09 10:26:52 -08:00
Andrew Svetlov 28d8d14013
bpo-32253: Deprecate with statement and bare await for asyncio locks (GH-4764)
* Add test for 'with (yield from lock)'
* Deprecate with statement for asyncio locks
* Document the deprecation
2017-12-09 20:00:05 +02:00
Vinay Sajip a9f8df646a
bpo-32212: Updated logging documentation to make parameter names more consistent with source. (GH-4765) 2017-12-09 11:09:04 +00:00
Garrett Berg a0374dd34a bpo-32208: update threading.Semaphore docs and add unit test (#4709)
* fix issue32208: update threading.Semaphore docs and add unit test to validate correct behavior

* add test for blocking

* Update threading.rst

* semaphore: remove documentation validation tests and move 'return value' test to BaseSemaphore
2017-12-07 20:04:26 +02:00
Sanyam Khurana 1b4587a246 bpo-25910: Fixes redirection from http to https (#4674) 2017-12-06 17:39:33 +01:00
Julien Palard ae342cf7de Add a missing space in tkinter documentation. (GH-4692) 2017-12-04 21:05:33 -08:00
Neil Schemenauer 8837dd092f
bpo-19610: Warn if distutils is provided something other than a list to some fields (#4685)
* Rather than raise TypeError, warn and call list() on the value.

* Fix tests, revise NEWS and whatsnew text.

* Revise documentation, a string is okay as well.

* Ensure 'requires' and 'obsoletes' are real lists.

* Test that requires and obsoletes are turned to lists.
2017-12-04 18:58:12 -08:00
Victor Stinner 31a8393cf6
Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)" (#4694)
* Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)"

This reverts commit 13badcbc60.

Re-apply commits:

* "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)"
  commit af5a895073.
* "bpo-32030: Fix config_get_program_name() on macOS (#4669)"
  commit e23c06e2b0.
* "bpo-32030: Add Python/pathconfig.c (#4668)"
  commit 0ea395ae96.
* "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)"
  commit ebac19dad6.
* "bpo-32030: Fix Py_GetPath(): init program_name (#4665)"
  commit 9ac3d88827.

* Fix compilation error on macOS
2017-12-04 13:39:15 +01:00
Serhiy Storchaka 70d56fb525
bpo-25054, bpo-1647489: Added support of splitting on zerowidth patterns. (#4471)
Also fixed searching patterns that could match an empty string.
2017-12-04 14:29:05 +02:00
Julien Palard 7324b5ce8e bpo-31589 : Build PDF using xelatex for better UTF8 support. (#3940)
Also addresses doc build failures documented in bpo-32200.
2017-12-02 17:24:39 -05:00
Serhiy Storchaka 13badcbc60
bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)
* Revert "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)"

This reverts commit af5a895073.

* Revert "bpo-32030: Fix config_get_program_name() on macOS (#4669)"

This reverts commit e23c06e2b0.

* Revert "bpo-32030: Add Python/pathconfig.c (#4668)"

This reverts commit 0ea395ae96.

* Revert "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)"

This reverts commit ebac19dad6.

* Revert "bpo-32030: Fix Py_GetPath(): init program_name (#4665)"

This reverts commit 9ac3d88827.
2017-12-02 21:36:00 +02:00
Victor Stinner af5a895073
bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)
_PyPathConfig_Init() now also initialize home and program_name:

* Rename existing _PyPathConfig_Init() to _PyPathConfig_Calculate().
  Add a new _PyPathConfig_Init() function in pathconfig.c which
  handles the _Py_path_config variable and call
  _PyPathConfig_Calculate().
* Add home and program_name fields to _PyPathConfig.home
* _PyPathConfig_Init() now initialize home and program_name
  from main_config
* Py_SetProgramName(), Py_SetPythonHome() and Py_GetPythonHome() now
  calls Py_FatalError() on failure, instead of silently ignoring
  failures.
* config_init_home() now gets directly _Py_path_config.home to only
  get the value set by Py_SetPythonHome(), or NULL if
  Py_SetPythonHome() was not called.
* config_get_program_name() now gets directly
  _Py_path_config.program_name to only get the value set by
  Py_SetProgramName(), or NULL if Py_SetProgramName() was not called.
* pymain_init_python() doesn't call Py_SetProgramName() anymore,
  _PyPathConfig_Init() now always sets the program name
* Call _PyMainInterpreterConfig_Read() in
  pymain_parse_cmdline_envvars_impl() to control the memory allocator
* C API documentation: it's no more safe to call Py_GetProgramName()
  before Py_Initialize().
2017-12-02 10:11:32 +01:00
Serhiy Storchaka 73a7e9b10b bpo-10544: Deprecate "yield" in comprehensions and generator expressions. (GH-4579)
The current behaviour of yield expressions inside comprehensions  and
generator expressions is essentially an accident of implementation - it
arises implicitly from the way the compiler handles yield expressions inside
nested functions and generators.

Since the current behaviour wasn't deliberately designed, and is inherently
confusing, we're deprecating it, with no current plans to reintroduce it.
Instead, our advice will be to use a named nested generator definition
for cases where this behaviour is desired.
2017-12-01 14:54:17 +10:00
Victor Stinner b4d1e1f7c1
bpo-20891: Fix PyGILState_Ensure() (#4650)
When PyGILState_Ensure() is called in a non-Python thread before
PyEval_InitThreads(), only call PyEval_InitThreads() after calling
PyThreadState_New() to fix a crash.

Add an unit test in test_embed.
2017-11-30 22:05:00 +01:00
Victor Stinner 5e3806f8cf
bpo-32101: Add PYTHONDEVMODE environment variable (#4624)
* bpo-32101: Add sys.flags.dev_mode flag
  Rename also the "Developer mode" to the "Development mode".
* bpo-32101: Add PYTHONDEVMODE environment variable
  Mention it in the development chapiter.
2017-11-30 11:40:24 +01:00
Jesse-Bakker 706e10b186 bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format (#4534)
* Add most_recent_first parameter to tracemalloc.Traceback.format to allow
   reversing the order of the frames in the output
* Reversed default sorting of tracemalloc.Traceback frames
* Allowed negative limit, truncating from the other side.
2017-11-30 00:05:07 +01:00
Victor Stinner 5d39e04290
bpo-32030: Rework memory allocators (#4625)
* Fix _PyMem_SetupAllocators("debug"): always restore allocators to
  the defaults, rather than only caling _PyMem_SetupDebugHooks().
* Add _PyMem_SetDefaultAllocator() helper to set the "default"
  allocator.
* Add _PyMem_GetAllocatorsName(): get the name of the allocators
* main() now uses debug hooks on memory allocators if Py_DEBUG is
  defined, rather than calling directly malloc()
* Document default memory allocators in C API documentation
* _Py_InitializeCore() now fails with a fatal user error if
  PYTHONMALLOC value is an unknown memory allocator, instead of
  failing with a fatal internal error.
* Add new tests on the PYTHONMALLOC environment variable
* Add support.with_pymalloc()
* Add the _testcapi.WITH_PYMALLOC constant and expose it as
   support.with_pymalloc().
* sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so
   replace it with support.with_pymalloc().
* pythoninfo: add _testcapi collector for pymem
2017-11-29 17:20:38 +01:00
Barry Warsaw 23df2d1304
bpo-32107 - Improve MAC address calculation and fix test_uuid.py (#4600)
``uuid.getnode()`` now preferentially returns universally administered MAC addresses if available, over locally administered MAC addresses.  This makes a better guarantee for global uniqueness of UUIDs returned from ``uuid.uuid1()``.  If only locally administered MAC addresses are available, the first such one found is returned.

Also improve internal code style by being explicit about ``return None`` rather than falling off the end of the function.

Improve the test robustness.
2017-11-28 17:26:04 -05:00
Serhiy Storchaka c615be5166
Use raw strings in the re module examples. (#4616) 2017-11-28 22:51:38 +02:00
Victor Stinner ac577d7d0b
bpo-32154: Remove asyncio.windows_utils.socketpair (#4609) 2017-11-28 21:33:20 +01:00
Jonas Haag 4d193bcc25 bpo-32071: Fix regression and add What's New entry (#4589)
* bpo-32071: Fix an undocumented behaviour regression

* bpo-32071: Add 3.7 release note entry for unittest -k
2017-11-28 20:40:44 +01:00
Dong-hee Na a489599793 bpo-32046: Update 2to3 when converts operator.isCallable(obj). (#4417) 2017-11-28 11:26:56 -05:00
Serhiy Storchaka 598ceae876
bpo-32150: Expand tabs to spaces in C files. (#4583) 2017-11-28 17:56:10 +02:00
Victor Stinner 4271dfd781
bpo-32154: Remove asyncio.selectors (#4605)
* Remove asyncio.selectors and asyncio._overlapped symbols from the
  namespace of the asyncio module
* Replace "from asyncio import selectors" with "import selectors"
* Replace "from asyncio import _overlapped" with "import _overlapped"

asyncio.selectors was added to support Python 3.3, which doesn't have
selectors in its standard library, and Python 3.4 in the same code
base. Same rationale for asyncio._overlapped. Python 3.3 reached its
end of life, and asyncio is no more maintained as a third party
module on PyPI.
2017-11-28 15:19:56 +01:00
Ned Deily 122fc136b3
Revert "bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346)" (#4592)
Fix breakage documented in bpo-32149.
This reverts commit d8d6b91221.
2017-11-27 17:07:32 -05:00
Jason Yang c172fc5031 bpo-32051: Fix name shadowing in multiprocessing docs (GH-4469) 2017-11-27 04:18:33 +03:00
Mandeep Singh ede2ac913e bpo-23033: Improve SSL Certificate handling (GH-937)
Wildcard is now supported in hostname when it is one and only character in
the leftmost segment.
2017-11-26 14:31:27 -08:00
Ivan Levkivskyi 0cd2e81bea bpo-29879: Update typing documentation. (GH-4573)
- Add "version added: 3.5.2" note where it was missing.
- Remove the mention that Reversible is new in 3.5.2
2017-11-26 14:23:02 -08:00
Caleb Hattingh d8d6b91221 bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346) 2017-11-26 15:18:30 -06:00
Jonas Haag 5b48dc638b bpo-32071: Add unittest -k option (#4496)
* bpo-32071: Add unittest -k option
2017-11-25 16:23:52 +01:00
Berker Peksag 8d9bb11d8f
bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537)
Previously, netrc.netrc() was raised an exception if $HOME is not set.

Authored-By: Dimitri Merejkowsky <dimitri.merejkowsky@tanker.io>
2017-11-25 13:37:22 +03:00
Mariatta 9d5ec808de
Improve Scheduler Objects documentation. (GH-4556)
Mention that the lower the priority number, the higher priority it represents.
2017-11-24 21:43:01 -08:00
Mandeep Bhutani 610e5afdcb bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443)
The provided code example was supposed to find repeated words, however it returned false results.
2017-11-24 20:56:00 -08:00
Ashley Camba f8802d80b3 Asyncion-Dev docs: Fix the reference to sys.excepthook (GH-4414) 2017-11-24 15:39:39 -08:00
Victor Stinner 84c4b1938f
bpo-32124: Document C functions safe before init (#4540)
Explicitly document C functions and C variables that can be set
before Py_Initialize().
2017-11-24 22:30:27 +01:00
Will White 78a5722ae9 Improve the String tutorial docs (GH-4541)
The paragraph that contains example of string literal concatenation was placed
after the section about concatenation using the '+' sign.
Moved the paragraph to the appropriate section.
2017-11-24 09:28:12 -08:00
Emanuele Gaifas cdfe910e74 Extending Python Doc minor updates (GH-4518)
Move footnote markers to be closer to the related terminology:
before the end of the sentence, instead of after.
2017-11-24 00:49:57 -08:00
Berker Peksag 3df02dbc8e bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529) 2017-11-23 15:40:26 -08:00
Raymond Hettinger 0858495a50
bpo-32099 Add deque variant of roundrobin() recipe (#4497)
* Minor wording tweaks
2017-11-23 13:32:23 -08:00
Berker Peksag dcaed6b2d9
bpo-19610: setup() now raises TypeError for invalid types (GH-4519)
The Distribution class now explicitly raises an
exception when 'classifiers', 'keywords' and
'platforms' fields are not specified as a list.
2017-11-23 21:34:20 +03:00
Jesse-Bakker 0784a2e5b1 bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Adds a simpler and faster alternative to ExitStack for handling
single optional context managers without having to change the
lexical structure of your code.
2017-11-23 10:23:28 +10:00
AraHaan 431665bf19 bpo-32105: add asyncio.BaseEventLoop.connect_accepted_socket versionadded to documentation. (#4491) 2017-11-21 11:06:26 -05:00
Barry Warsaw e256b40888
bpo-31672 - Add one last minor clarification for idpattern (#4483)
Add one last minor clarification for idpattern
2017-11-21 10:28:13 -05:00
Raymond Hettinger 337cbbace0
Add comment and improve variable name in roundrobin() (#4486) 2017-11-21 00:23:34 -08:00
Victor Stinner bc9b6e29cb
bpo-32043: Rephrase -X dev documentation (#4478)
* should not be more verbose if the code is correct
* enabled checks can be "expensive"
2017-11-20 18:59:50 -08:00
Victor Stinner 09f3a8a124
bpo-32089: Fix warnings filters in dev mode (#4482)
The developer mode (-X dev) now creates all default warnings filters
to order filters in the correct order to always show ResourceWarning
and make BytesWarning depend on the -b option.

Write a functional test to make sure that ResourceWarning is logged
twice at the same location in the developer mode.

Add a new 'dev_mode' field to _PyCoreConfig.
2017-11-20 17:32:40 -08:00
Yury Selivanov 423fd362f8
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optional (#4447) 2017-11-20 17:26:28 -05:00
Victor Stinner c5a2071586
bpo-32050: Fix -x option documentation (#4475)
The line number in correct when using the -x option: Py_Main() uses
ungetc() to not skip the first newline character.
2017-11-20 08:08:03 -08:00
Victor Stinner 44862df2ee
bpo-32047: -X dev enables asyncio debug mode (#4418)
The new -X dev command line option now also enables asyncio debug
mode.
2017-11-20 07:14:07 -08:00
Berker Peksag b56becb373
Remove outdated .pyo reference from msilib docs (GH-4461)
Since f299abdafa
the remove_pyc() method no longer tries to
remove .pyo files.
2017-11-19 13:04:25 +03:00
Masayuki Yamamoto 7750bded92 Document parameters of BaseServer.finish_request() (GH-4445) 2017-11-19 10:33:37 +03:00
Moses Koledoye 0c71653cb8 [Doc] Update opcode for var-positional arguments (#4446)
`BUILD_MAP_UNPACK_WITH_CALL` was duplicated as the opcode for both var-positional and var-keyword arguments. The opcode for the former was updated as `BUILD_TUPLE_UNPACK_WITH_CALL`.
2017-11-19 00:49:15 +02:00
Erik Bray d505a29a15 Fix typo in atexit documentation. (GH-4419)
`kargs` -> `kwargs`
2017-11-16 08:48:52 -08:00
Serhiy Storchaka cede8c9edb
bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)
The log_rounds parameter for Blowfish has been replaced with the rounds parameter.
2017-11-16 13:22:51 +02:00
Victor Stinner ccb0442a33
bpo-32043: New "developer mode": "-X dev" option (#4413)
Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.

Changes:

* Add unit tests for -X dev
* test_cmd_line: replace test.support with support.
* Fix _PyRuntimeState_Fini(): Use the same memory allocator
   than _PyRuntimeState_Init().
* Fix _PyMem_GetDefaultRawAllocator()
2017-11-16 03:20:31 -08:00
Serhiy Storchaka 05cb728d68
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
in regular expressions.
2017-11-16 12:38:26 +02:00
Serhiy Storchaka 0a2abdfca2
bpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262)
from collections.abc rather than collections.
2017-11-16 09:16:24 +02:00
Antoine Pitrou 4bd41c9b52
bpo-32025: Add time.thread_time() (#4410)
* bpo-32025: Add time.thread_time()

* Add missing #endif

* Add NEWS blurb

* Add docs and whatsnew

* Address review comments

* Review comments
2017-11-15 22:52:21 +01:00
Serhiy Storchaka ddbce13786
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400) 2017-11-15 17:39:37 +02:00
Serhiy Storchaka 9165f77d5f
bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382) 2017-11-15 08:49:40 +02:00
Jesse-Bakker 3bda02222a bpo-31948: Fix broken links in msilib docs (GH-4397) 2017-11-14 15:06:15 -08:00
Serhiy Storchaka b0b44b4b33
bpo-15606: Improve the re.VERBOSE documentation. (#4366) 2017-11-14 17:21:26 +02:00
xdegaye e0582a37c8
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160) 2017-11-12 16:50:48 +01:00
Edward Betts e197a8538b The termios man page is in section 3 (GH-2450) 2017-11-11 19:40:26 +03:00
Berker Peksag 7c9da3e5ba
Remove redundant 'exc = True' line (GH-4357)
It can be removed after c28890fb42
2017-11-11 17:55:05 +03:00
Pablo Galindo e184cfd7bf bpo-31824: Document default value of 'errors' parameters (GH-4328) 2017-11-11 02:05:12 +03:00
Brian Curtin 9f914a01af
bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)
The openfp functions of aifp, sunau, and wave had pointed to the open
function of each module since 1993 as a matter of backwards
compatibility. In the case of aifc.openfp, it was both undocumented
and untested. This change begins the formal deprecation of those
openfp functions, with their removal coming in 3.9.

This additionally adds a TODO in test_pyclbr around using aifc.openfp,
though it shouldn't be changed until removal in 3.9.
2017-11-10 11:38:25 -05:00
Cody Scott 72fa3014d5 Fix phrasing in Doc/whatsnew/3.7.rst (GH-4318) 2017-11-09 21:58:59 +03:00
Victor Stinner 8c663fd60e
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.

Same change for MB and GB which become MiB and GiB.

Change the output of Tools/iobench/iobench.py.

Round also the size of the documentation from 5.5 MB to 5 MiB.
2017-11-08 14:44:44 -08:00
Tom Floyer bf9d317626 bpo-31810: added missing keywords to docs. (#4140)
async and await keywords has been merged into upstream, but they are
all missing in the lexical analysis docs. This change adds them to the
appropriate keywords section in documentation.
2017-11-08 12:31:26 -05:00
Petr Viktorin 2138163621 bpo-29179: Document the Py_UNUSED macro (#4341)
Py_UNUSED has a public name, and is used in the wild outside CPython,
but was not documented. Rectify that.

The macro was added in bpo-19976 and referenced in bpo-26179.
2017-11-08 07:59:20 -08:00
James b5d9e08114 bpo-31884 subprocess: add Windows constants for process priority (#4150) 2017-11-08 06:18:59 -08:00
Victor Stinner 54cc0c0789
bpo-31338: C API intro: add missing versionadded (#4339) 2017-11-08 06:06:24 -08:00
Berker Peksag 28ab3ce924
Fix broken link in Doc/whatsnew/3.7.rst (GH-4335) 2017-11-08 16:36:58 +03:00
Petr Viktorin 8bf288e2c5 Docs: Mention that Py_UNREACHABLE was added in 3.7 (#4337)
The macro was added for bpo-31338 in commit b2e5794870
2017-11-08 15:11:16 +02:00
Sanyam Khurana 7973e279a2 bpo-21862: Add -m option to cProfile for profiling modules (#4297)
* bpo-21862: Add -m option to cProfile for profiling modules
2017-11-08 11:50:56 +01:00
Justus Schwabedal 5a8a84b34f Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093) 2017-11-07 12:51:43 -08:00
Julien Palard 5a66c8a64d bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006) 2017-11-08 01:46:50 +09:00
Jelle Zijlstra 1e5d54cfa0 bpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304)
* fix doc for multiprocessing.connection.Client

The authenticate argument does not exist on either Client or Listener:
- https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L483 (master)
- https://github.com/python/cpython/blob/3.6/Lib/multiprocessing/connection.py#L478 (3.6)
- https://github.com/python/cpython/blob/3.5/Lib/multiprocessing/connection.py#L478 (3.5)
- https://github.com/python/cpython/blob/3.4/Lib/multiprocessing/connection.py#L487 (3.4)
The documentation also claimed that these functions will call `current_process().auth_key`, for which I could find no evidence in the code. I rewrote the documentation to reflect the actual behavior.

Also made some small changes to vary sentence structure.
2017-11-07 17:13:02 +01:00
Antoine Pitrou 22b1128559
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319) 2017-11-07 17:03:28 +01:00
Berker Peksag a935654f06
bpo-20486: Implement Database.Close() method in msilib (GH-4141) 2017-11-07 15:58:53 +03:00
Antoine Pitrou 4135c89395
bpo-31950: Improve event loop policy doc (#4306) 2017-11-07 10:26:32 +01:00
Marat Sharafutdinov 69cfed1cd7 Add asyncio.Handle.cancelled() method (#2388) 2017-11-07 12:06:05 +03:00
Barry Warsaw 962e2a7317
Fix a minor typo and hyphenate "multi-threading" (#4237) 2017-11-06 18:18:40 -08:00
Anders Lorentsen a22a127458 bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299) 2017-11-06 16:47:43 -08:00
Nir Soffer ad455cd924 bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)
blocksize was hardcoded to 8192, preventing efficient upload when using
file-like body. Add blocksize argument to __init__, so users can
configure the blocksize to fit their needs.

I tested this uploading data from /dev/zero to a web server dropping the
received data, to test the overhead of the HTTPConnection.send() with a
file-like object.

Here is an example 10g upload with the default buffer size (8192):

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 17.53 seconds (584.00m/s)

real	0m17.574s
user	0m8.887s
sys	0m5.971s

Same with 512k blocksize:

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 6.60 seconds (1551.15m/s)

real	0m6.641s
user	0m3.426s
sys	0m2.162s

In real world usage the difference will be smaller, depending on the
local and remote storage and the network.

See https://github.com/nirs/http-bench for more info.
2017-11-06 13:16:37 -08:00
luzpaz a5293b4ff2 Fix miscellaneous typos (#4275) 2017-11-05 15:37:50 +02:00
Nick Coghlan 1b46131ae4
bpo-22257: Mention startup refactoring in What's New (GH-4286)
While technically a purely internal change, bpo-31845 was
a fairly significant externally visible bug caused by
these changes (environment variable based configuration
was being ignored due to a change in the relative order
of reading the environment and reading command line settings,
and the test suite was only testing the command line options)

Hence this note to essentially say "If you see odd startup
problems in 3.7 that you've never seen in previous releases,
it's probably our fault, so let us know, and we'll fix it".
2017-11-05 14:58:45 +10:00
davy wybiral aafece7a9e bpo-31923: Fix spelling in sqlite3 docs (GH-4227) 2017-11-05 02:00:51 +03:00
Berker Peksag 12d60560ac
Add version{changed,added} markers and make minor style changes (GH-4273) 2017-11-04 15:17:56 +03:00
Serhiy Storchaka d4d79bc1ff
bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)
This speeds up it to 20-40%.
2017-11-04 14:16:35 +02:00
Phobosmir 82cd3cede8 bpo-31678: Fix typo in PyDateTime_DELTA_GET_MICROSECONDS (GH-3869) 2017-11-04 13:39:45 +03:00
Antoine Pitrou 63ff4131af
bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)
* bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor

* Fix docstring
2017-11-04 11:05:49 +01:00
Chillar Anand b838cc3ff4 bpo-18699: Corrected documentation for window.chgat in curses module (#1430) 2017-11-04 10:13:16 +02:00
Barry Warsaw 93952f8815
Fix a grammatical problem and reword for clarity. (#4257)
bpo-31936
2017-11-03 13:45:46 -07:00
Barry Warsaw 700d2e4755
bpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240)
Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime
2017-11-02 16:13:36 -07:00
Simon Willison ac03c03b30 Returning 1 from the set_progress_handler handler cancels query (GH-4120) 2017-11-02 17:34:11 +03:00
Victor Stinner c29b585fd4
bpo-31784: Implement PEP 564: add time.time_ns() (#3989)
Add new time functions:

* time.clock_gettime_ns()
* time.clock_settime_ns()
* time.monotonic_ns()
* time.perf_counter_ns()
* time.process_time_ns()
* time.time_ns()

Add new _PyTime functions:

* _PyTime_FromTimespec()
* _PyTime_FromNanosecondsObject()
* _PyTime_FromTimeval()

Other changes:

* Add also os.times() tests to test_os.
* pytime_fromtimeval() and pytime_fromtimeval() now return
  _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined
  behaviour
* _PyTime_FromNanoseconds() parameter type changes from long long to
  _PyTime_t
2017-11-02 07:28:27 -07:00
Vincent Michel e314853d57 bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420) 2017-11-02 15:47:04 +03:00
Victor Stinner a64ce973a3
bpo-31917: Add 3 new clock identifiers (#4207)
Add new clock identfiers:

* time.CLOCK_BOOTTIME
* time.CLOCK_PROF
* time.CLOCK_UPTIME
2017-11-02 04:19:19 -07:00
stratakis e8b1965639 bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
Victor Stinner ec2cbdd1df
bpo-20064: Document PyObject_Malloc() (#4199)
Document the following functions:

* PyObject_Malloc()
* PyObject_Calloc()
* PyObject_Realloc()
* PyObject_Free()

Fix also PyMem_RawFree() documentation.
2017-10-31 09:37:25 -07:00
Pablo Galindo 11225753a8 bpo-31304: Update starmap_async documentation. (GH-4168)
Update the kwarg in the documentation of `multiprocessing.pool.Pool.starmap_async`, from `error_back` to `error_callback` to match the source code..
2017-10-30 11:39:28 -07:00
Quentin Dawans fe4ea9cf1e bpo-31245: Asyncio unix socket datagram (#3164) 2017-10-30 09:43:02 -04:00
Serhiy Storchaka a2314283ff
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
2017-10-29 02:11:54 +03:00
Utkarsh Upadhyay 843ea47a03 bpo-31545: Update documentation containing timedelta repr. (GH-3687)
This is a fix to the documentation to reflect the changes merged
in as part of bpo-30302.
2017-10-27 14:25:15 +03:00
Arthur Darcet 2f3d6993d7 Fixed sorting order of the LogRecord attributes in the documentation. (GH-4133) 2017-10-27 08:06:20 +01:00
cocoatomo d609b0c24e bpo-31053: Remove redundant 'venv' argument in venv example (GH-2907) 2017-10-27 07:42:11 +03:00
Alexander Belopolsky 66c88ce30c Closes bpo-28281: Remove year (1-9999) limits on the weekday() function. (#4109)
Patch by Mark Gollahon.
2017-10-26 15:34:11 -04:00
Vitor Pereira 52ad72dd0a bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589) 2017-10-26 21:49:19 +03:00
xdegaye 56d1f5ca32 bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327) 2017-10-26 15:09:06 +02:00
Ammar Askar 275d2d9c46 bpo-30937: Make usage of newline='' consistent in csv docs (GH-2730) 2017-10-26 11:27:46 +03:00
Mario Corchero 32318930da Closes bpo-31800: Support for colon when parsing time offsets (#4015)
Add support to strptime to parse time offsets with a colon between the hour and the minutes.
2017-10-25 20:35:41 -04:00
Serhiy Storchaka 3557b05c5a bpo-31690: Allow the inline flags "a", "L", and "u" to be used as group flags for RE. (#3885) 2017-10-24 23:31:42 +03:00
Alexander Belopolsky fdd9b217c6 Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4(). (#4079)
Calendar.itermonthdates() will now consistently raise an exception when a date falls outside of the 0001-01-01 through 9999-12-31 range. To support applications that cannot tolerate such exceptions, the new methods itermonthdays3() and itermonthdays4() are added. The new methods return tuples and are not restricted by the range supported by datetime.date.

Thanks @serhiy-storchaka for suggesting the itermonthdays4() method and for the review.
2017-10-24 13:17:10 -04:00
Serhiy Storchaka eab3ff72eb bpo-31664: Add support for the Blowfish method in crypt. (#3854) 2017-10-24 19:36:17 +03:00
Masayuki Yamamoto 831d61d56c Fix wording about Py_tss_NEEDS_INIT in docs (GH-4096)
Make more sense to replace the word "default value" with
"initializer" for Py_tss_NEEDS_INIT.
2017-10-24 22:58:16 +10:00
Julien Palard 809d173c20 bpo-31812: Add documentation translations to What's New in Python 3.7. (GH-4064) 2017-10-24 02:22:22 -07:00
Victor Stinner 01b5aab7bf bpo-31827: Remove os.stat_float_times() (GH-4061) 2017-10-24 02:02:00 -07:00
andyclegg 7fed7bd8bb bpo-31756: subprocess.run should alias universal_newlines to text (#4049)
Improve human friendliness of the Popen API: Add text=False as a
keyword-only argument to subprocess.Popen along with a Popen
attribute .text_mode and set this based on the
encoding/errors/universal_newlines/text arguments.

The universal_newlines parameter and attribute are maintained for
backwards compatibility.
2017-10-22 19:01:19 -07:00
Cheryl Sabella 91dc64ba3f bpo-20825: Containment test for ip_network in ip_network. 2017-10-22 23:39:49 +02:00
Antoine Pitrou 525f40d231 bpo-31819: Add AbstractEventLoop.sock_recv_into() (#4051)
* bpo-31819: Add AbstractEventLoop.sock_recv_into()

* Add NEWS

* Add doc
2017-10-19 15:46:40 -04:00
Victor Stinner 884d13a55f time.clock() now emits a DeprecationWarning (GH-4020)
bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
DeprecationWarning warning.

Replace time.clock() with time.perf_counter() in tests and demos.

Remove also hasattr(time, 'monotonic') in test_time since time.monotonic()
is now always available since Python 3.5.
2017-10-17 14:46:45 -07:00
Barry Warsaw 191e313820 bpo-31799: Make module.__spec__ more discoverable (#4010)
bpo-31799: Make module.__spec__ more discoverable
2017-10-17 15:52:38 -04:00
Mario Corchero 552be9d7e6 bpo-30541: Add new method to seal mocks (GH61923)
The new method allows the developer to control when to stop the
feature of mocks that automagically creates new mocks when accessing
an attribute that was not declared before

Signed-off-by: Mario Corchero <mariocj89@gmail.com>
2017-10-17 04:35:11 -07:00
brainfvck c75edabbb6 bpo-31558: Add gc.freeze() (#3705)
Freeze all the objects tracked by gc - move them to a permanent generation
and ignore all the future collections. This can be used before a POSIX
fork() call to make the gc copy-on-write friendly or to speed up collection.
2017-10-16 12:49:41 -07:00
vyas45 1b9e76ed3a bpo-31754: Fix type of 'itemsize' in PyBuffer_FillContiguousStrides (GH-3993) 2017-10-15 10:31:36 +03:00
Raymond Hettinger 8c26a34f93 bpo-31757: Make Fibonacci examples consistent (#3991) 2017-10-14 07:36:08 -07:00
INADA Naoki 073150db39 bpo-31672: doc: Remove one sentence from library/string.rst (GH-3990)
This sentence is removed while backporting to 3.6 branch.
See https://github.com/python/cpython/pull/3982#discussion_r144555768
2017-10-14 21:22:41 +09:00
Serhiy Storchaka cd195e2a7a bpo-31714: Improved regular expression documentation. (#3907) 2017-10-14 11:14:26 +03:00
Victor Stinner ef611c96ea bpo-30807: signal.setitimer() now uses _PyTime API (GH-3865)
The _PyTime API handles detects overflow and is well tested.

Document that the signal will only be sent once if internal is equal
to zero.
2017-10-13 13:49:43 -07:00
Berker Peksag 7f58097083 bpo-28647: Update -u documentation after bpo-30404 (GH-3961) 2017-10-13 15:16:31 +03:00
INADA Naoki b22273ec5d bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872)
Pattern `[a-z]` with `IGNORECASE` flag can match to some non-ASCII characters.

Straightforward solution for this is using `IGNORECASE | ASCII` flag.
But users may subclass `Template` and override only `idpattern`. So we want to
avoid changing `Template.flags`.

So this commit uses local flag `-i` for `idpattern` and change `[a-z]` to `[a-zA-Z]`.
2017-10-13 16:02:23 +09:00
Berker Peksag 9255104499 Improve test suite customization example (GH-3967)
Reported by John Gamboa on docs@p.o at
https://mail.python.org/pipermail/docs/2017-June/031942.html
2017-10-13 06:41:57 +03:00
Ned Deily 6129250b74 Exclude non-default VENVDIR in Doc builds (#3974) 2017-10-12 16:04:57 -04:00
Ned Deily b7cbfe49e3 bpo-31766: restore 3.5 to docs version switchers (#3969) 2017-10-12 14:08:43 -04:00
Éric Araujo 03b9537dc5 bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966) 2017-10-12 12:28:55 -04:00
Daisuke Miyakawa 0e61e67a57 bpo-31567: add or fix decorator markup in docs (#3959) 2017-10-12 10:39:43 -04:00
Cheryl Sabella 703ff381ff bpo-28157: Improvements for the time module documentation (GH-928)
* Separated functions and constants descriptions in sections.
* Added a note about the limitations of timezone constants.
* Removed redundant lists from the module docstring.
2017-10-11 16:29:14 +03:00
Brad Smith eeb5ffd54e bpo-31537: Update readline documentation example. (GH-3925)
Change the code example from using `get_history_length` to `get_current_history_length`.
2017-10-10 14:52:58 -07:00
Serhiy Storchaka 4d3f084c03 bpo-27867: Add a porting guide for PySlice_GetIndicesEx(). (#1973) 2017-10-08 12:53:34 +03:00
Oren Milman 0ccc0f6c74 bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() always return a list (#3840) 2017-10-08 11:17:46 +03:00
Tzu-ping Chung 28f713601d bpo-31720: msilib documentation, change MsiError into MSIError (GH-3914) 2017-10-07 07:55:00 -07:00
Yury Selivanov 02e82a0596 bpo-31709: Update importlib magic (#3906) 2017-10-06 10:18:10 -04:00
Barry Warsaw a51b90a313 Document Py_GETENV() (#3890) 2017-10-06 09:53:48 -04:00
Masayuki Yamamoto 731e189014 bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)
See PEP 539 for details.

Highlights of changes:

- Add Thread Specific Storage (TSS) API
- Document the Thread Local Storage (TLS) API as deprecated
- Update code that used TLS API to use TSS API
2017-10-06 20:41:34 +10:00
Yury Selivanov b8ab9d3fc8 bpo-31708: Allow async generator expressions in synchronous functions (#3905) 2017-10-06 02:58:28 -04:00
Yury Selivanov faa135acbf bpo-31709: Drop support for asynchronous __aiter__. (#3903) 2017-10-06 02:08:57 -04:00
Jelle Zijlstra ac317700ce bpo-30406: Make async and await proper keywords (#1669)
Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
2017-10-05 23:24:46 -04:00
Barry Warsaw 36c1d1f1e5 PEP 553 built-in breakpoint() function (bpo-31353) (#3355)
Implement PEP 553, built-in breakpoint() with support from sys.breakpointhook(), along with documentation and tests.  Closes bpo-31353
2017-10-05 12:11:18 -04:00
INADA Naoki c1c47c166b bpo-31671: re: Convert RegexFlag to int before compile (GH-3862)
sre_compile does bit test (e.g. `flags & SRE_FLAG_IGNORECASE`) in loop.
`IntFlag.__and__` and `IntFlag.__new__` made it slower.

So this commit convert it to normal int before passing flags to `sre_compile()`.
2017-10-05 17:19:26 +09:00
pdox e14679c784 closes bpo-31596: Add an interface for pthread_getcpuclockid(3) (#3756) 2017-10-05 00:01:56 -07:00
Serhiy Storchaka 300dd552b1 bpo-30872: Update the curses docs to Python 3. (#2620) 2017-10-04 22:44:13 +03:00
Serhiy Storchaka c02a1f4ad8 bpo-31667: Fix gettext related links. (#3860)
* Fix incorrect links.
* Remove redundant links.
* Add signatures and index entries for gettext related
functions in the locale module.
2017-10-04 20:28:20 +03:00
Serhiy Storchaka 77732be801 bpo-30404: The -u option now makes the stdout and stderr streams totally unbuffered. (#1667) 2017-10-04 20:25:40 +03:00
Serhiy Storchaka 0b5e61ddca bpo-30397: Add re.Pattern and re.Match. (#1646) 2017-10-04 20:09:49 +03:00
Ned Deily e2d0dd2cf9 Remove retired and security branches from active docs (#3879) 2017-10-03 22:56:19 -04:00
INADA Naoki 1a87de7fcf bpo-31415: Add `-X importtime` option (GH-3490)
It shows show import time of each module.
It's useful for optimizing startup time.

Typical usage: python -X importtime -c 'import requests'
2017-10-03 19:46:34 +09:00
Thomas Moreau e8c368df22 bpo-31540: Allow passing multiprocessing context to ProcessPoolExecutor (#3682) 2017-10-03 11:53:17 +02:00
scoder 101a5e84ac bpo-31648: Improve ElementPath (#3835)
* Allow whitespace inside of ElementPath predicates.
* Add ElementPath predicate support for text comparison of the current node, like "[.='text']".
2017-09-30 16:35:21 +03:00
Christian Heimes 3d2b407da0 bpo-31574: importlib dtrace (#3749)
Importlib was instrumented with two dtrace probes to profile import timing.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-29 15:53:19 -07:00
Zhiming Wang d87b105ca7 bpo-31638: Add compression support to zipapp (GH-3819)
Add optional argument `compressed` to `zipapp.create_archive`, and add
option `--compress` to the command line interface of `zipapp`.
2017-09-29 18:31:52 +01:00
kms70847 8d59aca4a9 Fix typo in Simple Statements documentation (GH-3809)
Replace "restriction" with "restrictions".
2017-09-28 12:54:48 -07:00
Benjamin Peterson 236329ed9f point to the module-level get_ident function rather than the one in _thread (#3782) 2017-09-26 23:13:15 -07:00
Guilherme Caminha 4a2d00cb45 bpo-31571: Remove duplicated info in Lexical Analysis documentation (GH-3691)
- Remove the second mention about the `u` prefix
- Remove the second mention about numeric literals do not include a sign
2017-09-25 16:16:54 -07:00
Stefan Grönke f1502d097c bpo-31569: correct PCBuild/ case to PCbuild/ in build scripts and docs (GH-3711) 2017-09-25 17:58:10 +01:00
Raymond Hettinger 49392c63a2 bpo-27385: Clarify docstring for groupby() (#3738) 2017-09-25 01:21:06 -07:00
Raymond Hettinger 0d4497b9ca bpo-23702: Update Descriptor-HOWTO to reflect the removal of unbound methods (#3739) 2017-09-25 01:05:49 -07:00
Raymond Hettinger 0bf287b6e0 bpo-18558: Clarify glossary entry for "Iterable" (#3732) 2017-09-25 00:52:06 -07:00
Sanket Dasgupta 5b9299d8c7 bpo-30085: Improve documentation for operator (#1171)
The dunderless functions are preferred; dunder are retained for back compatilibity.
Patch by Sanket Dasgupta.
2017-09-24 14:29:22 -04:00
Henk-Jaap Wagenaar 8337239d79 Update Email library documentation example (GH-3720)
A `"` was missing from an `<a href>` tag.
2017-09-24 09:12:53 -07:00
Serhiy Storchaka 2fad102354 bpo-27319, bpo-31508: Document deprecation in Treeview.selection(). (#3667)
Defer removing old behavior to 3.8.
Document new feature of selection_set() and friends.
2017-09-24 14:34:09 +03:00
Serhiy Storchaka c247caf33f bpo-30346: An iterator produced by the itertools.groupby() iterator (#1569)
now becames exhausted after advancing the groupby iterator.
2017-09-24 13:36:11 +03:00
topper-123 039b25d8fd bpo-31564: Update typing documentation (GH-3696)
Mention that ``NewType`` can derive from another ``NewType``.
2017-09-23 19:37:48 -07:00
Dmitry Chestnykh aecc08ac3a Docs: correct hashlib.blake2 keyed hashing example (bpo-31560) 2017-09-23 10:18:40 -07:00
François Magimel da9b4cfb48 bpo-31423: Fix building the PDF documentation (GH-3693)
Use prefixed macro names for the `authoraddress` function, add T2A to the font encoding in LaTeX sources to support Cyrillic characters in the PDF documentation, and replace the deprecated `font_size` config option with `pointsize`.
2017-09-22 12:16:57 -05:00
Barry Warsaw 35425d638c bpo-31389 Add an optional `header` argument to pdb.set_trace() (#3438)
* Give pdb.set_trace() an optional `header` argument

* What's new.

* Give pdb.set_trace() an optional `header` argument

* What's new.
2017-09-22 12:29:42 -04:00
Stefan Krah b1558a0368 bpo-31443: Update included code. (#3697) 2017-09-22 18:14:13 +02:00
Stefan Krah ca72589bfa bpo-31443: Formulate the type slot initialization rules in terms of C99. (#3688) 2017-09-22 17:44:58 +02:00
Igor Filatov 9adda0cdf8 bpo-31351: Set return code in ensurepip when pip fails (GH-3626)
Previously ensurepip would always report success, even if the
pip installation failed.
2017-09-21 20:07:45 +10:00
Anthony Sottile aaf6fc0982 bpo-26510: make argparse subparsers required by default (#3027)
This fixes a regression from Python 2.  To get optional subparsers,
use the new parameter ``add_subparsers(required=False)``.

Patch by Anthony Sottile.
2017-09-20 17:35:27 -04:00
Felipe 19e4d9346d bpo-31533: fix broken link to OpenSSL docs (#3674) 2017-09-20 20:20:18 +02:00
Steve Dower a4bb58fda4 Fix build issues in Doc/make.bat (#3658) 2017-09-19 12:31:28 -07:00
Antoine Pitrou b43c4caf81 Restore dummy_threading and _dummy_thread, but deprecate them (bpo-31370) (#3648) 2017-09-18 22:04:20 +02:00
svelankar 9b47af6537 bpo-31501: Operator precedence description for arithmetic operators (#3633) 2017-09-17 17:56:16 -07:00
Mariatta 63c591c0b0 bpo-31487: Update F-strings doc example (GH-3627)
Shorten the comment to: "using integer format specifier"
2017-09-17 07:43:31 -07:00
Mariatta f361897069 Improve f-strings documentation (GH-3604)
Provide additional examples of using format specifiers in f-strings
Added examples for using integer and date format specifiers.
2017-09-16 11:46:43 -07:00
Mariatta 0ec8c4bd10 bpo-31458: Clarify that Changelog is built from Misc/NEWS.d directory (GH-3617) 2017-09-16 10:43:30 -07:00
Eric Snow 3f9eee6eb4 bpo-28411: Support other mappings in PyInterpreterState.modules. (#3593)
The concrete PyDict_* API is used to interact with PyInterpreterState.modules in a number of places. This isn't compatible with all dict subclasses, nor with other Mapping implementations. This patch switches the concrete API usage to the corresponding abstract API calls.

We also add a PyImport_GetModule() function (and some other helpers) to reduce a bunch of code duplication.
2017-09-15 16:35:20 -06:00
Christian Heimes e82c034496 bpo-31431: SSLContext.check_hostname auto-sets CERT_REQUIRED (#3531)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-15 20:29:57 +02:00
Christian Heimes 4df60f18c6 bpo-31386: Custom wrap_bio and wrap_socket type (#3426)
SSLSocket.wrap_bio() and SSLSocket.wrap_socket() hard-code SSLObject and
SSLSocket as return types. In the light of future deprecation of
ssl.wrap_socket() module function and direct instantiation of SSLSocket,
it is desirable to make the return type of SSLSocket.wrap_bio() and
SSLSocket.wrap_socket() customizable.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-15 20:26:05 +02:00
Terry Jan Reedy ff70289002 bpo-314777: IDLE - improve rstrip entry in doc (#3602)
'Strip trailing whitespace' is not limited to spaces.  Wording caters to beginners who
do know know the meaning of 'whitespace'.  Multiline string literals are not skipped.

* News blurb.
2017-09-15 13:05:28 -04:00
Paul Romano 992f613fe6 Fix description in Python 3.7 What's New (#3603) 2017-09-15 20:00:57 +03:00
Michael Seifert da67e0d644 bpo-29916: Include PyGetSetDef in C API extension documentation. (#831) 2017-09-15 19:25:27 +03:00
Barry Warsaw b2e5794870 bpo-31338 (#3374)
* Add Py_UNREACHABLE() as an alias to abort().
* Use Py_UNREACHABLE() instead of assert(0)
* Convert more unreachable code to use Py_UNREACHABLE()
* Document Py_UNREACHABLE() and a few other macros.
2017-09-14 18:13:16 -07:00
Feanil Patel 6a396c9807 bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)
New -n flag allow overriding localhost with custom value,
for example to run from containers.
2017-09-14 17:54:09 -04:00
Eric Snow 93c92f7d1d bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
2017-09-13 23:46:04 -07:00
sww 312ffead1e Improve code examples in hashlib cookie signing (GH-3562)
The `blake2b` function does not take the `data` keyword argument.
The hex digest returned by sign was a string, whereas compare_digest expects bytes-like objects.
Typo fix: compare_digesty -> compare_digest
2017-09-13 23:24:36 -07:00
Mariatta 1b8f612e18 bpo-31458: Update Misc/NEWS link in What's New page (GH-3555)
Update the link from Misc/NEWS to Misc/NEWS.d
2017-09-13 16:47:33 -07:00
Louie Lu b8d1b9d7c6 Mention enum as an ex (#2982) 2017-09-12 21:44:14 -07:00
Mariatta ea0f7c26ce bpo-31394: Make tokenize.rst PEP 8-compliant (GH-3526)
The last commit contained lines longer than 80 characters.
2017-09-12 21:00:00 -07:00
Aivar Annamaa 5f8fbf917e bpo-31394: Clarify documentation about token type attribute (GH-3469)
Make it clear that Ellipsis tokens also have type attribute set to token.OP.
2017-09-12 20:24:03 -07:00
Terry Jan Reedy 98758bc67f bpo-31421: Document how IDLE runs tkinter programs. (#3513)
IDLE calls tcl/tk update in the background in order to make live
interaction and experimentatin with tkinter applications much easier.
2017-09-12 09:05:16 -04:00
Terry Jan Reedy adb4cd2a2a bpo-27099: Finish updating IDLE doc and help text. (#3510)
As needed for the conversion of extensions to features.
2017-09-12 07:45:15 -04:00
wohlganger 58fc71c447 bpo-27099: IDLE - Convert built-in extensions to regular features (#2494)
About 10 IDLE features were implemented as supposedly optional
extensions.  Their different behavior could be confusing or worse for
users and not good for maintenance.  Hence the conversion.

The main difference for users is that user configurable key bindings
for builtin features are now handled uniformly.  Now, editing a binding
in a keyset only affects its value in the keyset.  All bindings are
defined together in the system-specific default keysets in config-
extensions.def.  All custom keysets are saved as a whole in config-
extension.cfg.  All take effect as soon as one clicks Apply or Ok.

The affected events are '<<force-open-completions>>', '<<expand-word>>',
'<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>',
'<<run-module>>', '<<check-module>>', and '<<zoom-height>>'.  Any
(global) customizations made before 3.6.3 will not affect their keyset-
specific customization after 3.6.3. and vice versa.

Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.
2017-09-10 17:19:47 -04:00
Raymond Hettinger 8b57d73639 bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() (#3454)
* Working draft without _source

* Re-use itemgetter() instances

* Speed-up calls to __new__() with a pre-bound tuple.__new__()

* Add note regarding string interning

* Remove unnecessary create function wrappers

* Minor sync-ups with PR-2736.  Mostly formatting and f-strings

* Bring-in qualname/__module fix-ups from PR-2736

* Formally remove the verbose flag and _source attribute

* Restore a test of potentially problematic field names

* Restore kwonly_args test but without the verbose option

* Adopt Inada's idea to reuse the docstrings for the itemgetters

* Neaten-up a bit

* Add news blurb

* Serhiy pointed-out the need for interning

* Jelle noticed as missing f on an f-string

* Add whatsnew entry for feature removal

* Accede to request for dict literals instead keyword arguments

* Leave the method.__module__ attribute pointing the actual location of the code

* Improve variable names and add a micro-optimization for an non-public helper function

* Simplify by in-lining reuse_itemgetter()

* Arrange steps in more logical order

* Save docstring in local cache instead of interning
2017-09-10 10:23:36 -07:00
Zhiming Wang 30644dee0c Improve IncrementalEncoder documentation (GH-2746)
getstate and setstate are instance methods, same as encode and reset.
2017-09-09 23:09:55 -07:00
Sergey Fedoseev a7fbad96c8 Make `json.dumps()` example to be PEP-8 compliant. (GH-3472) 2017-09-09 09:39:36 -07:00
Christian Heimes b3ad0e5127 bpo-28182: Expose OpenSSL verification results (#3412)
The SSL module now raises SSLCertVerificationError when OpenSSL fails to
verify the peer's certificate. The exception contains more information about
the error.

Original patch by Chi Hsuan Yen

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-08 12:00:19 -07:00
Raymond Hettinger 70c2dd306f Show example of itemgetter() applied to a dictionary (#3431) 2017-09-07 23:53:07 -07:00
Christian Heimes cb5b68abde bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (#1363)
* bpo-29136: Add TLS 1.3 support

TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
AES-GCM and ChaCha20 suites.

Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
now.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-07 18:07:00 -07:00
Ned Deily 590665c399 bpo-31036: Allow sphinx and blurb to be found automatically (#3440)
Rather than requiring the path to blurb and/or sphinx-build to be specified to the make rule, enhance the Doc/Makefile to look for each first in a virtual environment created by make venv and, if not found, look on the normal process PATH. This allows the Doc/Makefile to take advantage of an installed spinx-build or blurb and, thus, do the right thing most of the time. Also, make the directory for the venv be configurable and document the `make venv` target.
2017-09-07 17:17:53 -07:00
Nick Coghlan 5a8516701f bpo-31344: Per-frame control of trace events (GH-3417)
f_trace_lines: enable/disable line trace events
f_trace_opcodes: enable/disable opcode trace events

These are intended primarily for testing of the interpreter
itself, as they make it much easier to emulate signals
arriving at unfortunate times.
2017-09-08 10:14:16 +10:00
Raymond Hettinger 3147b0422c bpo-31270: Modification of Pr 3200 (#3427)
* bpo-31270: Simplify documentation of itertools.zip_longest

* Use repeat(). Track num_active.
2017-09-07 14:01:44 -07:00
Christian Heimes 0c72a0c449 Update copyright PSF to 2001-2017 (#3421)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-07 13:59:13 -07:00
Pablo Galindo 586c0502b5 bpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples (#3229)
* Fix ZeroMQSocketListener and ZeroMQSocketHandler examples

* Use send_json and recv_json to simplify pyzmq interfacing

* Add News entry
2017-09-07 13:53:13 -07:00
Elena Oat 397c467c49 bpo-31330: Clarify that RawTextHelpFormatter collapses repeated newlines. (#3272)
Also provide a solution if the user wants to keep multiple blank lines.
2017-09-07 16:06:45 -04:00
Antoine Pitrou a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Gregory P. Smith 738b7d9766 bpo-22635: subprocess.getstatusoutput doc update. (#3398)
The `subprocess.getstatusoutput` API was inadvertently changed
in Python 3.3.4.  Document the change, it is too late to undo the
API change now as it has shipped in many stable releases.
2017-09-06 17:39:23 -07:00
R. David Murray 0f6b9d2306 bpo-14191 Add parse_intermixed_args. (#3319)
This adds support for parsing a command line where options and positionals are intermixed as is common in many unix commands. This is paul.j3's patch with a few tweaks.
2017-09-06 20:25:40 -04:00
Christian Heimes ad0ffa033e bpo-21649: Add RFC 7525 and Mozilla server side TLS (#3387)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-06 16:19:56 -07:00
Zachary Ware 49ce74efe8 Remove all mention of Windows IA-64 support (GH-3389)
It was mostly removed long ago.
2017-09-06 15:45:25 -07:00
caavery effc12f8e9 bpo-27584: New addition of vSockets to the python socket module (#2489)
* bpo-27584: New addition of vSockets to the python socket module

Support for AF_VSOCK on Linux only

* bpo-27584: Fixes for V2

Fixed syntax and naming problems.
Fixed #ifdef AF_VSOCK checking
Restored original aclocal.m4

* bpo-27584: Fixes for V3

Added checking for fcntl and thread modules.

* bpo-27584: Fixes for V4

Fixed white space error

* bpo-27584: Fixes for V5

Added back comma in (CID, port).

* bpo-27584: Fixes for V6

Added news file.
socket.rst now reflects first Linux introduction of AF_VSOCK.
Fixed get_cid in test_socket.py.
Replaced PyLong_FromLong with PyLong_FromUnsignedLong in socketmodule.c
Got rid of extra AF_VSOCK #define.
Added sockaddr_vm to sock_addr.

* bpo-27584: Fixes for V7

Minor cleanup.

* bpo-27584: Fixes for V8

Put back #undef AF_VSOCK as it is  necessary when vm_sockets.h is not installed.
2017-09-06 15:18:10 -07:00
Steve Dower 5fcd5e64ee bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (#3311) 2017-09-06 10:01:38 -07:00
Benjamin Peterson 60dbed1850 link to legacy doc on the non-legacy website (#3362) 2017-09-05 16:24:39 -07:00
Ned Deily 52451fbaaf Prevent a few make suspicious warnings. (#3341) 2017-09-05 01:34:47 -07:00
Ned Deily fcd97d4438 Include additional changes to support blurbified NEWS (#3340) 2017-09-05 00:46:18 -07:00
Eric Snow 86b7afdfee bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
sys.modules is the one true source.
2017-09-04 17:54:09 -06:00
Benjamin Peterson 069306312a remove IRIX support (closes bpo-31341) (#3310)
See PEP 11.
2017-09-04 16:36:05 -07:00
Barry Warsaw 973b901212 What's New for bpo-1198569 (#3303) 2017-09-04 17:29:27 -04:00
Steve Dower d5cd21d75a Fixes doc/make.bat to properly handle quoted paths. (#3302) 2017-09-04 14:26:27 -07:00
Benjamin Peterson 5b79d60d2c remote note about IRIX in aifc (#3299)
This comment hasn't been true since Python 3.0.
2017-09-04 13:32:34 -07:00
Barry Warsaw ba4279683f bpo-1198569: Allow string.Template braced pattern to be different (#3288)
* bpo-1198569: Allow the braced pattern to be different

``string.Template`` subclasses can optionally define ``braceidpattern`` if
they want to specify different placeholder patterns inside and outside the
braces.  If None (the default) it falls back to ``idpattern``.
2017-09-04 16:32:10 -04:00
larryhastings f9f17346d7 Blurbify master branch. (#3298)
Blurbify master branch.
2017-09-04 13:30:19 -07:00
R. David Murray 0c7983e4ad Clarify nature of parse_args 'args' argument. (#3292)
Patch by Paul.j3.  Includes an unrelated but useful addition to the
optparse porting section.
2017-09-04 16:17:26 -04:00
Eric Appelt 122e88a835 bpo-30096: Use ABC in abc reference examples (#1220)
Use base class rather than metaclass in examples.
2017-08-30 18:47:52 -04:00
Lisa Hewus Fresh 384899dfae bpo-30737: Update DevGuide links to new URL (GH-3228)
Update old devguide links from https://docs.python.org/devguide to https://devguide.python.org
2017-08-30 09:37:43 -07:00
Sergey Fedoseev d9a2b99ac4 Fix the indentation in Extending Python code example (GH-3244)
Code was indented with three spaces.
Fixed using four spaces.
2017-08-30 07:50:40 -07:00
Ivan Chernoff 006617ff7d bpo-31065: Add doc about Popen.poll returning None. (#3169) 2017-08-29 07:46:24 -07:00
Gregory P. Smith e9d978fd1b Fix a typo in the Programming FAQ. (#3230)
subobjects, not subobjecs.
2017-08-28 13:43:26 -07:00
Pier-Yves Lessard a30f6d45ac bpo-30987 - Support for ISO-TP protocol in SocketCAN (#2956)
* Added support for CAN_ISOTP protocol

* Added unit tests for CAN ISOTP

* Updated documentation for ISO-TP protocol

* Removed trailing whitespace in documentation

* Added blurb NEWS.d file

* updated Misc/ACKS

* Fixed broken unit test that was using isotp const outside of skippable section

* Removed dependecy over third party project

* Added implementation for getsockname + unit tests

* Missing newline at end of ACKS file

* Accidentally inserted a type in ACKS file

* Followed tiran changes review #1 recommendations

* Added spaces after comma
2017-08-28 10:32:44 +02:00
Henk-Jaap Wagenaar ed94a8b285 bpo-26656: Improve re.compile documentation (GH-3211)
- Link to the regular expressions object documentation
- Clarify that it can be used with more than the two methods currently stated.
2017-08-27 22:41:20 -07:00
Paul Moore 0780bf7578 bpo-31072: Rename the new filter argument for zipapp.create_archive. (#3049)
bpo-31072: Rename the new filter argument for zipapp.create_archive (GH-3049)

* Rename the new argument to "filter"
* Improve tests for the new functionality
* Add a "What's New" entry.
2017-08-26 18:04:12 +01:00
Łukasz Langa a5fab17fc1 bpo-23835: Restore legacy defaults= behavior for RawConfigParser (#3191)
The fix for bpo-23835 fixed ConfigParser behavior in defaults= handling.
Unfortunately, it caused a backwards compatibility regression with
RawConfigParser objects which allow for non-string values.

This commit restores the legacy behavior for RawConfigParser only.
2017-08-24 09:43:53 -07:00
INADA Naoki a6296d34a4 bpo-31095: fix potential crash during GC (GH-2974) 2017-08-24 14:55:17 +09:00
Łukasz Langa ea57923e89 bpo-23835: [docs] configparser converts defaults to strings (#3176)
Title says all.
2017-08-21 16:23:38 -07:00
Brett Cannon a3110a0133 Fix a minor grammar issue in the logging cookbook (GH-3136) 2017-08-18 10:00:31 -07:00
Elmar Ritsch b9ff498793 Fix broken `Show Source` links on documentation pages (GH-3113)
The `Show Source` was broken because of a change made in sphinx 1.5.1
In Sphinx 1.4.9, the sourcename was "index.txt".
In Sphinx 1.5.1+, it is now "index.rst.txt"
2017-08-17 20:23:51 -07:00
syncosmic fe2b56ab92 bpo-31183: `dis` now handles coroutines & async generators (GH-3077)
Coroutines and async generators use a distinct attribute name for their
code objects, so this updates the `dis` module to correctly disassemble
objects with those attributes.

Due to the increase in the test module length, it also fixes some latent
defects in the tests related to how the displayed source line numbers
are extracted.

https://bugs.python.org/issue31230 is a follow-up issue suggesting we
may want to solve this a different way, by instead giving all these object
types a common `__code__` attribute, avoiding the need for special
casing in the `dis` module.
2017-08-18 12:29:21 +10:00
Julien Palard b616b97299 Update the language selection in the docs language switch. (GH-3114)
Change the option for `Français` into `French` to be consistent with the other language selections that are already in English.
2017-08-17 07:24:02 -07:00
Christian Heimes 7b40cb7293 bpo-30714: ALPN changes for OpenSSL 1.1.0f (#2305)
OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client
could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that.
The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN
callback can pretend to not been set.

See https://github.com/openssl/openssl/pull/3158 for more details

Signed-off-by: Christian Heimes <christian@python.org>
2017-08-15 10:33:43 +02:00
Saurabh Chaturvedi 143be36629 bpo-31191: Improve grammar in threading.Barrier docs (GH-3080) 2017-08-14 11:54:53 -07:00
Daniel Himmelstein dadca480c5 Fix typo in 3.7 What's New (GH-3069)
Remove unneeded word `to`.
2017-08-10 18:45:12 -07:00
Julien Palard 122081deef bpo-31159: fix language switch regex on unknown yet built languages. (#3039)
This fix a regex issue (a missing non-matching group around an 'or'
list) and the specific possible case where a translation is built but
not yet in known by the picker, but not explicitly listing possible
languages in the regex.
2017-08-09 17:01:15 +02:00
Jeffrey Rackauckas b811d664de bpo-31072: Add filter to zipapp (#3021)
bpo-31072: Add a filter argument to zipapp.create_archive (GH-3021)

* Add an include_file argument to allow callers to decide which files to include
* Document the new argument
2017-08-09 14:37:17 +01:00
Julien Palard c82b7f332a bpo-31149: Doc: Add Japanese to the language switcher. (#3028) 2017-08-08 23:26:46 +02:00
Julien dff9b5f9d6 bpo-31045: Language switch (#2652)
* Doc: Indicate the language

* Renaming version_switcher to switchers (to add language_switcher).

* Adding language switch.

* Doc switchers: Enhance readability of regex parsing versions.

* Doc switchers: Desambiguate the need of a replace(/\/+$/g, '') by proper naming.

* Doc switchers: py3k can't reach js, it's redirected server-side by nginx.

* Doc switchers: Examples matching actual regexes.

* Doc switchers: Better fallback on unexisting translated version.
2017-08-07 10:27:21 +02:00
Mike DePalatis 87c3c5de73 Improve grammar in asyncio documentation (GH-2993)
"not only is it .." is the correct form, as opposed to:
"not only it is ..."
2017-08-04 00:20:42 +10:00
Ville Skyttä 49b2734bf1 Spelling fixes (#2902) 2017-08-03 09:00:59 +03:00
Preston Landers 6ea56d2ebc bpo-31080: Allowed logging.config.fileConfig() to accept both args and kwargs. (GH-2979) 2017-08-02 21:44:28 +01:00
Łukasz Langa 47320a652e Document Path.is_mount(), update Misc/ACKS and Misc/NEWS (#2980) 2017-08-01 16:47:50 -07:00
Alexander Belopolsky 018d353c1c Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets. (#2896)
* Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets.

* bpo-5288: Implemented %z formatting of sub-minute offsets.

* bpo-5288: Removed mentions of the whole minute limitation on TZ offsets.

* bpo-5288: Removed one more mention of the whole minute limitation.

Thanks @csabella!

* Fix a formatting error in the docs

* Addressed review comments.

Thanks, @haypo.
2017-07-31 10:26:50 -04:00
Vinay Sajip 2543f50033 bpo-30522: Implemented a method to allow setting a logging.StreamHander's stream. (GH-2921) 2017-07-30 10:41:45 +01:00
Peter Thomassen caa1280d1e bpo-30803: clarify truth value testing documentation (#2508)
Initial patch by Peter Thomassen.
2017-07-29 15:18:13 -04:00
Yuval Langer 6fcb69dad5 Fix trivial typo in multiprocessing documentation (GH-2930) 2017-07-28 10:39:35 -07:00
Utkarsh Upadhyay 8e45318b0d bpo-30302: Update WhatsNew and documentation. (#2929)
* Update 'Porting to .37' section.

* Fix a minor example in the doc.
2017-07-28 14:42:56 +02:00