Commit Graph

97805 Commits

Author SHA1 Message Date
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
Antoine Pitrou a7e48b544b [3.6] bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (GH-1319) (#1454)
* bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver

* Tweak comment.
(cherry picked from commit 6dd4d734ed)
2017-05-04 17:12:35 +02:00
Victor Stinner 31906b42fd bpo-30225: Fix is_valid_fd() on macOS Tiger (#1443) (#1449)
is_valid_fd() now uses fstat() instead of dup() on macOS to return 0
on a pipe when the other side of the pipe is closed. fstat() fails
with EBADF in that case, whereas dup() succeed.
(cherry picked from commit 1c4670ea0c)
2017-05-04 13:21:10 +02:00
Serhiy Storchaka 1bebd8a219 [3.6] bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (GH-1316). (#1441)
(cherry picked from commit 5f161fd86d)
2017-05-04 06:50:28 +03:00
Mariatta af71364c3f [3.6] bpo-28315: Improve code examples in docs (GH-1372) (#1445)
Replace
   File "<stdin>", line 1, in ?
with
   File "<stdin>", line 1, in <module>
(cherry picked from commit 8856940cf2)
2017-05-03 18:41:20 -07:00
Zachary Ware 833dcb6259 Bump version in AppVeyor config (GH-1436) 2017-05-03 11:56:44 -05:00
Mariatta e612c28513 [3.6] bpo-28556: Routine updates to typing (GH-1366) (#1416)
- Add NoReturn type
- Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard)
- Minor bug-fixes
(cherry picked from commit f06e0218ef)
2017-05-03 09:38:01 -07:00
Mariatta 5bcf01d4cd [3.6] Fix typo in selectors.rst (GH-1383) (#1414)
decriptor -> descriptor
(cherry picked from commit b0d8203654)
2017-05-02 21:35:43 -07:00
Victor Stinner 564e89f43b regrtest: always show before/after of modified env (#1192) (#1406)
Buildbots don't run tests with -vv and so only log "xxx was modified
by test_xxx" which is not enough to debug such random issue. In many
cases, I'm unable to reproduce the warning and so unable to fix it.

Always logging the value before and value after should help to debug
such warning on buildbots.
(cherry picked from commit ec4b17239d)
2017-05-03 02:12:22 +02:00
Antoine Pitrou 0c2ff0898d Backport bpo-30205 to 3.6 (#1403) 2017-05-03 00:14:29 +02:00
Victor Stinner 4dae0d111d [3.6] bpo-30232: Support Git worktree in configure.ac (#1398)
* bpo-30232: Support Git worktree in configure.ac (#1391)

Don't test if .git/HEAD file exists, but only if the .git file (or
directory) exists.
(cherry picked from commit 5facdbb291)

* bpo-30232: Regenerate configure (#1396)

Run autoconf.
(cherry picked from commit 9ed34a8953)
2017-05-02 23:46:06 +02:00
Victor Stinner 3c422b9265 bpo-30199: test_ssl closes all asyncore channels (#1381) (#1390)
AsyncoreEchoServer of test_ssl now calls
asyncore.close_all(ignore_all=True) to ensure that
asyncore.socket_map is cleared once the test completes, even if
ConnectionHandler was not correctly unregistered.

Fix the following warning:

Warning -- asyncore.socket_map was modified by test_ssl
  Before: {}
  After:  {6: <test.test_ssl.AsyncoreEchoServer.EchoServer.ConnectionHandler>}
(cherry picked from commit 1dae7450c6)
2017-05-02 16:49:10 +02:00