]> granicus.if.org Git - python/log
python
7 years agobpo-30380: Pin the version of Sphinx used to build the docs (GH-1612) (GH-1617)
Brett Cannon [Tue, 16 May 2017 21:28:21 +0000 (14:28 -0700)]
bpo-30380: Pin the version of Sphinx used to build the docs (GH-1612) (GH-1617)

7 years ago[3.6] bpo-30380: Fix Sphinx 1.6.1 warnings. (GH-1613) (#1614)
Serhiy Storchaka [Tue, 16 May 2017 21:09:23 +0000 (00:09 +0300)]
[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 d97b7dc94b19063f0589d401bdc4aaadc7030762)

7 years ago[3.6] bpo-30375: Correct the stacklevel of regex compiling warnings. (GH-1595) (...
Serhiy Storchaka [Tue, 16 May 2017 15:16:15 +0000 (18:16 +0300)]
[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 c7ac7280c321b3c1679fe5f657a6be0f86adf173)

7 years ago bpo-29651 - Cover edge case of square brackets in urllib docs (#1128) (#1596)
Senthil Kumaran [Tue, 16 May 2017 05:41:07 +0000 (22:41 -0700)]
 bpo-29651 - Cover edge case of square brackets in urllib docs (#1128) (#1596)

(cherry picked from commit f6e863d868a621594df2a8abe072b5d4766e7137)

7 years agobpo-30242: resolve some undefined behaviours in struct (#1418) (#1586)
Xiang Zhang [Mon, 15 May 2017 05:17:28 +0000 (13:17 +0800)]
bpo-30242: resolve some undefined behaviours in struct (#1418) (#1586)

7 years agobpo-30110: fix resource leak in test_asyncio.test_events (#1413) (#1584)
Xiang Zhang [Mon, 15 May 2017 05:17:01 +0000 (13:17 +0800)]
bpo-30110: fix resource leak in test_asyncio.test_events (#1413) (#1584)

7 years agobpo-30358: Document sort argument of profile.runctx() (GH-1566)
Berker Peksag [Sun, 14 May 2017 15:30:48 +0000 (18:30 +0300)]
bpo-30358: Document sort argument of profile.runctx() (GH-1566)

(cherry picked from commit 99776296230ddd8429ebad2d07854b8c27ea10ab)

7 years ago[3.6] Move Codecov's configuration file under .github (GH-1494) (GH-1574)
Brett Cannon [Sat, 13 May 2017 20:51:24 +0000 (13:51 -0700)]
[3.6] Move Codecov's configuration file under .github (GH-1494) (GH-1574)

(cherry picked from commit cbddf58c797f850a5b06f317a4bb7ab69c6e9715)

7 years ago[3.6] bpo-30178: Indent methods and attributes of MimeType class (GH-1306) (#1570)
Mariatta [Sat, 13 May 2017 16:42:39 +0000 (09:42 -0700)]
[3.6] bpo-30178: Indent methods and attributes of MimeType class (GH-1306) (#1570)

(cherry picked from commit c71168090df435c1eb8c03005b11df764cd7ebd6)

7 years ago[3.6] bpo-30345: Update test_gdb.py and python-gdb.py from master (#1549)
Victor Stinner [Fri, 12 May 2017 22:21:50 +0000 (00:21 +0200)]
[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 611083331d534481ca7956a376e38fb0e9ef3854)

* Update and enhance python-gdb.py

bpo-29259: Detect PyCFunction is the current frame, not only in the
older frame.

7 years agobpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1546)
INADA Naoki [Thu, 11 May 2017 12:56:42 +0000 (21:56 +0900)]
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 991adca012f5e106c2d4040ce619c696ba6f9c46)

7 years ago[3.6] bpo-28787: Fix out of tree --with-dtrace builds (GH-135) (#1543)
stratakis [Thu, 11 May 2017 11:13:18 +0000 (13:13 +0200)]
[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 f6eae5bf1c5d7b83e5d5bdbecfff928e478c1cfd)

7 years agobpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) (#1529)
Xiang Zhang [Wed, 10 May 2017 11:00:15 +0000 (19:00 +0800)]
bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) (#1529)

7 years agobpo-30320: test_eintr now uses pthread_sigmask() (#1523) (#1524)
Victor Stinner [Wed, 10 May 2017 06:47:22 +0000 (08:47 +0200)]
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 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f)

7 years ago[3.6] bpo-30298: Weaken the condition of deprecation warnings for inline modifiers...
Serhiy Storchaka [Wed, 10 May 2017 03:44:02 +0000 (06:44 +0300)]
[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 305ccbe27ea5ba82fd2d8c32ec739f980e524330)

7 years ago[3.6] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478) (...
torsava [Tue, 9 May 2017 14:05:10 +0000 (16:05 +0200)]
[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 a1054c3b0037d4c2a5492e79fc193f36245366c7)

* [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 a1054c3b0037d4c2a5492e79fc193f36245366c7)

7 years agobpo-29990: Fix range checking in GB18030 decoder (#1495) (#1507)
Xiang Zhang [Tue, 9 May 2017 04:16:50 +0000 (12:16 +0800)]
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.

7 years agobpo-30289: remove Misc/python-config.sh when make distclean (#1498) (#1506)
Xiang Zhang [Tue, 9 May 2017 02:56:30 +0000 (10:56 +0800)]
bpo-30289: remove Misc/python-config.sh when make distclean (#1498) (#1506)

7 years ago[3.6] Revert bpo-26293 for zipfile breakage. See also bpo-29094. (GH-1484). (#1485)
Serhiy Storchaka [Sat, 6 May 2017 12:10:50 +0000 (15:10 +0300)]
[3.6] Revert bpo-26293 for zipfile breakage. See also bpo-29094. (GH-1484). (#1485)

(cherry picked from commit 3763ea865cee5bbabcce11cd577811135e0fc747)

7 years agobpo-30264: ExpatParser closes the source on error (#1451) (#1474)
Victor Stinner [Fri, 5 May 2017 08:04:57 +0000 (10:04 +0200)]
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 ef9c0e732fc50aefbdd7c5a80e04e14b31684e66)

7 years ago[3.6] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1469)
Serhiy Storchaka [Fri, 5 May 2017 07:40:30 +0000 (10:40 +0300)]
[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 76a3e51a403bc84ed536921866c86dd7d07aaa7e)

7 years ago[3.6] bpo-23404: make touch becomes make regen-all (#1405) (#1461)
Victor Stinner [Thu, 4 May 2017 22:46:56 +0000 (00:46 +0200)]
[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 a5c62a8e9f0de6c4133825a5710984a3cd5e102b)

* bpo-30273: Update sysconfig (#1464)

The AST_H_DIR variable was removed from Makefile.pre.in by the commit
a5c62a8e9f0de6c4133825a5710984a3cd5e102b (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 b109a1d3360fc4bb87b9887264e3634632d392ca)

7 years ago[3.6] bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (GH-1319) (#1454)
Antoine Pitrou [Thu, 4 May 2017 15:12:35 +0000 (17:12 +0200)]
[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 6dd4d734ed207ba16b017e38f8909de7ef187e29)

7 years agobpo-30225: Fix is_valid_fd() on macOS Tiger (#1443) (#1449)
Victor Stinner [Thu, 4 May 2017 11:21:10 +0000 (13:21 +0200)]
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 1c4670ea0cc3d208121af11b9b973e6bb268e570)

7 years ago[3.6] bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (GH-1316...
Serhiy Storchaka [Thu, 4 May 2017 03:50:28 +0000 (06:50 +0300)]
[3.6] bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (GH-1316). (#1441)

(cherry picked from commit 5f161fd86dd5bb936a1a2a13391b13b7e59ec201)

7 years ago[3.6] bpo-28315: Improve code examples in docs (GH-1372) (#1445)
Mariatta [Thu, 4 May 2017 01:41:20 +0000 (18:41 -0700)]
[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 8856940cf2e82cb17db2b684cd5732fe658605ca)

7 years agoBump version in AppVeyor config (GH-1436)
Zachary Ware [Wed, 3 May 2017 16:56:44 +0000 (11:56 -0500)]
Bump version in AppVeyor config (GH-1436)

7 years ago[3.6] bpo-28556: Routine updates to typing (GH-1366) (#1416)
Mariatta [Wed, 3 May 2017 16:38:01 +0000 (09:38 -0700)]
[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 f06e0218ef6007667f5d61184b85a81a0466d3ae)

7 years ago[3.6] Fix typo in selectors.rst (GH-1383) (#1414)
Mariatta [Wed, 3 May 2017 04:35:43 +0000 (21:35 -0700)]
[3.6] Fix typo in selectors.rst (GH-1383) (#1414)

decriptor -> descriptor
(cherry picked from commit b0d82036549074357717d130a772d1e2ebc8ea01)

7 years agoregrtest: always show before/after of modified env (#1192) (#1406)
Victor Stinner [Wed, 3 May 2017 00:12:22 +0000 (02:12 +0200)]
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 ec4b17239d899550be4ee6104b61751bb3c70382)

7 years agoBackport bpo-30205 to 3.6 (#1403)
Antoine Pitrou [Tue, 2 May 2017 22:14:29 +0000 (00:14 +0200)]
Backport bpo-30205 to 3.6 (#1403)

7 years ago[3.6] bpo-30232: Support Git worktree in configure.ac (#1398)
Victor Stinner [Tue, 2 May 2017 21:46:06 +0000 (23:46 +0200)]
[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 5facdbb29169c2799c42f887cef4cd9d087b0167)

* bpo-30232: Regenerate configure (#1396)

Run autoconf.
(cherry picked from commit 9ed34a89532763cf89f5e11fffb91ef7dee29fed)

7 years agobpo-30199: test_ssl closes all asyncore channels (#1381) (#1390)
Victor Stinner [Tue, 2 May 2017 14:49:10 +0000 (16:49 +0200)]
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 1dae7450c68bad498e57800387b24cb103c461fa)

7 years agobpo-30132: distutils BuildExtTestCase use temp_cwd (#1387)
Victor Stinner [Tue, 2 May 2017 13:50:42 +0000 (15:50 +0200)]
bpo-30132: distutils BuildExtTestCase use temp_cwd (#1387)

BuildExtTestCase of test_distutils now uses support.temp_cwd() in
setUp() to remove files created in the current working in all
BuildExtTestCase unit tests, not only test_build_ext().

Fix the following warning:

Warning -- files was modified by test_distutils
  Before: []
  After:  ['vc140.pdb']

7 years agobpo-30108: Restore sys.path in test_site (#1197) (#1378)
Victor Stinner [Tue, 2 May 2017 09:45:42 +0000 (11:45 +0200)]
bpo-30108: Restore sys.path in test_site (#1197) (#1378)

Add setUpModule() and tearDownModule() functions to test_site to
save/restore sys.path at the module level to prevent warning if the
user site directory is created, since site.addsitedir() modifies
sys.path.
(cherry picked from commit b85c136903c6d2368162f7c4a58f258c9c69ead0)

7 years agobpo-30104: Use -fno-strict-aliasing on clang (#1376)
Victor Stinner [Tue, 2 May 2017 08:47:37 +0000 (10:47 +0200)]
bpo-30104: Use -fno-strict-aliasing on clang (#1376)

Python/dtoa.c is not compiled correctly with clang 4.0 and
optimization level -O2 or higher, because of an aliasing issue on the
double/ULong[2] union. Only compile dtoa.c with -fno-strict-aliasing.

LLVM bug report:
https://bugs.llvm.org//show_bug.cgi?id=31928

7 years ago[3.6] Clean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition...
Mariatta [Tue, 2 May 2017 05:55:53 +0000 (22:55 -0700)]
[3.6] Clean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition (GH-1355) (#1371)

(cherry picked from commit d4069de5112f0408801ff2479476827bb3e0e8fc)

7 years ago[3.6] Improve the grammar in windows.rst (GH-1330) (GH-1360)
Mariatta [Sun, 30 Apr 2017 05:18:40 +0000 (22:18 -0700)]
[3.6] Improve the grammar in windows.rst (GH-1330) (GH-1360)

(cherry picked from commit 80a3da4d4aad0b51893e1e2f696b6252eca80e07)

7 years ago[3.6] bpo-30208: DOC: fix small typos in IDLE (#1356)
csabella [Sun, 30 Apr 2017 00:42:03 +0000 (20:42 -0400)]
[3.6] bpo-30208: DOC: fix small typos in IDLE (#1356)

(cherry picked from commit d9af73330f46d79cc0c56d369f65ebeec3cb5334)

7 years ago[3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. ...
Serhiy Storchaka [Fri, 28 Apr 2017 17:05:05 +0000 (20:05 +0300)]
[3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (GH-1341) (#1345)

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

(cherry picked from commit d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83)

7 years agobpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343)
Victor Stinner [Fri, 28 Apr 2017 14:06:48 +0000 (16:06 +0200)]
bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343)

Disable faulthandler to run test_SEH() of test_ctypes to prevent the
following log with a traceback:

    Windows fatal exception: access violation

Add support.disable_faulthandler() context manager.
(cherry picked from commit a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d)

7 years agobpo-30131: test_logging now joins queue threads (#1298) (#1317)
Victor Stinner [Fri, 28 Apr 2017 02:13:53 +0000 (04:13 +0200)]
bpo-30131: test_logging now joins queue threads (#1298) (#1317)

QueueListenerTest of test_logging now closes the multiprocessing
Queue and joins its thread to prevent leaking dangling threads to
following tests.

Add also @support.reap_threads to detect earlier if a test leaks
threads (and try to "cleanup" these threads).
(cherry picked from commit 8ca2f2faefa8dba323a2e4c4b86efb633d7a53cf)

7 years ago[3.6] bpo-30106: Fix test_asyncore.test_quick_connect() (#1336)
Victor Stinner [Fri, 28 Apr 2017 02:13:37 +0000 (04:13 +0200)]
[3.6] bpo-30106: Fix test_asyncore.test_quick_connect() (#1336)

* Fix/optimize test_asyncore.test_quick_connect() (#1188)

Don't use addCleanup() in test_quick_connect() because it keeps the
Thread object alive and so @reap_threads fails on its timeout of 1
second. "./python -m test -v test_asyncore -m test_quick_connect"
now takes 185 ms, instead of 11 seconds.

Other minor changes:

* Use "with sock:" to close the socket instead of
  try/finally: sock.close()
* Use self.skipTest() in test_quick_connect() to remove one
  indentation level and notice user that the test is specific to
  AF_INET and AF_INET6

* bpo-30106: Fix tearDown() of test_asyncore (#1194)

Call asyncore.close_all() with ignore_all=True in the tearDown()
method of the test_asyncore base test case. It should prevent keeping
alive sockets in asyncore.socket_map if close() fails with an
unexpected error.

Revert also an unwanted change of my previous commit: remove name
parameter of Thread in test_quick_connect().

* bpo-30106: Fix test_asyncore.test_quick_connect() (#1234)

test_quick_connect() runs a thread up to 50 seconds, whereas the
socket is connected in 0.2 second and then the thread is expected to
end in less than 3 second. On Linux, the thread ends quickly because
select() seems to always return quickly. On FreeBSD, sometimes
select() fails with timeout and so the thread runs much longer than
expected.

Fix the thread timeout to fix a race condition in the test.

7 years agobpo-30107: Make SuppressCrashReport quiet on macOS (#1279) (#1335)
Victor Stinner [Fri, 28 Apr 2017 01:27:51 +0000 (03:27 +0200)]
bpo-30107: Make SuppressCrashReport quiet on macOS (#1279) (#1335)

On macOS, SuppressCrashReport now redirects /usr/bin/defaults command
stderr into a pipe to not pollute stderr. It fixes a
test_io.test_daemon_threads_shutdown_stderr_deadlock() failure when
the CrashReporter domain doesn't exists. Message logged into stderr:

2017-04-24 16:57:21.432 defaults[41046:2462851]
The domain/default pair of (com.apple.CrashReporter, DialogType) does not exist
(cherry picked from commit d819ad9832292d854e9710493ecdf959b69802e3)

7 years agobpo-30175: Skip client cert tests of test_imaplib (#1320) (#1323)
Victor Stinner [Thu, 27 Apr 2017 16:25:03 +0000 (18:25 +0200)]
bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1323)

* bpo-30175: Skip client cert tests of test_imaplib

The IMAP server cyrus.andrew.cmu.edu doesn't accept our randomly
generated client x509 certificate anymore.

* bpo-30188: Catch EOFError in NetworkedNNTPTests

test_nntplib fails randomly with EOFError in
NetworkedNNTPTests.setUpClass(). Catch EOFError to skip tests in that
case.

(cherry picked from commit 5bccca58b9b2b3a925b16750bedbd907695ea8d7)

7 years ago[3.6] bpo-30182: Use the correct name for ISO in Unicode HOWTO. (GH-1312) (GH-1313)
Mariatta [Thu, 27 Apr 2017 05:18:53 +0000 (22:18 -0700)]
[3.6] bpo-30182: Use the correct name for ISO in Unicode HOWTO. (GH-1312) (GH-1313)

(cherry picked from commit 6fde770e4e940c19cd62de0b6aeb77840690843e)

7 years ago[3.6] bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1303)
Dong-hee Na [Wed, 26 Apr 2017 16:55:55 +0000 (01:55 +0900)]
[3.6] bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1303)

7 years agobpo-29974: Improve typing.TYPE_CHECKING example (GH-982)
Berker Peksag [Wed, 26 Apr 2017 14:25:37 +0000 (17:25 +0300)]
bpo-29974: Improve typing.TYPE_CHECKING example (GH-982)

* Fix PEP 8 (SomeType instead of some_type)
* Add a function parameter annotation
* Explain, using wording from PEP 484 and PEP 526,
  why one annotation is in quotes and another is not.

Suggested by Ivan Levkevskyi.

(cherry picked from commit 87c07fe9d908d0a2143fcc8369255c6ff3241503)

7 years agobpo-28698: Fix c_wchar_p doc example (GH-1160)
Louie Lu [Wed, 26 Apr 2017 08:45:31 +0000 (16:45 +0800)]
bpo-28698: Fix c_wchar_p doc example (GH-1160)

(cherry picked from commit 0d637e236d7099f7b724026c8cb7bd83d8e12e6b)

7 years ago[3.6] bpo-28851: Improve namedtuple documentation (GH-1274) (GH-1286)
Mariatta [Wed, 26 Apr 2017 01:23:05 +0000 (18:23 -0700)]
[3.6] bpo-28851: Improve namedtuple documentation (GH-1274) (GH-1286)

Clarify that a sequence of strings is the preferred value for 'field_names'.
(cherry picked from commit 97bf722fcd1de1236824377e052369dc7686b644)

7 years ago[3.6] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1266)
Mariatta [Mon, 24 Apr 2017 04:05:01 +0000 (21:05 -0700)]
[3.6] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1266)

(cherry picked from commit 26896f2832324dde85cdd63d525571ca669f6f0b)

7 years ago[3.6] bpo-15718: Document the upper bound constrain on the __len__ return value....
Serhiy Storchaka [Sun, 23 Apr 2017 05:50:14 +0000 (08:50 +0300)]
[3.6] bpo-15718: Document the upper bound constrain on the __len__ return value. (GH-1256) (#1259)

(cherry picked from commit 85157cd)

7 years ago[3.6] Fix trailing colon and newline in test.rst (GH-1250) (#1254)
Louie Lu [Sat, 22 Apr 2017 11:48:53 +0000 (19:48 +0800)]
[3.6] Fix trailing colon and newline in test.rst (GH-1250) (#1254)

(cherry picked from commit 7fae81e1672d0b4110d31ea6a765b54f63a2e54b)

7 years agobpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170...
Mariatta [Sat, 22 Apr 2017 02:58:28 +0000 (19:58 -0700)]
bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future   (GH-1170) (#1247)

(cherry picked from commit ae5b3260dd459845aad8a30491b76d471577785d)

7 years ago[3.6] Correct the README link in Unix install docs (GH-1245) (GH-1248)
Mariatta [Sat, 22 Apr 2017 02:28:29 +0000 (19:28 -0700)]
[3.6] Correct the README link in Unix install docs (GH-1245) (GH-1248)

(cherry picked from commit d1ae24e8880fe00d006eb2996af815c35fbcfb33)

7 years agobpo-30125: Fix faulthandler.disable() on Windows (#1243)
Victor Stinner [Fri, 21 Apr 2017 21:17:33 +0000 (23:17 +0200)]
bpo-30125: Fix faulthandler.disable() on Windows (#1243)

On Windows, faulthandler.disable() now removes the exception handler
installed by faulthandler.enable().

7 years agobpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries (GH-1222...
Steve Dower [Fri, 21 Apr 2017 18:28:46 +0000 (11:28 -0700)]
bpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries (GH-1222) (GH-1244)

liblzma is missing from pcbuild.sln. This causes the build of _lzma to fail when building the solution and not using build.bat.

7 years agobpo-30107: don't dump core on expected test_io crash (#1235) (#1241)
Victor Stinner [Fri, 21 Apr 2017 16:27:29 +0000 (18:27 +0200)]
bpo-30107: don't dump core on expected test_io crash (#1235) (#1241)

test_io has two unit tests which trigger a deadlock:

* test_daemon_threads_shutdown_stdout_deadlock()
* test_daemon_threads_shutdown_stderr_deadlock()

These tests call Py_FatalError() if the expected bug is triggered
which calls abort(). Use test.support.SuppressCrashReport to prevent
the creation on a core dump, to fix the warning:

Warning -- files was modified by test_io
  Before: []
  After:  ['python.core']
(cherry picked from commit 2a1aed04b0943636f605543522e16cca1dc23e70)

7 years ago[3.6] Add missing .gitignore entries for VS2015 IntelliSense DB (GH-1223) (#1225)
Mariatta [Fri, 21 Apr 2017 03:55:59 +0000 (20:55 -0700)]
[3.6] Add missing .gitignore entries for VS2015 IntelliSense DB (GH-1223) (#1225)

(cherry picked from commit 8e675286a92f33837cfffac5914b5175dac5d573)

7 years agobpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (#1217)
Serhiy Storchaka [Thu, 20 Apr 2017 19:55:06 +0000 (22:55 +0300)]
bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (#1217)

7 years ago[3.6] bpo-30109: Fix reindent.py (GH-1207) (GH-1208)
Mariatta [Thu, 20 Apr 2017 14:12:37 +0000 (07:12 -0700)]
[3.6] bpo-30109: Fix reindent.py (GH-1207) (GH-1208)

Skip the file if it has bad encoding.
(cherry picked from commit 58f3c9dc8f5626abe09ac9738c34f6ba99ce2972)

7 years ago[3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168...
Dong-hee Na [Thu, 20 Apr 2017 08:26:25 +0000 (17:26 +0900)]
[3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168) (#1198)

7 years agoRemove redundant comma in argparse HOWTO (GH-1141)
Berker Peksag [Thu, 20 Apr 2017 04:42:32 +0000 (07:42 +0300)]
Remove redundant comma in argparse HOWTO (GH-1141)

Reported by Sean Canavan on docs@p.o.

(cherry picked from commit 8526fb74edf5ac9ca175b7cdcb0d82bb8780d2cf)

7 years agobpo-30078: Add an example of passing a path to unittest (GH-1178)
Berker Peksag [Thu, 20 Apr 2017 04:36:57 +0000 (07:36 +0300)]
bpo-30078: Add an example of passing a path to unittest (GH-1178)

(cherry picked from commit f7e62cf8adfb8ab6a6a870903defe8ff218a0383)

7 years agobpo-19225: Remove duplicated description for standard warning categories (GH-1068)
cocoatomo [Thu, 20 Apr 2017 03:54:06 +0000 (12:54 +0900)]
bpo-19225: Remove duplicated description for standard warning categories (GH-1068)

7 years ago[3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (GH...
Serhiy Storchaka [Wed, 19 Apr 2017 20:59:02 +0000 (23:59 +0300)]
[3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (GH-1110) (#1186)

(cherry picked from commit 66bffd1)

7 years ago[3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser module...
Serhiy Storchaka [Wed, 19 Apr 2017 20:22:19 +0000 (23:22 +0300)]
[3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (#1184)

(cherry picked from commit a79f4c219531c05fc8f670c1e4bbf12c081935d3)

7 years agobpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) (...
Serhiy Storchaka [Wed, 19 Apr 2017 18:22:49 +0000 (21:22 +0300)]
bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) (#1180)

raised an error.

(cherry picked from commit bf623ae8843dc30b28c574bec8d29fc14be59d86)

7 years agobpo-30017: Allowed calling the close() method of the zip entry writer object (#1041...
Serhiy Storchaka [Sun, 16 Apr 2017 09:04:45 +0000 (12:04 +0300)]
bpo-30017: Allowed calling the close() method of the zip entry writer object (#1041) (#1092)

multiple times.  Writing to closed zip entry writer object now always produce
a ValueError.
(cherry picked from commit 4c0d9ea995da595e90e08813b89510de59907802)

7 years agobpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present ...
Xiang Zhang [Sat, 15 Apr 2017 05:25:15 +0000 (13:25 +0800)]
bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) (#1150)

7 years ago[3.6] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1149)
Michael Seifert [Sat, 15 Apr 2017 02:03:41 +0000 (04:03 +0200)]
[3.6] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1149)

7 years ago[3.6] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1142)
Mariatta [Sat, 15 Apr 2017 01:34:11 +0000 (18:34 -0700)]
[3.6] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1142)

* Remove conditional on free of `dps`, since `dps` is now allocated for
all versions of OpenSSL
* Remove call to `x509_check_ca` since it was only used to cache
the `crldp` field of the certificate
CRL_DIST_POINTS_free is available in all supported versions of OpenSSL
(recent 0.9.8+) and LibreSSL.
(cherry picked from commit 2849cc34a8db93d448a62d69c462402347b50dcb)

7 years agoimprove alignment autoconf test (#1129) (#1139)
Benjamin Peterson [Fri, 14 Apr 2017 16:59:34 +0000 (09:59 -0700)]
improve alignment autoconf test (#1129) (#1139)

Replace the deprecated AC_TRY_RUN with AC_RUN_IFELSE. Also, standardize the
variable name and allow for caching of the result.

7 years agoFix misplaced positional argument in OS X support library (#1137)
Jack McCracken [Fri, 14 Apr 2017 14:44:34 +0000 (10:44 -0400)]
Fix misplaced positional argument in OS X support library (#1137)

7 years agoRelax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1132)
Antoine Pitrou [Fri, 14 Apr 2017 11:37:46 +0000 (13:37 +0200)]
Relax test timing (bpo-29861) to avoid sporadic failures (#1120) (#1132)

(cherry picked from commit 685cdb9acc3fca04a9897d88b89771ddfd50e772)

7 years ago[3.6] bpo-29694: race condition in pathlib mkdir with flags parents=True (GH-1089...
Mariatta [Fri, 14 Apr 2017 02:26:16 +0000 (19:26 -0700)]
[3.6] bpo-29694: race condition in pathlib mkdir with flags parents=True (GH-1089). (GH-1126)

(cherry picked from commit 22a594a0047d7706537ff2ac676cdc0f1dcb329c)

7 years ago[3.6] bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-1119) (GH...
Mariatta [Thu, 13 Apr 2017 23:54:49 +0000 (16:54 -0700)]
[3.6] bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-1119) (GH-1122)

* Allow underscores in numeric literals in lib2to3.
* Stricter literal parsing for Python 3.6 in lib2to3.pgen2.tokenize.
* Add test case for underscores in literals in Python 3.
(cherry picked from commit a6e395dffadf8c5124903c01ad69fefa36b1a935)

7 years ago[3.6] Fix a typo in Doc/library/functions.rst (GH-1117) (GH-1123)
Mariatta [Thu, 13 Apr 2017 23:37:51 +0000 (16:37 -0700)]
[3.6] Fix a typo in Doc/library/functions.rst (GH-1117) (GH-1123)

Replace `For object's ... ` with `For objects ...`
(cherry picked from commit 873ef20d0007b4b120933473e6252d2309a70102)

7 years agoconvert from long long to PyLong loselessly (#1106) (#1121)
Benjamin Peterson [Thu, 13 Apr 2017 21:11:48 +0000 (14:11 -0700)]
convert from long long to PyLong loselessly (#1106) (#1121)

7 years agobpo-30021: Add examples for re.escape(). (#1048) (#1115)
Serhiy Storchaka [Thu, 13 Apr 2017 16:41:19 +0000 (19:41 +0300)]
bpo-30021: Add examples for re.escape(). (#1048) (#1115)

And fix the parameter name.

(cherry picked from commit 8fc7bc2b7631ee819ee614e47b6f44bacebe1574)

7 years agobpo-29791: Clarify that flush is keyword-only argument (GH-1093)
Berker Peksag [Thu, 13 Apr 2017 13:17:01 +0000 (16:17 +0300)]
bpo-29791: Clarify that flush is keyword-only argument (GH-1093)

Reported by Lucio Ricardo Montero Valenzuela.

(cherry picked from commit 61b9ac93712df8092a25223cd56fa6528359792b)

7 years agoRevert "bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-752)" (GH...
Mariatta [Thu, 13 Apr 2017 11:03:16 +0000 (04:03 -0700)]
Revert "bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-752)" (GH-1109)

This reverts commit 97a40b7a5b2979fb17e1751c139fd4ba1ebd5276.
The commit is supposed to go to the master branch first.

7 years agobpo-29869: Allow underscores in numeric literals in lib2to3. (GH-752)
Nevada Sanchez [Thu, 13 Apr 2017 10:21:05 +0000 (06:21 -0400)]
bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-752)

7 years ago[3.6] bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError ...
Mariatta [Thu, 13 Apr 2017 09:50:21 +0000 (02:50 -0700)]
[3.6] bpo-29692: contextlib.contextmanager may incorrectly unchain RuntimeError (GH-949) (#1105)

contextlib._GeneratorContextManager.__exit__ includes a special case to deal with
PEP 479 RuntimeErrors created when `StopIteration` is thrown into the context
manager body.

Previously this check was too permissive, and undid one level of chaining on *all*
RuntimeError instances, not just those that wrapped a StopIteration instance.
(cherry picked from commit 00c75e9a45ff0366c185e9e8a2e23af5a35481b0)

7 years ago[3.6] Clarify exception handler scope in contextlib (GH-1103)
Mariatta [Thu, 13 Apr 2017 03:52:39 +0000 (20:52 -0700)]
[3.6] Clarify exception handler scope in contextlib (GH-1103)

Moved explicit raise from inside try to try...else.
(cherry picked from commit 680e20beee8bbce9f857b8e7795009191f98b0ba)

7 years ago[3.6] Remove superfluous comment in urllib.error. (GH-1076) (GH-1101)
Mariatta [Thu, 13 Apr 2017 03:45:54 +0000 (20:45 -0700)]
[3.6] Remove superfluous comment in urllib.error. (GH-1076) (GH-1101)

(cherry picked from commit 6fab78e9027f9ebd6414995580781b480433e595)

7 years agobpo-26985: Add missing info of code object in inspect documentation (GH-1090) (GH...
Xiang Zhang [Thu, 13 Apr 2017 03:14:17 +0000 (11:14 +0800)]
bpo-26985: Add missing info of code object in inspect documentation (GH-1090) (GH-1099)

7 years ago[3.6] bpo-30047: Fix a typo in Doc/library/select.rst (GH-1086) (GH-1098)
Mariatta [Thu, 13 Apr 2017 03:02:21 +0000 (20:02 -0700)]
[3.6] bpo-30047: Fix a typo in Doc/library/select.rst (GH-1086) (GH-1098)

(cherry picked from commit 3e0f1fc4e0ffcfcc706015fa3d67c262948ef171)

7 years agoRemove OSError related comment in urllib.request. (#1072)
Senthil Kumaran [Mon, 10 Apr 2017 03:37:44 +0000 (20:37 -0700)]
Remove OSError related comment in urllib.request. (#1072)

(cherry picked from commit 6dfcc81f6b1c82a71a1c876e14424fb8b3573447)

7 years ago[3.6] Improvements to typing documentation (GH-967) (GH-1053)
Mariatta [Sun, 9 Apr 2017 22:17:28 +0000 (15:17 -0700)]
[3.6] Improvements to typing documentation (GH-967) (GH-1053)

Documents a few omitted classes and adds NamedTuple methods.
(cherry picked from commit 45d22c256bce3afcf57f49032a6b20fdec4f26ad)

7 years ago[3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)
Mariatta [Sun, 9 Apr 2017 22:17:06 +0000 (15:17 -0700)]
[3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)

(cherry picked from commit 43ba8861e0ad044efafa46a7cc04e12ac5df640e)

7 years ago[3.6] Correct typo in configparser.rst (GH-1012) (GH-1025)
Mariatta [Sun, 9 Apr 2017 22:15:57 +0000 (15:15 -0700)]
[3.6] Correct typo in configparser.rst (GH-1012) (GH-1025)

(cherry picked from commit 01fa9ae5460b00bf1ced500c797176ebd3fb060d)

7 years agoRemove invalid comment in urllib.request. (#1055)
Senthil Kumaran [Sun, 9 Apr 2017 17:15:06 +0000 (10:15 -0700)]
Remove invalid comment in urllib.request. (#1055)

(cherry picked from commit a2a9ddd923a849124bdd1c484f70f02df6fde0e9)

7 years agobpo-29506: Clarify deep copy note in copy module
Nick Coghlan [Sun, 9 Apr 2017 10:57:04 +0000 (20:57 +1000)]
bpo-29506: Clarify deep copy note in copy module

The reference to administrative data was confusing to readers,
so this simplifies the note to explain that deep copying may copy
more then you intended, such as data that you expected to be
shared between copies.
(cherry picked from commit 19e04942562a980ad2519f6ff79c455a7472783b)

7 years agobpo-29798: Handle git worktree in patchcheck (#1058) (#1060)
Nick Coghlan [Sun, 9 Apr 2017 09:22:36 +0000 (19:22 +1000)]
bpo-29798: Handle git worktree in patchcheck (#1058) (#1060)

The original attempted fix missed an `isdir()` call in
`get_base_branch()`.
(cherry picked from commit 2abfdf5a81383d3b1ed6b7321903a9a168c373c5)

7 years agobpo-29998: Pickling and copying ImportError now preserves name and path (#1010) ...
Serhiy Storchaka [Sat, 8 Apr 2017 08:25:47 +0000 (11:25 +0300)]
bpo-29998: Pickling and copying ImportError now preserves name and path (#1010) (#1042)

attributes.
(cherry picked from commit b785396ab451b0c9d6ae9ee5a9e56c810209a6cb)

7 years agoExpand the PySlice_GetIndicesEx macro. (#1023) (#1044)
Serhiy Storchaka [Sat, 8 Apr 2017 08:18:14 +0000 (11:18 +0300)]
Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)

(cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)

7 years agobpo-29939: suppress compiler warnings in _ctypes_test (#1038)
Vinay Sajip [Fri, 7 Apr 2017 22:23:08 +0000 (23:23 +0100)]
bpo-29939: suppress compiler warnings in _ctypes_test (#1038)

bpo-29939: Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler.
(cherry picked from commit 164d30eb1e66575dafee6af4fca4cbf52c7fbe6a)

7 years agoFix a minor typo. (#1032) (#1037)
Barry Warsaw [Fri, 7 Apr 2017 20:50:13 +0000 (16:50 -0400)]
Fix a minor typo. (#1032) (#1037)

(cherry picked from commit dd9a0a14c89d57e43898d4b866b8c161e4ff8506)

7 years agoRemove Invalid comment in test_urllib2.py. (#1022)
Senthil Kumaran [Fri, 7 Apr 2017 07:56:59 +0000 (00:56 -0700)]
Remove Invalid comment in test_urllib2.py. (#1022)

(cherry picked from commit fd0cd07a5a3c964c084f4efc5bbcb89dd2193ee6)