Commit Graph

99208 Commits

Author SHA1 Message Date
Serhiy Storchaka 2e576f5aec bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263) 2017-04-24 09:05:00 +03:00
Mariatta 9eb5ca0774 bpo-29751: add Cheryl Sabella to Misc/ACKS (GH-1268) 2017-04-23 21:05:19 -07:00
csabella 26896f2832 bpo-29751: Improve PyLong_FromString documentation (GH-915) 2017-04-23 20:54:08 -07:00
Serhiy Storchaka 85157cd89a bpo-15718: Document the upper bound constrain on the __len__ return value. (#1256) 2017-04-23 08:37:58 +03:00
Serhiy Storchaka 997a4adea6 Remove outdated note about constraining of the bit shift right operand. (#1258)
The constrain was removed in bpo-29816.
2017-04-22 21:50:09 +03:00
Louie Lu 7fae81e167 Fix trailing colon and newline in test.rst (#1250) 2017-04-22 09:46:18 +03:00
Serhiy Storchaka 7bfd740e3d Remove unneeded Misc/NEWS entry for bpo-29802. (#1251)
The bug was added in still not released version.
2017-04-22 09:24:59 +03:00
bladebryan 9616a82e78 bpo-29960 _random.Random corrupted on exception in setstate(). (#1019) 2017-04-22 09:10:46 +03:00
Serhiy Storchaka 1a5856bf92 bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751) 2017-04-22 01:48:11 +02:00
Victor Stinner a36e939aeb bpo-30125: disable faulthandler in ctypes test_SEH (#1237)
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.
2017-04-22 00:31:13 +02:00
Charles Renwick ae5b3260dd bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170) 2017-04-21 13:49:48 -07:00
Sebastian Vetter d1ae24e888 Correct the README link in Unix install docs (#1245) 2017-04-21 10:24:57 -07:00
Victor Stinner 46c2b81026 bpo-30125: Fix faulthandler.disable() on Windows (#1240)
* bpo-30125: Cleanup faulthandler.c

* Use size_t type for iterators
* Add { ... }

* bpo-30125: Fix faulthandler.disable() on Windows

On Windows, faulthandler.disable() now removes the exception handler
installed by faulthandler.enable().
2017-04-21 18:06:13 +02:00
Victor Stinner 2a1aed04b0 bpo-30107: don't dump core on expected test_io crash (#1235)
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']
2017-04-21 17:59:23 +02:00
Victor Stinner a2c877c398 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-21 13:51:53 +02:00
Victor Stinner 35f3d240ee bpo-30104: configure now detects when cc is clang (#1233)
Detect when the "cc" compiler (and the $CC variable) is the Clang
compiler. The test is needed to add the -fno-strict-aliasing option
on FreeBSD where cc is clang.
2017-04-21 12:35:24 +02:00
Victor Stinner 28205b203a bpo-30104: Use -fno-strict-aliasing on clang (#1221)
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.

LLVM bug report:
https://bugs.llvm.org//show_bug.cgi?id=31928
2017-04-21 11:24:34 +02:00
Benjamin Peterson 791dc83119 remove configure test for inline keyword (#1231)
We require C99, so a configure test for this standard feature is not needed.
2017-04-20 23:52:19 -07:00
Segev Finer f60c9e54f5 bpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries (#1222)
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-20 16:33:28 -07:00
Segev Finer 8e675286a9 Add missing .gitignore entries for VS2015 IntelliSense DB (#1223) 2017-04-20 16:32:26 -07:00
Serhiy Storchaka 40db90c1ce bpo-29802: Fix reference counting in module-level struct functions (#1213)
when pass arguments of wrong type.
2017-04-20 21:19:31 +03:00
Victor Stinner 8f5cdfa9fc Only define get_zone() and get_gmtoff() if needed (#1193)
Only define the get_zone() and get_gmtoff() private functions in the
time module if these functions are needed to initialize the module.

The change fixes the following warnings on AIX:

Modules/timemodule.c:1175:1: warning: 'get_gmtoff' defined but not used [-Wunused-function]
Modules/timemodule.c:1164:1: warning: 'get_zone' defined but not used [-Wunused-function]
2017-04-20 13:41:09 +02:00
Victor Stinner d20324a7fa support.threading_cleanup() log a warning on fail (#1195)
The @reap_threads decorator and the threading_cleanup() function of
test.support now log a warning if they fail to clenaup threads.

Fix also the usage of support.threading_cleanup() in
test_urllib2_localnet.

The log may help to debug such other warning seen on the AMD64
FreeBSD CURRENT Non-Debug 3.x buildbot:

Warning -- threading._dangling was modified by test_logging
2017-04-20 13:40:08 +02:00
Victor Stinner b85c136903 bpo-30108: Restore sys.path in test_site (#1197)
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.
2017-04-20 13:39:39 +02:00
Dong-hee Na b4dc6af7a7 bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168) 2017-04-20 10:31:17 +03:00
Mariatta 58f3c9dc8f bpo-30109: Fix reindent.py (GH-1207)
Skip the file if it has bad encoding.
2017-04-19 22:59:20 -07:00
Berker Peksag 6dbdedb0b1 bpo-10379: Add %char examples to locale.format() docs (GH-1145) 2017-04-20 07:38:43 +03:00
Berker Peksag 8526fb74ed Remove redundant comma in argparse HOWTO (#1141)
Reported by Sean Canavan on docs@p.o.
2017-04-20 07:29:35 +03:00
Louie Lu f7e62cf8ad bpo-30078: Add an example of passing a path to unittest (#1178) 2017-04-20 06:46:59 +03:00
Victor Stinner 11470b6dcd 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().
2017-04-20 02:55:39 +02:00
Victor Stinner d13d54748d bpo-29887: test_normalization handles PermissionError (#1196)
Skip test_normalization.test_main() if download raises a permission
error.
2017-04-20 02:39:59 +02:00
Victor Stinner ec4b17239d regrtest: always show before/after of modified env (#1192)
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.
2017-04-20 00:57:30 +02:00
Victor Stinner 7b9619ae24 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
2017-04-19 23:42:46 +02:00
Victor Stinner 1e62bf145b bpo-30030: Revert f50354ad (tempfile) (#1187)
Revert f50354adaaafebe95ad09d09b825804a686ea843: it introduced a
regression in test_threadedtempfile.
2017-04-19 22:59:51 +02:00
Serhiy Storchaka 66bffd1663 bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110) 2017-04-19 21:12:46 +03:00
Serhiy Storchaka a79f4c2195 bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (#1131) 2017-04-19 21:09:21 +03:00
Serhiy Storchaka d90045f319 bpo-22352: Adjust widths in the output of dis.dis() for large line numbers and (#1153)
instruction offsets.

Add tests for widths of opcode names.
2017-04-19 20:36:31 +03:00
Serhiy Storchaka bf623ae884 bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)
raised an error.

Replace them with using concrete types API that never fails if appropriate.
2017-04-19 20:03:52 +03:00
Victor Stinner c209b70d61 bpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971) 2017-04-19 13:01:03 +02:00
Mariatta 8312fba0a1 Minor grammar fixes (GH-1174) 2017-04-18 18:59:47 -07:00
cocoatomo 992ae6444c Fix minor typos (GH-1173) 2017-04-18 17:38:26 -07:00
Eric Appelt d6d344d833 bpo-29514: Check magic number for bugfix release (#54)
* bpo-29514: Check magic number for micro release

Add a dict importlib.util.EXPECTED_MAGIC_NUMBERS which
details the initial and expected pyc magic number for
each minor release. This gives a mechanism for users to
check if the magic number has changed within a release and
for a test to ensure procedure is followed if a change is
necessary.

Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.

* Simplify magic number release test

Simplify the magic number release test by removing
EXPECTED_MAGIC_NUMBERS table and making the expected
magic number self-contained within the test.

BPO: 29514

* Improve magic number test execution and message

Improve the execution of the magic number test by
using skipUnless for alpha and beta releases, and
directly inheriting from unittest.TestCase rather than
using the machinery for the other tests. Also improve
the error message to explain the reason for caution in
changing the magic number.

BPO: 29514
2017-04-17 11:35:43 -07:00
Xiang Zhang 8e1ddbd592 fix a refleak in slot_sq_length (#1162) 2017-04-17 00:54:21 +08:00
Serhiy Storchaka 55fe1ae970 bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) 2017-04-16 10:46:38 +03:00
Serhiy Storchaka fdbd01151d bpo-10076: Compiled regular expression and match objects now are copyable. (#1000) 2017-04-16 10:16:03 +03:00
Serhiy Storchaka cd85d0b90b bpo-28765: Use concrete types API in _sre.c. (#1009) 2017-04-16 09:39:30 +03:00
Serhiy Storchaka baf9f29811 bpo-29839: Raise ValueError rather than OverflowError in len() for negative values. (#701) 2017-04-16 09:37:18 +03:00
Serhiy Storchaka 813f943c59 bpo-29838: Add asserts for checking results of sq_length and mq_length slots. (#700)
Negative result should be returned only when an error is set.
2017-04-16 09:21:44 +03:00
Xiang Zhang 026435ce49 bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) 2017-04-15 12:47:28 +08:00
cocoatomo eaeda64c2f bpo-19225: Remove duplicated description for standard warning categories (GH-1068) 2017-04-15 05:06:02 +03:00