Commit Graph

97816 Commits

Author SHA1 Message Date
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
Victor Stinner 3076895849 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']
2017-05-02 15:50:42 +02:00
Victor Stinner 33a5d40de9 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 b85c136903)
2017-05-02 11:45:42 +02:00
Victor Stinner 809101f14f 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
2017-05-02 10:47:37 +02:00
Mariatta 78b23ab682 [3.6] Clean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition (GH-1355) (#1371)
(cherry picked from commit d4069de511)
2017-05-01 22:55:53 -07:00
Mariatta 750ff5f8df [3.6] Improve the grammar in windows.rst (GH-1330) (GH-1360)
(cherry picked from commit 80a3da4d4a)
2017-04-29 22:18:40 -07:00
csabella 5a8dcec939 [3.6] bpo-30208: DOC: fix small typos in IDLE (#1356)
(cherry picked from commit d9af73330f)
2017-04-29 20:42:03 -04:00
Serhiy Storchaka 712114b3f9 [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 d1a1def7bf)
2017-04-28 20:05:05 +03:00
Victor Stinner e005dd9a6d 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 a36e939aeb)
2017-04-28 16:06:48 +02:00
Victor Stinner cb21f5f3d2 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 8ca2f2faef)
2017-04-28 04:13:53 +02:00
Victor Stinner caa59c156d [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.
2017-04-28 04:13:37 +02:00
Victor Stinner c9ca57eeea 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 d819ad9832)
2017-04-28 03:27:51 +02:00
Victor Stinner 4dc3b9cf2a 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 5bccca58b9)
2017-04-27 18:25:03 +02:00
Mariatta 33a5568f69 [3.6] bpo-30182: Use the correct name for ISO in Unicode HOWTO. (GH-1312) (GH-1313)
(cherry picked from commit 6fde770e4e)
2017-04-26 22:18:53 -07:00
Dong-hee Na 2fc3c543fc [3.6] bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1303) 2017-04-26 09:55:55 -07:00
Berker Peksag 04f389b8b3 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 87c07fe9d9)
2017-04-26 17:25:37 +03:00
Louie Lu 9f6828119d bpo-28698: Fix c_wchar_p doc example (GH-1160)
(cherry picked from commit 0d637e236d)
2017-04-26 11:45:31 +03:00
Mariatta 16b6f971bd [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 97bf722fcd)
2017-04-25 18:23:05 -07:00
Mariatta ea0efa3bc1 [3.6] bpo-29751: Improve PyLong_FromString documentation (GH-915) (#1266)
(cherry picked from commit 26896f2832)
2017-04-23 21:05:01 -07:00
Serhiy Storchaka f2ed2858ee [3.6] bpo-15718: Document the upper bound constrain on the __len__ return value. (GH-1256) (#1259)
(cherry picked from commit 85157cd)
2017-04-23 08:50:14 +03:00
Louie Lu 9d022f169e [3.6] Fix trailing colon and newline in test.rst (GH-1250) (#1254)
(cherry picked from commit 7fae81e167)
2017-04-22 14:48:53 +03:00
Mariatta a3d8dda7d8 bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) (#1247)
(cherry picked from commit ae5b3260dd)
2017-04-21 19:58:28 -07:00
Mariatta 414e0283a3 [3.6] Correct the README link in Unix install docs (GH-1245) (GH-1248)
(cherry picked from commit d1ae24e888)
2017-04-21 19:28:29 -07:00
Victor Stinner 3a8f8ea2ac bpo-30125: Fix faulthandler.disable() on Windows (#1243)
On Windows, faulthandler.disable() now removes the exception handler
installed by faulthandler.enable().
2017-04-21 23:17:33 +02:00
Steve Dower 1ccbe6007e 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.
2017-04-21 11:28:46 -07:00
Victor Stinner b984a05d55 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 2a1aed04b0)
2017-04-21 18:27:29 +02:00
Mariatta 483729526e [3.6] Add missing .gitignore entries for VS2015 IntelliSense DB (GH-1223) (#1225)
(cherry picked from commit 8e675286a9)
2017-04-20 20:55:59 -07:00
Serhiy Storchaka 7a113a0cbf bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). (#1217) 2017-04-20 22:55:06 +03:00
Mariatta 430020500c [3.6] bpo-30109: Fix reindent.py (GH-1207) (GH-1208)
Skip the file if it has bad encoding.
(cherry picked from commit 58f3c9dc8f)
2017-04-20 07:12:37 -07:00
Dong-hee Na df5df13fdc [3.6] bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168) (#1198) 2017-04-20 11:26:25 +03:00
Berker Peksag 83a90b9aed Remove redundant comma in argparse HOWTO (GH-1141)
Reported by Sean Canavan on docs@p.o.

(cherry picked from commit 8526fb74ed)
2017-04-20 07:42:32 +03:00
Berker Peksag 596e714d79 bpo-30078: Add an example of passing a path to unittest (GH-1178)
(cherry picked from commit f7e62cf8ad)
2017-04-20 07:36:57 +03:00
cocoatomo 5fb4bf91e7 bpo-19225: Remove duplicated description for standard warning categories (GH-1068) 2017-04-20 06:54:06 +03:00
Serhiy Storchaka e254617262 [3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (GH-1110) (#1186)
(cherry picked from commit 66bffd1)
2017-04-19 23:59:02 +03:00
Serhiy Storchaka 39dedb6e1a [3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (#1184)
(cherry picked from commit a79f4c2195)
2017-04-19 23:22:19 +03:00
Serhiy Storchaka 680fea4067 bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096) (#1180)
raised an error.

(cherry picked from commit bf623ae884)
2017-04-19 21:22:49 +03:00
Serhiy Storchaka 8e5b52a8da 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 4c0d9ea995)
2017-04-16 12:04:45 +03:00
Xiang Zhang d5fa5f3ce7 bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) (#1150) 2017-04-15 13:25:15 +08:00
Michael Seifert 05bfbcd233 [3.6] bpo-30059: Include Py_Ellipsis in C API documentation (GH-1018) (GH-1149) 2017-04-14 19:03:41 -07:00
Mariatta 8e7201342d [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 2849cc34a8)
2017-04-14 18:34:11 -07:00