Commit Graph

97816 Commits

Author SHA1 Message Date
Serhiy Storchaka 89a3102640 [3.6] bpo-29104: Fixed parsing backslashes in f-strings. (GH-490) (#1812)
(cherry picked from commit 0cd7a3f)
2017-05-25 14:18:55 +03:00
Zachary Ware a2a9984a27 [3.6] bpo-30160: Clarify intended usage of wfile (gh-1300) (GH-1793)
The library does not enforce compliance with the HTTP protocol,
so violations are not technically disallowed. Extend the stream's
description to avoid suggesting that intentional protocol violations are
not supported.
(cherry picked from commit a083c8e)
2017-05-24 16:11:01 -05:00
Stéphane Wirtel c3454f0e79 bpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1790) 2017-05-25 02:59:06 +08:00
Kushal Das 9bcf81da14 [3.6] bpo-30376: Update outdated WindowObject references (GH-1630) (#1746)
(cherry picked from commit 93fc20b73e)
2017-05-23 09:57:04 -07:00
Łukasz Langa 70705e3cdf [3.6] call remove_done_callback in finally section (GH-1688) (#1755)
(cherry picked from commit 21b3e04c13)
2017-05-23 00:36:23 -07:00
Vijay Kumar 762add7877 Fix spelling mistakes in tkinter.py (#1751)
Ran the docstrings through spell checker, and fixed spelling issues.
2017-05-23 09:14:02 +03:00
Mariatta 6ef0882303 [3.6] bpo-21056: Document return type of next method of csv reader (GH-146) (#1749)
(cherry picked from commit d618c8c6d3)
2017-05-22 22:27:02 -07:00
T. Wouters 07a40a1623 [3.6] Add --with-assertions configure flag to enable C assertions(GH-1731) (#1739)
Defaults to 'no', but as before assertions are implied by --with-pydebug..
(cherry picked from commit ddbfa2c35b)
2017-05-22 22:25:17 -07:00
Łukasz Langa e8412e684e [3.6] bpo-23894: make lib2to3 recognize f-strings (GH-1733) (#1737)
Note: this doesn't unpack f-strings into the underlying JoinedStr AST.

Ideally we'd fully implement JoinedStr here but given its additional
complexity, I think this is worth bandaiding as is. This unblocks tools like
https://github.com/google/yapf to format 3.6 syntax using f-strings.
(cherry picked from commit 1b9530c536)
2017-05-22 22:23:29 -07:00
Łukasz Langa d29feccec3 [3.6] bpo-30395 _PyGILState_Reinit deadlock fix (GH-1734) (#1740)
head_lock could be held by another thread when fork happened. We should
reset it to avoid deadlock.
(cherry picked from commit f82c951d1c)
2017-05-22 22:23:05 -07:00
Łukasz Langa 1398b1bc7d [3.6] Make rb'' strings work in lib2to3 (GH-1724) (#1730)
This partially solves bpo-23894.
(cherry picked from commit 0c4aca54dc)
2017-05-22 16:35:15 -07:00
Mariatta 3d3b189f8e [3.6] bpo-30372: Clarify that '__builtins__' is a CPython Implementation detail (GH-1725) (GH-1727)
(cherry picked from commit 43c8a9e39b)
2017-05-22 14:36:19 -07:00
Xiang Zhang 54af41d42e bpo-30003: Fix handling escape characters in HZ codec (#1556) (#1719) 2017-05-23 01:03:00 +08:00
delirious-lettuce 0702cc01fa [3.6] Fix typos in multiple `.rst` files (GH-1668) (#1702)
(cherry picked from commit 3378b2062c)
2017-05-22 00:26:01 +03:00
Serhiy Storchaka cf5c1be8f6 [3.6] bpo-30415: Add new tests for the fnmatch module. (GH-1684) (#1694)
(cherry picked from commit 8175547)
2017-05-21 10:35:39 +03:00
Senthil Kumaran b5bf7e85b7 bpo-29976: urllib.parse clarify '' in scheme values. (GH-984) (GH-1692)
(cherry picked from commit 906f5330b9)
2017-05-20 23:23:03 -07:00
Serhiy Storchaka 564398af6c [3.6] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1677)
Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3934)
2017-05-20 13:06:26 +03:00
Serhiy Storchaka 193f7e094f [3.6] bpo-25794: Fix `type.__setattr__()` for non-interned attribute names. (GH-1652) (#1673)
Based on patch by Eryk Sun.
(cherry picked from commit d896985bb2)
2017-05-20 10:23:31 +03:00
Victor Stinner 2773add19a bpo-27103: regrtest disables -W if -R is used (#1651) (#1656)
Workaround for a regrtest bug.
(cherry picked from commit fcdd9b6b7e)
2017-05-18 13:36:51 -07:00
Victor Stinner 44944b602a bpo-30387: Fix warning in test_threading (#1634) (#1636)
test_is_alive_after_fork() now joins directly the thread to avoid the
following warning added by bpo-30357:

Warning -- threading_cleanup() failed to cleanup 0 threads
after 2 sec (count: 0, dangling: 21)

Use also a different exit code to catch generic exit code 1.
(cherry picked from commit f8d05b3a24)
2017-05-17 14:49:38 -07:00
Victor Stinner 69f3a5ac28 tmtotuple(): use time_t for gmtoff (#1276) (#1635)
timegm() return type is time_t, not int. Use time_t to prevent the
following compiler warning on Windows:

timemodule.c: warning C4244: '=': conversion from 'time_t' to 'int',
              possible loss of data
(cherry picked from commit 0d659e5614)
2017-05-17 14:45:45 -07:00
Senthil Kumaran 0d1727835f Remove unused variable in test_urllibnet. (#1598) (#1600)
(cherry picked from commit 1bd7d299bd)
2017-05-17 10:51:01 -07:00
Xiang Zhang 43d4c0329e bpo-30301: Fix AttributeError when using SimpleQueue.empty() (#1601) (#1628)
Under *spawn* and *forkserver* start methods, SimpleQueue.empty() could
raise AttributeError due to not setting _poll in __setstate__.
2017-05-17 22:03:35 +08:00
Dominik Miedziński b769c91c2d Fix ModuleNotFoundError typo in import reference (#1610)
(cherry picked from commit c138d84b8d)
2017-05-17 09:17:55 +03:00
Victor Stinner 460945f22a bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) (#1625)
compiled out-of-tree (builddir != srcdir). (see also bpo-15366)
(cherry picked from commit dbdea629e2)
2017-05-16 17:58:02 -07:00
Victor Stinner 6b5b85aecf bpo-30357: test_thread now uses threading_cleanup() (#1592) (#1622)
test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.

Co-Authored-By:  Grzegorz Grzywacz <grzegorz.grzywacz@nazwa.pl>
(cherry picked from commit 79ef7f8e88)
2017-05-16 17:06:14 -07:00
Victor Stinner aaa0536525 bpo-30329: Catch Windows error 10022 on shutdown() (#1538) (#1620)
Catch the Windows socket WSAEINVAL error (code 10022) in imaplib and
poplib on shutdown(SHUT_RDWR): An invalid operation was attempted

This error occurs sometimes on SSL connections.
(cherry picked from commit 83a2c28798)
2017-05-16 15:29:41 -07:00
Berker Peksag 0d267041c4 bpo-29898: Fix incorrect env variable name (GH-1576)
It should read PYTHONLEGACYWINDOWSSTDIO as stated
in section "Add legacy mode" in PEP 528.

(cherry picked from commit 87fa8a780e)
2017-05-17 00:31:39 +03:00
Brett Cannon 5e2016dce9 bpo-30380: Pin the version of Sphinx used to build the docs (GH-1612) (GH-1617) 2017-05-16 14:28:21 -07:00
Serhiy Storchaka 8fc1ff51ad [3.6] bpo-30380: Fix Sphinx 1.6.1 warnings. (GH-1613) (#1614)
* Use explicit numbering for footnotes referred by explicit number.
* Restore missed footnote reference in stdtypes.rst.
* Fix literal strings formatting in howto/urllib2.rst.
* Update susp-ignored.csv for zipapp.rst.
* Fix suspicious mark up in Misc/NEWS..
(cherry picked from commit d97b7dc94b)
2017-05-17 00:09:23 +03:00
Serhiy Storchaka 73fb45df04 [3.6] bpo-30375: Correct the stacklevel of regex compiling warnings. (GH-1595) (#1604)
Warnings emitted when compile a regular expression now always point
to the line in the user code.  Previously they could point into inners
of the re module if emitted from inside of groups or conditionals..
(cherry picked from commit c7ac7280c3)
2017-05-16 18:16:15 +03:00
Senthil Kumaran 75b8a54bca bpo-29651 - Cover edge case of square brackets in urllib docs (#1128) (#1596)
(cherry picked from commit f6e863d868)
2017-05-15 22:41:07 -07:00
Xiang Zhang aad1caf55f bpo-30242: resolve some undefined behaviours in struct (#1418) (#1586) 2017-05-15 13:17:28 +08:00
Xiang Zhang 0ce1f7e02d bpo-30110: fix resource leak in test_asyncio.test_events (#1413) (#1584) 2017-05-15 13:17:01 +08:00
Berker Peksag 61b6e5cf92 bpo-30358: Document sort argument of profile.runctx() (GH-1566)
(cherry picked from commit 9977629623)
2017-05-14 18:30:48 +03:00
Brett Cannon 178756c15d [3.6] Move Codecov's configuration file under .github (GH-1494) (GH-1574)
(cherry picked from commit cbddf58c79)
2017-05-13 13:51:24 -07:00
Mariatta 3a66ab8695 [3.6] bpo-30178: Indent methods and attributes of MimeType class (GH-1306) (#1570)
(cherry picked from commit c71168090d)
2017-05-13 09:42:39 -07:00
Victor Stinner d05f7fdf6c [3.6] bpo-30345: Update test_gdb.py and python-gdb.py from master (#1549)
* python-gdb.py supports method-wrapper

bpo-29367: python-gdb.py now supports also method-wrapper (wrapperobject)
objects.

(cherry picked from commit 611083331d)

* Update and enhance python-gdb.py

bpo-29259: Detect PyCFunction is the current frame, not only in the
older frame.
2017-05-13 00:21:50 +02:00
INADA Naoki 3dc7c52a9f bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1546)
when there are no more `await` or `yield (from)` before return in coroutine,
cancel was ignored.

example:

    async def coro():
        asyncio.Task.current_task().cancel()
        return 42
    ...
    res = await coro()  # should raise CancelledError

(cherry picked from commit 991adca012)
2017-05-11 21:56:42 +09:00
stratakis a4465a5bd0 [3.6] bpo-28787: Fix out of tree --with-dtrace builds (GH-135) (#1543)
* bpo-28787: Fix out of tree --with-dtrace builds

* Unsilence directory creation

* Add Misc/NEWS and Misc/ACKS entries.
(cherry picked from commit f6eae5bf1c)
2017-05-11 13:13:18 +02:00
Xiang Zhang 98b49a00d4 bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) (#1529) 2017-05-10 19:00:15 +08:00
Victor Stinner 81ed537846 bpo-30320: test_eintr now uses pthread_sigmask() (#1523) (#1524)
Rewrite sigwaitinfo() and sigtimedwait() unit tests for EINTR using
pthread_sigmask() to fix a race condition between the child and the
parent process.

Remove the pipe which was used as a weak workaround against the race
condition.

sigtimedwait() is now tested with a child process sending a signal
instead of testing the timeout feature which is more unstable
(especially regarding to clock resolution depending on the platform).
(cherry picked from commit 211a392cc1)
2017-05-10 08:47:22 +02:00
Serhiy Storchaka 418d60a525 [3.6] bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (GH-1490) (#1525)
Now allowed several subsequential inline modifiers at the start of the
pattern (e.g. '(?i)(?s)...').  In verbose mode whitespaces and comments
now are allowed before and between inline modifiers (e.g.
'(?x) (?i) (?s)...')..
(cherry picked from commit 305ccbe27e)
2017-05-10 06:44:02 +03:00
torsava 03b8a378df [3.6] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478) (#1518)
* bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478)

* bpo-29243: Fix Makefile with respect to --enable-optimizations

When using the Profile Guided Optimization (./configure --enable-optimizations)
Python is built not only during `make` but rebuilt again during `make test`,
`make install` and others. This patch fixes the issue.

Note that this fix produces no change at all in the Makefile if configure is
run witout --enable-optimizations.

* !squash

(cherry picked from commit a1054c3b00)

* [3.6] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478)

* bpo-29243: Fix Makefile with respect to --enable-optimizations

When using the Profile Guided Optimization (./configure --enable-optimizations)
Python is built not only during `make` but rebuilt again during `make test`,
`make install` and others. This patch fixes the issue.

Note that this fix produces no change at all in the Makefile if configure is
run witout --enable-optimizations.

* !squash.
(cherry picked from commit a1054c3b00)
2017-05-09 16:05:10 +02:00
Xiang Zhang 72e1b61da0 bpo-29990: Fix range checking in GB18030 decoder (#1495) (#1507)
When decoding a 4-byte GB18030 sequence, the first and third byte cannot exceed 0xFE.
2017-05-09 12:16:50 +08:00
Xiang Zhang 410d75ab71 bpo-30289: remove Misc/python-config.sh when make distclean (#1498) (#1506) 2017-05-09 10:56:30 +08:00
Serhiy Storchaka 70dc6a7a0b [3.6] Revert bpo-26293 for zipfile breakage. See also bpo-29094. (GH-1484). (#1485)
(cherry picked from commit 3763ea865c)
2017-05-06 15:10:50 +03:00
Victor Stinner 0fe870f3f9 bpo-30264: ExpatParser closes the source on error (#1451) (#1474)
ExpatParser.parse() of xml.sax.xmlreader now always closes the
source: close the file object or the urllib object if source is a
string (not an open file-like object). The change fixes a
ResourceWarning on parsing error.

Add test_parse_close_source() unit test.
(cherry picked from commit ef9c0e732f)
2017-05-05 10:04:57 +02:00
Serhiy Storchaka 39b73dd513 [3.6] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1469)
It was possible to get a core dump by using uninitialized
_json objects. Now __new__ methods create initialized objects.
__init__ methods are removed..
(cherry picked from commit 76a3e51a40)
2017-05-05 10:40:30 +03:00
Victor Stinner 9d02f56296 [3.6] bpo-23404: make touch becomes make regen-all (#1405) (#1461)
* bpo-23404: make touch becomes make regen-all (#1405)

Don't rebuild generated files based on file modification time
anymore, the action is now explicit. Replace "make touch"
with "make regen-all".

Changes:

* Remove "make touch", Tools/hg/hgtouch.py and .hgtouch
* Add a new "make regen-all" command to rebuild all generated files
* Add subcommands to only generate specific files:

  - regen-ast: Include/Python-ast.h and Python/Python-ast.c
  - regen-grammar: Include/graminit.h and Python/graminit.c
  - regen-importlib: Python/importlib_external.h and Python/importlib.h
  - regen-opcode: Include/opcode.h
  - regen-opcode-targets: Python/opcode_targets.h
  - regen-typeslots: Objects/typeslots.inc

* Rename PYTHON_FOR_GEN to PYTHON_FOR_REGEN
* pgen is now only built by by "make regen-grammar"
* Add $(srcdir)/ prefix to paths to source files to handle correctly
  compilation outside the source directory

Note: $(PYTHON_FOR_REGEN) is no more used nor needed by "make"
default target building Python.
(cherry picked from commit a5c62a8e9f)

* bpo-30273: Update sysconfig (#1464)

The AST_H_DIR variable was removed from Makefile.pre.in by the commit
a5c62a8e9f (bpo-23404).

AST_H_DIR was hardcoded to "Include", so replace the removed variable
by its content.

Remove also ASDLGEN variable from sysconfig example since this
variable was also removed.
(cherry picked from commit b109a1d336)
2017-05-05 00:46:56 +02:00