Commit Graph

99125 Commits

Author SHA1 Message Date
Jesse Gonzalez 6fde770e4e Use the correct name for ISO in Unicode HOWTO. (#1312) 2017-04-26 22:12:17 -07:00
Louie Lu 88c38b32b7 bpo-28415: Note 0 conversion different between Python and C (#885) 2017-04-27 11:36:35 +08:00
Dong-hee Na a90b990480 bpo-30142: Remove "callable" from the 2to3fixer documentation. (GH-1296) 2017-04-26 09:16:21 -07:00
Eijebong ab7886b785 bpo-30101: Add support for curses.A_ITALIC. (#1015) 2017-04-26 23:17:12 +08:00
Victor Stinner 8ca2f2faef bpo-30131: test_logging now joins queue threads (#1298)
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).
2017-04-26 15:56:25 +02:00
Victor Stinner 6e676954de timemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294)
bpo-28769 changed PyUnicode_AsUTF8() return type from const char* to
char* in Python 3.7, but tm_zone field type of the tm structure is
char* on FreeBSD.

Cast PyUnicode_AsUTF8() to char* in gettmarg() to fix the warning:

    Modules/timemodule.c:443:20: warning: assigning to 'char *'
    from 'const char *' discards qualifiers
2017-04-26 13:51:48 +02:00
Mathias Rav 87c07fe9d9 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.
2017-04-26 13:49:45 +03:00
Louie Lu 0d637e236d bpo-28698: Fix c_wchar_p doc example (GH-1160) 2017-04-26 11:15:05 +03:00
csabella c6db4811f9 bpo-30052: Link `bytes` & `bytearray` to stdtypes not functions (GH-1271)
Builtin container types have two potential link targets in the docs:

- their entry in the list of builtin callables
- their type documentation

This change brings `bytes` and `bytearray` into line with other
container types by having cross-references default to linking to
their type documentation, rather than their builtin callable entry.
2017-04-26 15:47:01 +10:00
Victor Stinner d819ad9832 bpo-30107: Make SuppressCrashReport quiet on macOS (#1279)
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
2017-04-26 00:55:08 +02:00
Jim Fasarakis-Hilliard 08c16016e2 bpo:29950: Rename SlotWrapperType to WrapperDescriptorType (GH-926) 2017-04-25 21:26:36 +03:00
csabella 97bf722fcd bpo-28851: Improve namedtuple documentation (GH-1274)
Clarify that a sequence of strings is the preferred value for 'field_names'.
2017-04-25 09:14:45 -07:00
INADA Naoki 3e2ad8ec61 bpo-29617: Remove Python 3.3 support from asyncio (GH-232) 2017-04-25 10:57:18 +09:00
Victor Stinner f6448e5d65 bpo-30132: distutils test_build_ext() uses temp_cwd() (#1278)
test_build_ext() of test_distutils now uses support.temp_cwd() to
prevent the creation of a pdb file in the current working directory
on Windows.
2017-04-25 02:11:09 +02:00
Victor Stinner 0d659e5614 tmtotuple(): use time_t for gmtoff (#1276)
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
2017-04-25 01:22:42 +02:00
Victor Stinner 4bcfa3a236 bpo-30131: Cleanup threads in test_logging (#1275)
* Use @support.reap_threads on unit tests creating threads
* Call TestCase.fail() on thread.join(timeout) failure
2017-04-25 00:41:36 +02:00
Nate fcfe80ec25 bpo-29822: Make inspect.isabstract() work during __init_subclass__. (#678)
At the time when an abstract base class' __init_subclass__ runs,
ABCMeta.__new__ has not yet finished running, so in the presence of
__init_subclass__, inspect.isabstract() can no longer depend only on
TPFLAGS_IS_ABSTRACT.
2017-04-24 20:06:15 +03:00
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