Commit Graph

21568 Commits

Author SHA1 Message Date
Zachary Ware d824ca7f4d bpo-34006: Revert line length limit for Windows help docs (GH-8051)
The line-length limit is not needed because the pages appear in a separate app rather
 than on a browser tab.  It can also interact badly with the DPI setting.
2018-07-02 16:31:42 -04:00
INADA Naoki c6cd164cff
bpo-30660: Doc: Optimize PNG files by optipng (GH-8032)
Using OptiPNG 0.7.7.
Used command is: `find . -name '*.png' | xargs optipng -o7`
2018-07-01 16:02:52 +09:00
Tal Einat 6dc57e2a20
bpo-31938: Convert selectmodule.c to Argument Clinic (GH-4265) 2018-06-30 23:02:48 +03:00
INADA Naoki fe524df37c
Doc: Remove unused image file (GH-8027) 2018-07-01 03:04:34 +09:00
Tal Einat 0cdf5f4289
bpo-32568: make select.epoll() and its docs consistent (#7840)
* `flags` is indeed deprecated, but there is a validation on its value for
  backwards compatibility reasons.  This adds mention of this in the docs.
* The docs say that `sizehint` is deprecated and ignored, but it is still
  used when `epoll_create1()` is unavailable. This adds mention of this in
  the docs.
* `sizehint=-1` is acceptable again, and is replaced with `FD_SETSIZE-1`.
  This is needed to have a default value available at the Python level,
  since `FD_SETSIZE` is not exposed to Python. (see: bpo-31938)
* Reject `sizehint=0` since it is invalid to pass on to `epoll_create()`.

The relevant tests have also been updated.
2018-06-30 15:43:23 +03:00
Andrés Delfino bda9c3eae3 Fix the indentation in the documentation of bin() and hash() (GH-7998) 2018-06-29 12:57:10 +03:00
Yury Selivanov 41cb0baea9
bpo-33985: Implement ContextVar.name attribute. (GH-7980) 2018-06-28 13:20:29 -04:00
Elvis Pranskevichus 4d26c8a177 bpo-32996: Enhancements to What's New based on feedback (GH-7988) 2018-06-28 11:57:37 -04:00
INADA Naoki 461a1c4b49
bpo-33842: Remove tarfile.filemode (GH-7661) 2018-06-28 17:10:36 +09:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 62b6cea6b8 bpo-33958: Doc: Remove unused variable in example (GH-7927) 2018-06-28 15:25:20 +09:00
Ned Deily aee5df5e16 Forward port 3.7.0 final changes 2018-06-27 18:45:50 -04:00
Zackery Spytz d2cbfffc84 bpo-25007: Add copy protocol support to zlib compressors and decompressors (GH-7940) 2018-06-27 21:04:51 +03:00
Behzad B. Mokhtari df748c20da use rich markup for PEP reference (GH-7939)
it's better to refer to PEP with `pep` role in reStructuredText. It also links to the PEP page.
2018-06-26 20:57:39 -07:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 866c168a5f bpo-33957: Doc: Use better wording (GH-7912) 2018-06-26 17:27:05 +09:00
Tal Einat fdd6e0bf18
bpo-33573: docs to suggest median() alternatives for non-numeric data (GH-7587) 2018-06-25 14:04:01 +03:00
Andrés Delfino 4a6e746079 bpo-33952: Fix typo in str.upper() documentation (GH-7898) 2018-06-25 13:34:22 +03:00
Andrés Delfino a8ddf85a84 bpo-33943: Add references in the docs for logging.basicConfig (GH-7858)
Adds references to info about file modes, `time.strftime()`, string formatting
syntaxes, and logging levels.
2018-06-25 09:06:10 +03:00
Dong-hee Na cf67d6a934 bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873) 2018-06-25 05:11:09 +01:00
Andrés Delfino 0ba9a0b7d1 [master] bpo-33885: Replace "hook function" with "callable" (GH-7765) (#7886)
(cherry picked from commit c45cb47907)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-06-23 19:23:50 -07:00
Andrés Delfino 38cf49bf69 bpo-33887: Add TOC to Design and History FAQ(GH-7766) 2018-06-23 11:27:16 -07:00
Andrés Delfino c9d43c702a bpo-33877: Remove UNIX qualification for running complete programs (GH-7744)
The statement is true for Windows (and macOS) also.
2018-06-22 17:31:03 -04:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 940ae60856 Clarified the tempfile.tempdir documentation (GH-7829) 2018-06-21 03:52:43 -04:00
Nick Coghlan 16eb3bcdb2
bpo-33499: PYTHONPYCACHEPREFIX What's New entry (GH-7749)
Initial What's New in Python 3.8 entry for `PYTHONPYCACHEPREFIX`.
2018-06-20 21:25:01 +10:00
Giampaolo Rodola c7f02a9659
bpo-33671 / shutil.copyfile: use memoryview() with dynamic size on Windows (#7681)
bpo-33671
* use memoryview() with size == file size on Windows, see https://github.com/python/cpython/pull/7160#discussion_r195405230
* release intermediate (sliced) memoryview immediately
* replace "OSX" occurrences with "macOS"
* add some unittests for copyfileobj()
2018-06-19 08:27:29 -07:00
INADA Naoki 698865dcbb
bpo-33843: Remove deprecated stuff in cgi module (GH-7662) 2018-06-19 17:28:50 +09:00
INADA Naoki e57f91a0f0
bpo-33866: enum: Stop using OrderedDict (GH-7698) 2018-06-19 01:14:26 +09:00
Andrés Delfino 5092439c2c bpo-33892: Doc: Use gender neutral words (GH-7770) 2018-06-18 13:34:30 +09:00
Xtreak c151f7846d bpo-33859: Fix spelling mistakes in docs. (GH-7691) 2018-06-16 08:08:31 +03:00
Carl Meyer b193fa996a bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. (GH-6834)
In some development setups it is inconvenient or impossible to write bytecode
caches to the code tree, but the bytecode caches are still useful. The
PYTHONPYCACHEPREFIX environment variable allows specifying an alternate
location for cached bytecode files, within which a directory tree mirroring the code
tree will be created. This cache tree is then used (for both reading and writing)
instead of the local `__pycache__` subdirectory within each source directory.

Exposed at runtime as sys.pycache_prefix (defaulting to None), and can
be set from the CLI as "-X pycache_prefix=path".

Patch by Carl Meyer.
2018-06-16 14:40:56 +10:00
Andrés Delfino 6868003514 bpo-33571: Improve the glossary description for '...' prompt (GH-6971)
Mention that it can be triggered by triple quotes and after specifying decorators.
2018-06-15 20:46:38 -07:00
Noah Haasis 2707e41a5c bpo-33836: Recommend keyword-only param for memoization in FAQ (GH-7687)
Update the the signature in the code example to make `_cache` a keyword-only parameter.
2018-06-15 20:29:11 -07:00
Andrés Delfino 7469ff5017 Use singular, we are talking about the access (GH-7727) 2018-06-15 19:42:09 -07:00
Andrés Delfino a9d0b34a5c bpo-33854: Add PEP 461 title to 'See also' note (GH-7688) 2018-06-15 15:42:20 -04:00
Andrés Delfino 695118600f bpo-33847: Add '@' operator entry to index (GH-7669) 2018-06-15 15:23:00 -04:00
Andrés Delfino 4fddd4e406 bpo-33852: Remove misplaced parentheses around 'list'. (GH-7672)
'expresson list' refers to the grammar term 'expression_list' in the subscription production.
2018-06-15 14:24:25 -04:00
Serhiy Storchaka ceeef10cdb
bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581) 2018-06-15 11:09:43 +03:00
Eric Snow 9e7c92193c
bpo-17045: Improve C-API doc for PyTypeObject. (gh-7413)
The existing doc had a number of info gaps and was a little hard to use.  This patch provides several quick-reference tables as well as examples.
2018-06-14 15:46:35 -06:00
Zackery Spytz 71ede00f14 bpo-31378: Document sqlite3.OperationalError exception (GH-7677) 2018-06-13 12:09:31 +03:00
Xiang Zhang b9d8ad5130
bpo-33828: Add missing versionchanged note for string.Formatter. (GH-7668)
string.Formatter auto-numbering feature was added in 3.4 and there
is no versionchanged note in its documentation, making the documentation
ambiguous about which version the feature is available.
2018-06-13 09:42:44 +08:00
Giampaolo Rodola 4a172ccc73
bpo-33671: efficient zero-copy for shutil.copy* functions (Linux, OSX and Win) (#7160)
* have shutil.copyfileobj use sendfile() if possible

* refactoring: use ctx manager

* add test with non-regular file obj

* emulate case where file size can't be determined

* reference _copyfileobj_sendfile directly

* add test for offset() at certain position

* add test for empty file

* add test for non regular file dst

* small refactoring

* leave copyfileobj() alone in order to not introduce any incompatibility

* minor refactoring

* remove old test

* update docstring

* update docstring; rename exception class

* detect platforms which only support file to socket zero copy

* don't run test on platforms where file-to-file zero copy is not supported

* use tempfiles

* reset verbosity

* add test for smaller chunks

* add big file size test

* add comment

* update doc

* update whatsnew doc

* update doc

* catch Exception

* remove unused import

* add test case for error on second sendfile() call

* turn docstring into comment

* add one more test

* update comment

* add Misc/NEWS entry

* get rid of COPY_BUFSIZE; it belongs to another PR

* update doc

* expose posix._fcopyfile() for OSX

* merge from linux branch

* merge from linux branch

* expose fcopyfile

* arg clinic for the win implementation

* convert path type to path_t

* expose CopyFileW

* fix windows tests

* release GIL

* minor refactoring

* update doc

* update comment

* update docstrings

* rename functions

* rename test classes

* update doc

* update doc

* update docstrings and comments

* avoid do import nt|posix modules if unnecessary

* set nt|posix modules to None if not available

* micro speedup

* update description

* add doc note

* use better wording in doc

* rename function using 'fastcopy' prefix instead of 'zerocopy'

* use :ref: in rst doc

* change wording in doc

* add test to make sure sendfile() doesn't get called aymore in case it doesn't support file to file copies

* move CopyFileW in _winapi and actually expose CopyFileExW instead

* fix line endings

* add tests for mode bits

* add docstring

* remove test file mode class; let's keep it for later when Istart addressing OSX fcopyfile() specific copies

* update doc to reflect new changes

* update doc

* adjust tests on win

* fix argument clinic error

* update doc

* OSX: expose copyfile(3) instead of fcopyfile(3); also expose flags arg to python

* osx / copyfile: use path_t instead of char

* do not set dst name in the OSError exception in order to remain consistent with platforms which cannot do that (e.g. linux)

* add same file test

* add test for same file

* have osx copyfile() pre-emptively check if src and dst are the same, otherwise it will return immedialtey and src file content gets deleted

* turn PermissionError into appropriate SameFileError

* expose ERROR_SHARING_VIOLATION in order to raise more appropriate SameFileError

* honour follow_symlinks arg when using CopyFileEx

* update Misc/NEWS

* expose CreateDirectoryEx mock

* change C type

* CreateDirectoryExW actual implementation

* provide specific makedirs() implementation for win

* fix typo

* skeleton for SetNamedSecurityInfo

* get security info for src path

* finally set security attrs

* add unit tests

* mimick os.makedirs() behavior and raise if dst dir exists

* set 2 paths for OSError object

* set 2 paths for OSError object

* expand windows test

* in case of exception on os.sendfile() set filename and filename2 exception attributes

* set 2 filenames (src, dst) for OSError in case copyfile() fails on OSX

* update doc

* do not use CreateDirectoryEx() in copytree() if source dir is a symlink (breaks test_copytree_symlink_dir); instead just create a plain dir and remain consistent with POSIX implementation

* use bytearray() and readinto()

* use memoryview() with bytearray()

* refactoring + introduce a new _fastcopy_binfileobj() fun

* remove CopyFileEx and other C wrappers

* remove code related to CopyFileEx

* Recognize binary files in copyfileobj()
...and use fastest _fastcopy_binfileobj() when possible

* set 1MB copy bufsize on win; also add a global _COPY_BUFSIZE variable

* use ctx manager for memoryview()

* update doc

* remove outdated doc

* remove last CopyFileEx remnants

* OSX - use fcopyfile(3) instead of copyfile(3)

...as an extra safety measure: in case src/dst are "exotic" files (non
regular or living on a network fs etc.) we better fail on open() instead
of copyfile(3) as we're not quite sure what's gonna happen in that
case.

* update doc
2018-06-12 23:04:50 +02:00
Tal Einat c3f55be7dd
bpo-27397: Make email module properly handle invalid-length base64 strings (#7583)
When attempting to base64-decode a payload of invalid length (1 mod 4),
properly recognize and handle it.  The given data will be returned as-is,
i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
2018-06-12 15:46:22 +03:00
Ned Deily 5a98209180
Fix nested list in 3.7 What's New (GH-7659) 2018-06-12 04:51:38 -04:00
Ned Deily 04290cb994
bpo-25612: Add minimal What's New in 3.7 entry (GH-7656) 2018-06-11 23:20:34 -04:00
Christian Heimes ef24b6c54d bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530)
The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were
misleading and partly wrong. It fails to explain that OpenSSL behaves
differently in client and server mode. Also OpenSSL does validate the
cert chain everytime. With SSL_VERIFY_NONE a validation error is not
fatal in client mode and does not request a client cert in server mode.
Also discourage people from using CERT_OPTIONAL in client mode.
2018-06-11 18:59:45 -04:00
Terry Jan Reedy 8a05f559ce
bpo-33656: Add entry to What's New 3.7. (GH-7638)
This is a separate PR because this does not backport to 3.6.
2018-06-11 14:15:37 -04:00
Terry Jan Reedy 800415e3df
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
On Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should
make text and lines sharper. It should otherwise have no effect.

Using a magnifier, I determined that the improvement comes from horizontal and
lines being better lined up with the monitor pixels. I checked that this call causes
no problem on any Windows buildbot, including the Win7 buildbots. Unlike most
IDLE patches, this one can be easily reverted by users by removing a few lines,
at the top of idlelib/pyshell.py.
2018-06-11 14:14:32 -04:00
Andrés Delfino 0e5f901508 bpo-33831: Make htmlview run again (GH-7628) 2018-06-11 09:58:18 -07:00
Zackery Spytz 2c071cebe6 bpo-30820: Remove incorrect docs for email.contentmanager.raw_data_manager (#7631)
The docs claimed that a list of EmailMessage objects could be
passed to set_content(), but this was never implemented.
2018-06-11 10:47:47 -04:00
Ned Deily 9d6171ded5
bpo-23404: Update/sync What's New files for 3.6/3.5/2.7 (GH-7620) 2018-06-11 04:09:34 -04:00
Ned Deily 12c6cdf4d1
bpo-33745: Add What's New for empty function docstring change. (GH-7611) 2018-06-10 22:41:09 -04:00
Ned Deily ef057bfb06
bpo-33109: Remove now-obsolete What's New entry for bpo-26510. (GH-7609) 2018-06-10 22:17:56 -04:00
Alexander Belopolsky 877b23202b
bpo-33812: Corrected astimezone for naive datetimes. (GH-7578)
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.
2018-06-10 17:02:58 -04:00
Terry Jan Reedy af4b0130d4
bpo-33610: Update IDLE Code Context doc entry (GH-7597)
Users can now click on context lines.
2018-06-10 15:48:41 -04:00
Terry Jan Reedy 820c53ac61
bpo-33820: Fix IDLE What's New typo (#7594) 2018-06-10 14:57:38 -04:00
Terry Jan Reedy 222f7f4033
bpo-33821: Update idlelib subsection of What's New 3.7 (#7590) 2018-06-10 14:15:04 -04:00
Terry Jan Reedy e226eb7157
bpo-33820: Update idlelib subsection of What's New 3.6 (GH-7589) 2018-06-10 14:03:40 -04:00
Andrés Delfino d689f97619 Remove hyphens from phrase "picks up where it left off" (GH-7410) 2018-06-09 18:43:45 -07:00
Andrés Delfino 0e0534c402 Fix typo in object.__getnewargs__() documentation (GH-7554) 2018-06-10 03:41:09 +03:00
Ammar Askar 0aa17ee6a7 bpo-33766: Document that end of file or string is a newline (GH-7383) 2018-06-09 19:49:39 -04:00
MarcoFalke 7e0d882a98 doc: Fix typo in asyncio-eventloop.rst (GH-7345)
This is a fixup to 19a44f63c7
2018-06-09 16:09:13 -07:00
Nick Coghlan 1bcb8a6368
bpo-33409: Clarify PEP 538/540 relationship (GH-7534)
While locale coercion and UTF-8 mode turned out to
be complementary ideas rather than competing ones,
it isn't immediately obvious why it's useful to
have both, or how they interact at runtime.

This updates both the Python 3.7 What's New doc
and the PYTHONCOERCECLOCALE and PYTHONUTF8
documentation in an attempt to clarify that
relationship:

- in the respective What's New sections, add a closing paragraph
  explaining which problem each one solves, and pointing to the
  other PEP's section for the specific aspects it relies on the other
  PEP to solve
- use "locale-aware mode" as a more descriptive term for the
  default non-UTF-8 mode
- improve wording conistenccy between the PYTHONCOERCECLOCALE
  and PYTHONUTF8 docs when they cover the same thing (mostly
  related to legacy locale detection and setting the standard
  stream error handler)
- improve the description of the locale coercion trigger conditions
  (including pointing out that setting LC_ALL turns off locale coercion)
- port the full description of the UTF-8 mode behaviour changes
  from PEP 540 into the PYTHONUTF8 documentation
- be explicit that PYTHONIOENCODING still overrides the settings
  for the standard streams
- mention concrete examples of things that do and don't get their
  text encoding assumptions adjusted by the two text encoding
  assumption override techniques
2018-06-09 16:54:08 +10:00
Andrés Delfino 4acc140f8d Fix indendation level of versionchanged directive in configparser.items() doc (GH-7543) 2018-06-08 17:20:05 -07:00
Andrés Delfino 1cbdb2208a bpo-33801: Remove non-ordered dict comment from plistlib doc (GH-7495) 2018-06-08 17:51:20 -04:00
Andrés Delfino 3b0b90c8c3 bpo-33800: Fix default argument for parameter dict_type of ConfigParser/RawConfigParser (GH-7494) 2018-06-08 15:19:21 -04:00
Dong-hee Na 4f54867e29 bpo-33197: Add versionadded tag to the documentation of ParameterKind (GH-7536) 2018-06-08 12:07:52 -04:00
Elvis Pranskevichus c0d062f523 bpo-33736: Improve the documentation of asyncio stream APIs (GH-7326) 2018-06-08 11:36:00 -04:00
Andrés Delfino 6860629d87 bpo-33798: Update csv document about dict order (GH-7490) 2018-06-08 21:51:12 +09:00
Andrés Delfino 396ecb9c3e bpo-33799: Remove non-ordered dicts comments from FAQ 2018-06-08 15:38:07 +09:00
Dong-hee Na 4aa3006619 bpo-33197: Add description property for _ParameterKind. (GH-7206) 2018-06-07 23:46:31 -04:00
Yury Selivanov 8f4042964d
bpo-33792: Add selector and proactor windows policies (GH-7487) 2018-06-07 20:44:57 -04:00
Neil Schemenauer d3ed67d14e
bpo-33609: small wording fixes to dict ordering docs
A few wording improvements to dict ordering documentation.
2018-06-07 14:46:04 -07:00
Benjamin Peterson 34b734699b
update 3.7 whatsnew entry about Unicode version (GH-7480)
Followup to 4705ea38c9 and bpo-33778.
2018-06-07 07:21:28 -07:00
Anthony Sottile bb6366bd75 bpo-17909: Document that json.load can accept a binary IO (GH-7366) 2018-06-07 18:58:12 +09:00
Scott Sanderson cebe80b59b bpo-29235: Update document for Profiler's context manager (GH-7331) 2018-06-07 18:46:42 +09:00
Benjamin Peterson 7c69c1c0fb
update to Unicode 11.0.0 (closes bpo-33778) (GH-7439)
Also, standardize indentation of generated tables.
2018-06-06 20:14:28 -07:00
Victor Stinner 3ef769fcd3
bpo-28240: timeit: Update repeat() doc (GH-7419)
Document that the default value of repeat changed from 3 to 5 in
Python 3.7.
2018-06-06 17:55:18 +02:00
John Reese 3a5b0d8988 bpo-33504: Migrate configparser from OrderedDict to dict. (#6819)
With 3.7+, dictionary are ordered by design.  Configparser still uses
collections.OrderedDict, which is unnecessary.  This updates the module
to use the standard dict implementation by default, and changes the
docs and tests to match.
2018-06-05 16:31:33 -07:00
Thomas Kluyver c56b17bd8c bpo-12486: Document tokenize.generate_tokens() as public API (#6957)
* Document tokenize.generate_tokens()

* Add news file

* Add test for generate_tokens

* Document behaviour around ENCODING token

* Add generate_tokens to __all__
2018-06-05 10:26:39 -07:00
Vinay Sajip dde9fdbe45
bpo-33165: Added stacklevel parameter to logging APIs. (GH-7424) 2018-06-05 17:24:18 +01:00
Mayank Singhal 9ef1b0690b bpo-31215: Add version changed notes for OpenSSL 1.1.0 compatibility (GH-7346) 2018-06-06 00:14:37 +10:00
Tobias Kunze af1ec97a6d bpo-32392: Document env keyword argument of subprocess.run() (GH-7289) 2018-06-05 14:41:42 +03:00
INADA Naoki f822549653 bpo-33609: Document dict insertion order guarantee as of 3.7 (GH-7093) 2018-06-04 18:09:22 -04:00
Yury Selivanov 9602643120
bpo-33734: asyncio/ssl: a bunch of bugfixes (#7321)
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)

* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
2018-06-04 11:32:35 -04:00
Tobias Kunze f7745e1dcb bpo-27902: Add compatibility note to Profile docs (GH-7295) 2018-06-04 19:07:16 +09:00
Farhaan Bukhsh b75ec08567 bpo-33640, uuid.UUID doc: document endian of bytes parameter (GH-7263)
The bytes parameter uses big endian.
2018-06-04 09:29:00 +02:00
Zackery Spytz a801cf164b bpo-23495: Correct the documentation for writerows() of csv Writer objects (GH-6316)
`writerows()` takes an iterable.
2018-06-02 08:02:16 -07:00
Zach Mitchell 00818c8ffd Fix typo in datamodel.rst (GH-6964)
This is a simple grammatical fix correcting "...object whose `__self__` attributes is ..." to "...object whose `__self__` attribute is ...".
2018-06-02 07:29:47 -07:00
Scott Sanderson 2e01b75884 bpo-29235: Make cProfile.Profile a context manager (GH-6808) 2018-06-01 13:36:23 -07:00
Vinay Sajip 23cee80cfa
bpo-33400: Removed references to RFC3339 and ISO8601 from the logging documentation. (GH-7297) 2018-06-01 10:09:21 +01:00
Vinay Sajip c0d341d49b
bpo-32519: Removed misleading sentence from EnvBuilder documentation. (GH-7296) 2018-06-01 10:08:33 +01:00
Serhiy Storchaka 0a36ac1a09
bpo-33641: Convert RFC references into links. (GH-7103)
85% of them are already links.
2018-05-31 07:39:00 +03:00
Pablo Galindo 02e2a085dc bpo-31368: Enhance os.preadv() documentation (GH-7254) 2018-05-31 01:00:04 +02:00
Dmitry Shachnev 495e567a2b 3.6 what's new: fix a reference to PEP 528 (#7113) 2018-05-30 18:52:43 -04:00
Andrés Delfino 05f1c8902c bpo-33696: Install python-docs-theme even if SPHINXBUILD is defined (GH-7242) 2018-05-30 09:08:25 -07:00
jhaydaman 0a28c0d12e bpo-33238: Add InvalidStateError to concurrent.futures. (GH-7056)
Future.set_result and Future.set_exception now raise InvalidStateError
if the futures are not pending or running. This mirrors the behavior
of asyncio.Future, and prevents AssertionErrors in asyncio.wrap_future
when set_result is called multiple times.
2018-05-30 10:15:06 +03:00
Elvis Pranskevichus dec947ca26 Fix typo introduced in GH-7217 (#7230) 2018-05-29 20:14:59 -04:00
Julien Palard a34e424bdb
Fix whatsnew entry about ThreadedHTTPServer. (GH-7220) 2018-05-30 00:44:12 +02:00
Elvis Pranskevichus f9aeca2085 bpo-23859: Document that asyncio.wait() does not cancel its futures (#7217)
Unlike `asyncio.wait_for()`, `asyncio.wait()` does not cancel the passed
futures when a timeout accurs.
2018-05-29 18:21:44 -04:00
Elvis Pranskevichus e2b340ab41 bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)
Currently, asyncio.wait_for(fut), upon reaching the timeout deadline,
cancels the future and returns immediately.  This is problematic for
when *fut* is a Task, because it will be left running for an arbitrary
amount of time.  This behavior is iself surprising and may lead to
related bugs such as the one described in bpo-33638:

    condition = asyncio.Condition()
    async with condition:
        await asyncio.wait_for(condition.wait(), timeout=0.5)

Currently, instead of raising a TimeoutError, the above code will fail
with `RuntimeError: cannot wait on un-acquired lock`, because
`__aexit__` is reached _before_ `condition.wait()` finishes its
cancellation and re-acquires the condition lock.

To resolve this, make `wait_for` await for the task cancellation.
The tradeoff here is that the `timeout` promise may be broken if the
task decides to handle its cancellation in a slow way.  This represents
a behavior change and should probably not be back-patched to 3.6 and
earlier.
2018-05-29 17:31:01 -04:00
Yury Selivanov 863b674909
bpo-32684: Fix gather to propagate cancel of itself with return_exceptions (GH-7209) 2018-05-29 17:20:02 -04:00
Géry Ogam 1cee216cf3 bpo-31639: Change ThreadedHTTPServer to ThreadingHTTPServer class name (GH-7195) 2018-05-29 22:10:30 +02:00
Mandeep Singh e55de2d77f bpo-30935: update get_event_loop docs (GH-2731) 2018-05-29 14:37:08 -04:00
Serhiy Storchaka 73cbe7a01a
bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)
Remove the docstring attribute of AST types and restore docstring
expression as a first stmt in their body.

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-05-29 12:04:55 +03:00
Steve Dower 3e51a3d592
bpo-32878: Adds documentation for st_ino on Windows (GH-5764) 2018-05-28 17:24:36 -07:00
Andrés Delfino 8c1ad0c4f6 bpo-33670: Expose Sphinx errorlevel (GH-7156) 2018-05-28 16:28:22 -07:00
Andrés Delfino 3d3e66c2da bpo-33673: Install python-docs-theme even if Sphinx is already installed (GH-7163) 2018-05-28 16:20:34 -07:00
Yury Selivanov 416c1ebd98
bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174) 2018-05-28 17:54:02 -04:00
Yury Selivanov dbf102271f
bpo-33654: Support BufferedProtocol in set_protocol() and start_tls() (GH-7130)
In this commit:

* Support BufferedProtocol in set_protocol() and start_tls()
* Fix proactor to cancel readers reliably
* Update tests to be compatible with OpenSSL 1.1.1
* Clarify BufferedProtocol docs
* Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving
* Rewrite test_start_tls_server_1
2018-05-28 14:31:28 -04:00
Ethan Smith c651275afe bpo-32380: Create functools.singledispatchmethod (#6306) 2018-05-26 13:38:33 -07:00
Andrés Delfino 2298c0e6a6 Fix typo spotted by Guido (GH-7131) 2018-05-26 11:18:02 -07:00
Andrés Delfino 6e33f810c9 bpo-32769: A new take on annotations/type hinting glossary entries (GH-6829) 2018-05-26 05:43:39 -07:00
Ivan Levkivskyi 6e413f4327
Document typing.NoReturn (GH-7107) 2018-05-24 21:33:55 -07:00
Ned Deily 8ebf5ceb0f
bpo-33109: argparse subparsers are once again not required by default (GH-6919)
bpo-26510 in 3.7.0a2 changed the behavior of argparse to make
subparsers required by default, returning to the behavior of 2.7
and 3.2. The behavior was changed in 3.3 to be no longer required.
While it might make more sense to have the default to required,
compatibility with 3.3 through 3.6 is probably less disruptive
than trying to reintroduce compatibility with 2.7 at this point.
This change restores the 3.6 behavior.
2018-05-23 21:55:15 -04:00
Victor Stinner 453bd0bc65
bpo-33540: Add block_on_close attr to socketserver (GH-6911)
Add a new block_on_close class attribute to ForkingMixIn and
ThreadingMixIn classes of socketserver to opt-in for pre-3.7 behaviour.
2018-05-24 03:14:44 +02:00
Christian Heimes 529525fb5a
bpo-33618: Enable TLS 1.3 in tests (GH-7079)
TLS 1.3 behaves slightly different than TLS 1.2. Session tickets and TLS
client cert auth are now handled after the initialy handshake. Tests now
either send/recv data to trigger session and client certs. Or tests
ignore ConnectionResetError / BrokenPipeError on the server side to
handle clients that force-close the socket fd.

To test TLS 1.3, OpenSSL 1.1.1-pre7-dev (git master + OpenSSL PR
https://github.com/openssl/openssl/pull/6340) is required.

Signed-off-by: Christian Heimes <christian@python.org>
2018-05-23 22:24:45 +02:00
Yury Selivanov 28b9178023
bpo-32436: Document PEP 567 changes to asyncio. (GH-7073) 2018-05-23 13:35:04 -04:00
sth 825aab95fd bpo-27300: Add the errors parameter to tempfile classes. (GH-6696) 2018-05-23 08:07:01 +03:00
Matthias Bussonnier 8bb0b5b03c bpo-33604: Remove Pending from hmac Deprecation warning. (GH-7062)
bpo-33604: Bump removal notice from 3.6 to 3.8 and change PendingDeprecationWarning to DeprecationWarning as we had intended to do earlier...
2018-05-22 15:55:31 -07:00
Christian Heimes e8eb6cb792
bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976)
Change TLS 1.3 cipher suite settings for compatibility with OpenSSL
1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by
default.

Also update multissltests and Travis config to test with latest OpenSSL.

Signed-off-by: Christian Heimes <christian@python.org>
2018-05-22 22:50:12 +02:00
John Reese 6c4fab0f4b bpo-33516: Add support for __round__ in MagicMock (GH-6880)
unittest.mock.MagicMock now supports the __round__() magic method.
2018-05-22 22:01:10 +02:00
Serhiy Storchaka 4e29f566e8
Add missed details of the C API introduced in 3.7. (GH-7047)
* Set the limited API version for PyImport_GetModule and PyOS_*Fork
  functions.
* Add PyImport_GetModule and Py_UTF8Mode in PC/python3.def.
* Add several functions in Doc/data/refcounts.dat.
2018-05-22 20:59:42 +03:00
Elvis Pranskevichus b2f5f59ae1 bpo-33592: Document the C API in PEP 567 (contextvars) (GH-7033) 2018-05-22 13:31:56 -04:00
Masayuki Yamamoto 55bfe690d5 Add PyThread_tss_* to Doc/data/refcounts.dat. (GH-7038)
Thread Specific Storage (TSS) API is a public C API (new in 3.7).
2018-05-22 11:21:25 +03:00
Serhiy Storchaka f5b1183610
bpo-5945: Improve mappings and sequences C API docs. (GH-7029) 2018-05-22 11:02:44 +03:00
Andrés Delfino 268cc7c3f8 Fix lambda parameters being refered as arguments (GH-7037) 2018-05-22 07:57:45 +02:00
INADA Naoki 1179f4b40f
bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021) 2018-05-21 18:35:41 +09:00
Aaron Hall, MBA 4054b172ab bpo-26103: Fix inspect.isdatadescriptor() and a data descriptor definition. (GH-1959)
Look for '__set__' or '__delete__'.
2018-05-21 02:46:42 +03:00
Terry Jan Reedy dd281873ba
Add idlelib and IDLE section to What's New in 3.7. (#7019) 2018-05-20 17:00:13 -04:00
Andrés Delfino 0c4be82890 bpo-33580: Make binary/text file glossary entries follow most common "see also" style. (GH-6991) 2018-05-20 18:12:50 +03:00
Lisa Roach 900c48dba3 bpo-30940: Updating round() docs. (GH-6342) 2018-05-20 18:00:18 +03:00
Eitan Adler 9572132ab3 Docs: be less specific about python versions (GH-6985)
CPython 3.5 is old now, and we don't bump this version often,
so lets avoid using specific versions.
2018-05-20 17:38:01 +03:00
Serhiy Storchaka f5e7b1999f
bpo-23722: Raise a RuntimeError for absent __classcell__. (GH-6931)
A DeprecationWarning was emitted in Python 3.6-3.7.
2018-05-20 08:48:12 +03:00
Serhiy Storchaka 8ae8e6af37
bpo-23722: Fix docs for future __classcell__ changes. (GH-6999) 2018-05-20 08:13:52 +03:00
Elvis Pranskevichus 63536bd286 bpo-32996: The bulk of What's New in Python 3.7 (GH-6978) 2018-05-19 23:15:06 -04:00
Daniel Chimeno cf8abcbe03 import secrets module in secrets recipes (#6705) 2018-05-20 01:01:49 +10:00
Ivan Levkivskyi f65e31fee3
bpo-28556: Don't simplify unions at runtime (GH-6841) 2018-05-18 16:00:38 -07:00
Serhiy Storchaka bde3e0bf09
Fix C API docs: PyCapsule_Import always set an exception on failure. (GH-6967) 2018-05-18 16:32:54 +03:00
Miro Hrončok fb9dd89153 bpo-33559: Attribute changed repr of exceptions (GH-6954) 2018-05-17 15:04:57 -04:00
Miro Hrončok 631753fcc5 bpo-33559: Document changed repr of exceptions (GH-6943) 2018-05-17 13:44:53 -04:00
Yury Selivanov d8d715f514
asyncio/docs: Mark asyncio.run() as provisional in 3.7. (#6946) 2018-05-17 13:44:00 -04:00
Gregory P. Smith dff46758f2
bpo-19950: Clarify unittest TestCase instance use. (GH-6875) 2018-05-17 10:08:45 -05:00
Andrés Delfino d5f1442608 bpo-33518: Add PEP entry to documentation glossary (GH-6860) 2018-05-17 09:51:50 +02:00
Zvezdan Petkovic c2f082e9d1 bpo-13631: Fix the order of initialization for readline libedit on macOS. (GH-6915)
The editline emulation needs to be initialized *after* the name is
defined. This fixes the long open issue.
2018-05-17 02:45:10 -04:00
Steve Dower e5f41d2f1e
bpo-33522: Enable CI builds on Visual Studio Team Services (#6865) 2018-05-16 17:50:29 -04:00
Barry Warsaw 713a936736
bpo-32216: Update dataclasses documentation (#6913) 2018-05-16 15:50:07 -04:00
Petr Viktorin 8b94b41ab7
bpo-28167: Remove platform.linux_distribution (GH-6871)
* test_ssl: Remove skip_if_broken_ubuntu_ssl

We no longer support OpenSSL 0.9.8.15.15.

* bpo-28167: Remove platform.linux_distribution
2018-05-16 11:51:18 -04:00
Christopher Beacham 5db5c0669e bpo-21475: Support the Sitemap extension in robotparser (GH-6883) 2018-05-16 10:52:07 -04:00
Eric V. Smith 7a1c027501
Minor tweaks to dataclasses docs. (GH-6903) 2018-05-16 09:29:05 -04:00
Eric V. Smith 98d50cb8f5
bpo-32216: Add documentation for dataclasses (GH-6886)
This is an initial version that likely requires much polishing. I'm adding it lay out the structure and so we have something to start working from.
2018-05-16 04:20:43 -04:00
Christian Heimes 67c4801663 bpo-32257: Add ssl.OP_NO_RENEGOTIATION (GH-5904)
The ssl module now contains OP_NO_RENEGOTIATION constant, available with
OpenSSL 1.1.0h or 1.1.1.

Note, OpenSSL 1.1.0h hasn't been released yet.

Signed-off-by: Christian Heimes <christian@python.org>
2018-05-15 16:25:40 -04:00
Stéphane Wirtel 19177fbd5d bpo-33503: Fix the broken pypi link in the source and the documentation (GH-6814) 2018-05-15 14:58:35 -04:00
Matthias Bussonnier 9eb40bc38d bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669)
Also bump PendingDeprecationWarning to DeprecationWarning.
2018-05-15 11:17:00 -04:00
Travis DePrato b7b493e2fb Add AsyncContextManager to typing module documentation. (GH-6822) 2018-05-14 18:14:07 -04:00
Amber Brown 545c955be9 bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in FieldStorage use the given errors (GH-6804) 2018-05-14 18:11:55 -04:00
Andrés Delfino f2290fb19a bpo-32769: Write annotation entry for glossary (GH-6657)
https://bugs.python.org/issue32769
2018-05-14 15:04:55 -04:00
Romuald Brunet 0ded580403 Add versionchanged in create_datagram_endpoint doc (#4697)
Most of the parameters were added in 3.4.4 (b9bf913ab3), but this
change was not documented
2018-05-14 19:22:00 +03:00
Elena Oat 7ffd4c58fa bpo-22069: Update TextIO documentation (GH-6609)
Clarify that flush is implied when the call to write contains a newline character.
2018-05-14 10:48:01 -04:00
Serhiy Storchaka df00f04825 bpo-26701: Tweak the documentation for special methods in int(). (GH-6741) 2018-05-10 23:38:44 +10:00
Serhiy Storchaka ddb6215a55
bpo-13525: Fix incorrect encoding name in the tutorial example. (GH-6738) 2018-05-09 11:10:55 +03:00
Julien Palard b3c369861b Fix superfluous if in documentation. (GH-6728) 2018-05-09 10:25:22 +03:00
Ivan Levkivskyi bd5f96581b
bpo-32717: Document PEP 560 (GH-6726) 2018-05-08 19:38:41 +01:00
Vinay Sajip c4994dc00d
bpo-33400: Clarified documentation to indicate no strict adherence to ISO 8601. (GH-6702) 2018-05-04 22:20:54 +01:00
Antoine Pitrou 9d3627e311
bpo-33332: Add signal.valid_signals() (GH-6581) 2018-05-04 13:00:50 +02:00
Serhiy Storchaka ef347535f2
bpo-20104: Improve error handling and fix a reference leak in os.posix_spawn(). (#6332) 2018-05-01 16:45:04 +03:00
Stéphane Wirtel 7508a54c77 bpo-20709: os.utime(path_to_directory): wrong documentation for Windows. (GH-5469)
Remove the paragraph where we explain that os.utime() does not support a
directory as path under Windows. Patch by Jan-Philip Gehrcke

Co-authored-by: Jan-Philip Gehrcke <jgehrcke@gmail.com>
2018-05-01 12:02:26 +02:00
Julien Palard 335a602666
Add What's New for Korean documentation translation. (GH-6645) 2018-05-01 11:46:43 +02:00
Brett Cannon 3ab9365dca
bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467) 2018-04-30 11:31:45 -07:00
Siddhesh Poyarekar 55edd0c185 bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments.  This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
2018-04-29 21:59:33 +03:00
Bo Bayles 9f3535c9cd bpo-32362: Fix references to non-existent multiprocessing.Connection() (GH-6223) 2018-04-29 21:03:05 +03:00
Dong-hee Na 5779483299 bpo-33378: Add Korean to the language switcher. (GH-6627) 2018-04-28 22:08:22 +02:00
Tom Christie e022bbc169 Change "non-local state" to "content-local state". (GH-6617)
The wording here seems wrong, as per https://bugs.python.org/msg315792
2018-04-27 18:35:13 -04:00
Brian Curtin df826f36e0
Clarify the inspect.getmembers predicate parameter (#6615)
Previously, the predicate parameter was mentioned, but what it was to be
called with was not documented and required either trial-and-error or
looking into the source to find that it is called with the `value`, or
second item, of the full members list. This change addresses what the
predicate will receive, as well as does some light formatting to make
this clear.
2018-04-26 19:48:26 -04:00
Andrés Delfino 67a8f4fed3 bpo-33280: Reorganize external Tcl/Tk references. (GH-6473) 2018-04-25 20:53:58 +03:00
Neeraj Badlani 643ff711fa Mention both relevant PEPs in function annotations tutorial (GH-6304)
Patch by Neeraj Badlani.
2018-04-25 12:52:13 -05:00
Pablo Galindo d6ef6db9ff Fix rendering issues in the documentation for the os module (#6525) 2018-04-25 20:48:27 +03:00
Chris Bradbury e500839796 bpo-33251: Update documentation to reflect change. (GH-6446) (#6583) 2018-04-23 13:56:39 -07:00
Andrés Delfino b81ca28b37 bpo-33297: Mention Pillow to work with more image formats. (#6505)
Also update PIL doc references to Pillow.
2018-04-21 15:17:26 +03:00
Brett Cannon 441d945eb3
Clarify that __path__ can't be just any value (GH-6554) 2018-04-20 16:32:46 -07:00
Brett Cannon a8c342465b
bpo-25427: Remove pyvenv (GH-5962) 2018-04-20 14:15:40 -07:00
Ville Skyttä 61f82e0e33 Spelling fixes to docs, docstrings, and comments (GH-6374) 2018-04-20 16:08:45 -04:00
Pablo Galindo 9009f3e389 Update What's new in 3.7 to reference preadv, pwritev and posix_spawn (GH-6524) 2018-04-18 21:26:18 -07:00
Benjamin Peterson acfb087f9f
fix pydoc-topics to work with Sphinx 1.7 (GH-6475)
In fact, we now require a newer Sphinx version because APIs have moved around.
2018-04-16 22:56:46 -07:00
Andrés Delfino 4b685bf719 bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) 2018-04-17 08:34:35 +03:00
Łukasz Langa a00d440edb
Revert 725476222a (#6494)
This note in documentation was never true.
2018-04-16 20:00:31 -07:00
Andrés Delfino c89b221758 Remove to-be-deprecated urllib.request.urlretrieve function reference (#6454) 2018-04-16 07:02:56 -07:00
Nick Coghlan 1a5c4bdb6e
bpo-33185: Improve wording and markup (GH-6477)
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to GH-6419)
2018-04-15 23:32:05 +10:00
Nick Coghlan 82a9481059
bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)
The pydoc CLI assumed -m pydoc would add the empty string
to sys.path, and hence got confused when it switched to
adding the full initial working directory instead.

This refactors the pydoc CLI path manipulation to be
more testable, and ensures it won't accidentally
remove the standard library directory containing
pydoc itself from sys.path.
2018-04-15 21:52:57 +10:00
Antoine Pitrou 480ab05d5f
bpo-33176: Add a toreadonly() method to memoryviews. (GH-6466) 2018-04-14 19:49:21 +02:00
WeizhongTu ffa2c3e2c4 itemgetter add dict example (GH-1280) 2018-04-12 21:33:08 -04:00
suic86 04e8293465 Fix error messages in argparse examples (GH-6435)
The examples in argparse documentation use `error: too few arguments`
error message which was removed in this commit f97c59a in 2011.
2018-04-11 13:45:04 -05:00
Serhiy Storchaka d08972fdb9
bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447) 2018-04-11 19:15:51 +03:00
Serhiy Storchaka 46936d5a71
Improve highlighting of some code blocks. (GH-6401) 2018-04-08 19:18:04 +03:00
Raymond Hettinger 9265dd72e5
Add a prepend() recipe to teach a chain() idiom (GH-6415) 2018-04-08 08:44:20 -07:00
Alex Gaynor c87eb09d2e
bpo-29613: Added support for SameSite cookies (GH-6413)
* bpo-29613: Added support for SameSite cookies

Implemented as per draft
https://tools.ietf.org/html/draft-west-first-party-cookies-07

* Documented SameSite

And suggestions by members.

* Missing space :(

* Updated News and contributors

* Added version changed details.

* Fix in documentation

* fix in documentation

* Clubbed test cases for same attribute into single.

* Updates

* Style nits + expand tests

* review feedback
2018-04-07 16:09:42 -04:00
Antoine Pitrou 1d80a56173
bpo-33201: Modernize "Extension types" doc (GH-6337)
* bpo-33201: Modernize "Extension types" doc
* Split tutorial and other topics
* Some small fixes
* Address some review comments
* Rename noddy* to custom* and shoddy to sublist
* Fix markup
2018-04-07 18:14:03 +02:00
Jay Crotts ef5ce884a4 bpo-8243: Doc patch for curses.window.addstr and curses.window.addch (GH-5179) 2018-04-06 21:27:07 -04:00
Brett Cannon 9e2be60634
bpo-33169: Remove values of `None` from sys.path_importer_cache when invalidating caches (GH-6402)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
2018-04-06 16:10:18 -07:00
Alex Gaynor 1d87c7b80b
fixed capitalization of class name (GH-6396) 2018-04-06 08:26:49 -04:00
Łukasz Langa c51d8c9ba6
bpo-23403: Bump pickle.DEFAULT_PROTOCOL to 4 (#6355)
This makes performance better and produces shorter pickles. This change is backwards compatible up to the oldest currently supported version of Python (3.4).
2018-04-03 23:06:53 -07:00
INADA Naoki 42ec190761
bpo-33195: Doc: Deprecate Py_UNICODE in c-api/arg (GH-6329)
Py_UNICODE is deprecated since Python 3.3.
But the deprecation is missed in the c-api/arg document.
2018-04-04 13:59:08 +09:00