]> granicus.if.org Git - python/log
python
7 years agobpo-30215: Make re.compile() locale agnostic. (#1361)
Serhiy Storchaka [Fri, 5 May 2017 05:53:40 +0000 (08:53 +0300)]
bpo-30215: Make re.compile() locale agnostic. (#1361)

Compiled regular expression objects with the re.LOCALE flag no longer
depend on the locale at compile time.  Only the locale at matching
time affects the result of matching.

7 years agoMake code coverage less strict (GH-1438)
Brett Cannon [Thu, 4 May 2017 21:58:54 +0000 (14:58 -0700)]
Make code coverage less strict (GH-1438)

Set the target to be 90% since there is enough OS-specific code and things that require manual testing that we will never hit 100%. Also turn off the status checks since they are so inconsistent in terms of flagging a PR as passing/failing that they aren't useful and can actually block merging from a phone.

7 years agobpo-30273: Update sysconfig (#1464)
Victor Stinner [Thu, 4 May 2017 21:29:09 +0000 (23:29 +0200)]
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.

7 years agobpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319)
Antoine Pitrou [Thu, 4 May 2017 14:44:53 +0000 (16:44 +0200)]
bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319)

* bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver

* Tweak comment

7 years agobpo-30263: regrtest: log system load (#1452)
Victor Stinner [Thu, 4 May 2017 13:21:12 +0000 (15:21 +0200)]
bpo-30263: regrtest: log system load (#1452)

* bpo-30263: regrtest: log system load

* regrtest: log the number of CPUs

Log the number of CPUs in the header. --verbose now imply --header.

7 years agobpo-29956: Improve the math.exp() related documentation. (#1073)
Serhiy Storchaka [Thu, 4 May 2017 09:25:09 +0000 (12:25 +0300)]
bpo-29956: Improve the math.exp() related documentation. (#1073)

7 years agobpo-30166: Import command-line parsing modules only when needed. (#1293)
Serhiy Storchaka [Thu, 4 May 2017 05:17:47 +0000 (08:17 +0300)]
bpo-30166: Import command-line parsing modules only when needed. (#1293)

7 years agobpo-30225: Fix is_valid_fd() on macOS Tiger (#1443)
Victor Stinner [Wed, 3 May 2017 22:45:56 +0000 (00:45 +0200)]
bpo-30225: Fix is_valid_fd() on macOS Tiger (#1443)

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.

7 years agobpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)
Serhiy Storchaka [Wed, 3 May 2017 21:03:23 +0000 (00:03 +0300)]
bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)

7 years agoAdd myself to mention-bot's alwaysNotifyForPaths for ssl/hashlib (#1425)
Christian Heimes [Wed, 3 May 2017 18:17:54 +0000 (20:17 +0200)]
Add myself to mention-bot's alwaysNotifyForPaths for ssl/hashlib (#1425)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoExplicitly mention what should (not) be discussed on GitHub (GH-1437)
Brett Cannon [Wed, 3 May 2017 17:51:55 +0000 (10:51 -0700)]
Explicitly mention what should (not) be discussed on GitHub (GH-1437)

7 years agobpo-28315: Improve code examples in docs (GH-1372)
UltimateCoder [Wed, 3 May 2017 16:46:45 +0000 (22:16 +0530)]
bpo-28315: Improve code examples in docs (GH-1372)

Replace
   File "<stdin>", line 1, in ?
with
   File "<stdin>", line 1, in <module>

7 years agobpo-23404: make touch becomes make regen-all (#1405)
Victor Stinner [Wed, 3 May 2017 16:21:48 +0000 (18:21 +0200)]
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.

7 years agobpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326)
Xiang Zhang [Wed, 3 May 2017 03:16:21 +0000 (11:16 +0800)]
bpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326)

7 years agoFix tests: getsockname() can return None on OS X on unbound sockets (#1400)
Antoine Pitrou [Tue, 2 May 2017 21:48:26 +0000 (23:48 +0200)]
Fix tests: getsockname() can return None on OS X on unbound sockets (#1400)

7 years agobpo-30232: Regenerate configure (#1396)
Victor Stinner [Tue, 2 May 2017 20:35:58 +0000 (22:35 +0200)]
bpo-30232: Regenerate configure (#1396)

Run autoconf.

7 years agobpo-30232: Support Git worktree in configure.ac (#1391)
Victor Stinner [Tue, 2 May 2017 19:42:48 +0000 (21:42 +0200)]
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.

7 years agoRemove outdated tests in test_isinstance (GH-1393)
Jim Fasarakis-Hilliard [Tue, 2 May 2017 17:17:18 +0000 (20:17 +0300)]
Remove outdated tests in test_isinstance (GH-1393)

There is no need to test for new-style classes versus classic classes in Python 3.

7 years agobpo-28556: Routine updates to typing (#1366)
Ivan Levkivskyi [Tue, 2 May 2017 17:14:07 +0000 (19:14 +0200)]
bpo-28556: Routine updates to typing (#1366)

- Add NoReturn type
- Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard)
- Minor bug-fixes

7 years agobpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)
Antoine Pitrou [Tue, 2 May 2017 15:20:00 +0000 (17:20 +0200)]
bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)

* bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux

* Add NEWS entry

7 years agoFix typo in selectors.rst (#1383)
Tong SHEN [Tue, 2 May 2017 13:27:57 +0000 (21:27 +0800)]
Fix typo in selectors.rst (#1383)

decriptor -> descriptor

7 years agobpo-30228: FileIO seek() and tell() set seekable (#1384)
Victor Stinner [Tue, 2 May 2017 13:10:39 +0000 (15:10 +0200)]
bpo-30228: FileIO seek() and tell() set seekable (#1384)

FileIO.seek() and FileIO.tell() method now set the internal seekable
attribute to avoid one syscall on open() (in buffered or text mode).

The seekable property is now also more reliable since its value is
set correctly on memory allocation failure.

7 years agobpo-30199: test_ssl closes all asyncore channels (#1381)
Victor Stinner [Tue, 2 May 2017 11:12:02 +0000 (13:12 +0200)]
bpo-30199: test_ssl closes all asyncore channels (#1381)

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>}

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

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().

Move also tearDown() just after setUp().

7 years agoClean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition ...
Nathaniel J. Smith [Tue, 2 May 2017 05:43:31 +0000 (22:43 -0700)]
Clean up some confusing text left by PROTOCOL_SSLv23 -> PROTOCOL_TLS transition (#1355)

7 years agobpo-30190: improved error msg for assertAlmostEqual(delta=...) (#1331)
Giampaolo Rodola [Mon, 1 May 2017 16:18:56 +0000 (18:18 +0200)]
bpo-30190: improved error msg for assertAlmostEqual(delta=...) (#1331)

* #30190 / unittest / assertAlmostEqual(delta=...) / error msg: show the difference between the 2 numbers in case of failure

* safe_repr() diff

* also show difference when passing 'places' argument

* refactoring

* update Misc/NEWS

7 years agorestore *data* parameter of binascii.b2a_base64 to positional-only (#1352)
Xiang Zhang [Mon, 1 May 2017 05:12:07 +0000 (13:12 +0800)]
restore *data* parameter of binascii.b2a_base64 to positional-only (#1352)

7 years agobpo-29679: Implement @contextlib.asynccontextmanager (#360)
Jelle Zijlstra [Mon, 1 May 2017 01:25:58 +0000 (18:25 -0700)]
bpo-29679: Implement @contextlib.asynccontextmanager (#360)

7 years agobpo-30208: DOC: fix small typos in IDLE (#1354)
csabella [Sat, 29 Apr 2017 22:28:36 +0000 (18:28 -0400)]
bpo-30208: DOC: fix small typos in IDLE (#1354)

7 years agobpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (...
Serhiy Storchaka [Sat, 29 Apr 2017 04:06:49 +0000 (07:06 +0300)]
bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. (#1285)

7 years agoCheck that Python is 64-bit before enabling BLAKE2_USE_SSE. (#1332)
Neil Schemenauer [Fri, 28 Apr 2017 16:56:48 +0000 (09:56 -0700)]
Check that Python is 64-bit before enabling BLAKE2_USE_SSE. (#1332)

7 years agobpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)
Serhiy Storchaka [Fri, 28 Apr 2017 16:17:26 +0000 (19:17 +0300)]
bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. (#1341)

* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.

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.

* Update docstrings.

7 years agoImprove the grammar in windows.rst (GH-1330)
Wieland Hoffmann [Fri, 28 Apr 2017 16:12:57 +0000 (18:12 +0200)]
Improve the grammar in windows.rst (GH-1330)

7 years agobpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340)
Victor Stinner [Fri, 28 Apr 2017 13:07:10 +0000 (15:07 +0200)]
bpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340)

On clang, only compile dtoa.c with -fno-strict-aliasing, use strict
aliasing to compile all other C files.

7 years agobpo-30174: Remove duplicate definition from pickletools (#1301)
Jelle Zijlstra [Thu, 27 Apr 2017 16:05:26 +0000 (09:05 -0700)]
bpo-30174: Remove duplicate definition from pickletools (#1301)

There were two almost identical definitions of bytes1.

7 years agobpo-30175: Skip client cert tests of test_imaplib (#1320)
Victor Stinner [Thu, 27 Apr 2017 15:30:13 +0000 (17:30 +0200)]
bpo-30175: Skip client cert tests of test_imaplib (#1320)

* 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.

7 years agobpo-27200: Fix several doctests (GH-604)
Marco Buttu [Thu, 27 Apr 2017 12:23:34 +0000 (14:23 +0200)]
bpo-27200: Fix several doctests (GH-604)

7 years agoUse the correct name for ISO in Unicode HOWTO. (#1312)
Jesse Gonzalez [Thu, 27 Apr 2017 05:12:17 +0000 (00:12 -0500)]
Use the correct name for ISO in Unicode HOWTO. (#1312)

7 years agobpo-28415: Note 0 conversion different between Python and C (#885)
Louie Lu [Thu, 27 Apr 2017 03:36:35 +0000 (11:36 +0800)]
bpo-28415: Note 0 conversion different between Python and C (#885)

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

7 years agobpo-30101: Add support for curses.A_ITALIC. (#1015)
Eijebong [Wed, 26 Apr 2017 15:17:12 +0000 (17:17 +0200)]
bpo-30101: Add support for curses.A_ITALIC. (#1015)

7 years agobpo-30131: test_logging now joins queue threads (#1298)
Victor Stinner [Wed, 26 Apr 2017 13:56:25 +0000 (15:56 +0200)]
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).

7 years agotimemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294)
Victor Stinner [Wed, 26 Apr 2017 11:51:48 +0000 (13:51 +0200)]
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

7 years agobpo-29974: Improve typing.TYPE_CHECKING example (GH-982)
Mathias Rav [Wed, 26 Apr 2017 10:49:45 +0000 (06:49 -0400)]
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.

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

7 years agobpo-30052: Link `bytes` & `bytearray` to stdtypes not functions (GH-1271)
csabella [Wed, 26 Apr 2017 05:47:01 +0000 (01:47 -0400)]
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.

7 years agobpo-30107: Make SuppressCrashReport quiet on macOS (#1279)
Victor Stinner [Tue, 25 Apr 2017 22:55:08 +0000 (00:55 +0200)]
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

7 years agobpo:29950: Rename SlotWrapperType to WrapperDescriptorType (GH-926)
Jim Fasarakis-Hilliard [Tue, 25 Apr 2017 18:26:36 +0000 (21:26 +0300)]
bpo:29950: Rename SlotWrapperType to WrapperDescriptorType (GH-926)

7 years agobpo-28851: Improve namedtuple documentation (GH-1274)
csabella [Tue, 25 Apr 2017 16:14:45 +0000 (12:14 -0400)]
bpo-28851: Improve namedtuple documentation (GH-1274)

Clarify that a sequence of strings is the preferred value for 'field_names'.

7 years agobpo-29617: Remove Python 3.3 support from asyncio (GH-232)
INADA Naoki [Tue, 25 Apr 2017 01:57:18 +0000 (10:57 +0900)]
bpo-29617: Remove Python 3.3 support from asyncio (GH-232)

7 years agobpo-30132: distutils test_build_ext() uses temp_cwd() (#1278)
Victor Stinner [Tue, 25 Apr 2017 00:11:09 +0000 (02:11 +0200)]
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.

7 years agotmtotuple(): use time_t for gmtoff (#1276)
Victor Stinner [Mon, 24 Apr 2017 23:22:42 +0000 (01:22 +0200)]
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

7 years agobpo-30131: Cleanup threads in test_logging (#1275)
Victor Stinner [Mon, 24 Apr 2017 22:41:36 +0000 (00:41 +0200)]
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

7 years agobpo-29822: Make inspect.isabstract() work during __init_subclass__. (#678)
Nate [Mon, 24 Apr 2017 17:06:15 +0000 (10:06 -0700)]
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.

7 years agobpo-30144: Import collections ABC from collections.abc rather than collections. ...
Serhiy Storchaka [Mon, 24 Apr 2017 06:05:00 +0000 (09:05 +0300)]
bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263)

7 years agobpo-29751: add Cheryl Sabella to Misc/ACKS (GH-1268)
Mariatta [Mon, 24 Apr 2017 04:05:19 +0000 (21:05 -0700)]
bpo-29751: add Cheryl Sabella to Misc/ACKS (GH-1268)

7 years agobpo-29751: Improve PyLong_FromString documentation (GH-915)
csabella [Mon, 24 Apr 2017 03:54:08 +0000 (23:54 -0400)]
bpo-29751: Improve PyLong_FromString documentation (GH-915)

7 years agobpo-15718: Document the upper bound constrain on the __len__ return value. (#1256)
Serhiy Storchaka [Sun, 23 Apr 2017 05:37:58 +0000 (08:37 +0300)]
bpo-15718: Document the upper bound constrain on the __len__ return value. (#1256)

7 years agoRemove outdated note about constraining of the bit shift right operand. (#1258)
Serhiy Storchaka [Sat, 22 Apr 2017 18:50:09 +0000 (21:50 +0300)]
Remove outdated note about constraining of the bit shift right operand. (#1258)

The constrain was removed in bpo-29816.

7 years agoFix trailing colon and newline in test.rst (#1250)
Louie Lu [Sat, 22 Apr 2017 06:46:18 +0000 (14:46 +0800)]
Fix trailing colon and newline in test.rst (#1250)

7 years agoRemove unneeded Misc/NEWS entry for bpo-29802. (#1251)
Serhiy Storchaka [Sat, 22 Apr 2017 06:24:59 +0000 (09:24 +0300)]
Remove unneeded Misc/NEWS entry for bpo-29802. (#1251)

The bug was added in still not released version.

7 years agobpo-29960 _random.Random corrupted on exception in setstate(). (#1019)
bladebryan [Sat, 22 Apr 2017 06:10:46 +0000 (23:10 -0700)]
bpo-29960 _random.Random corrupted on exception in setstate(). (#1019)

7 years agobpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. ...
Serhiy Storchaka [Fri, 21 Apr 2017 23:48:11 +0000 (02:48 +0300)]
bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751)

7 years agobpo-30125: disable faulthandler in ctypes test_SEH (#1237)
Victor Stinner [Fri, 21 Apr 2017 22:31:13 +0000 (00:31 +0200)]
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.

7 years agobpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future (GH-1170)
Charles Renwick [Fri, 21 Apr 2017 20:49:48 +0000 (16:49 -0400)]
bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future   (GH-1170)

7 years agoCorrect the README link in Unix install docs (#1245)
Sebastian Vetter [Fri, 21 Apr 2017 17:24:57 +0000 (10:24 -0700)]
Correct the README link in Unix install docs (#1245)

7 years agobpo-30125: Fix faulthandler.disable() on Windows (#1240)
Victor Stinner [Fri, 21 Apr 2017 16:06:13 +0000 (18:06 +0200)]
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().

7 years agobpo-30107: don't dump core on expected test_io crash (#1235)
Victor Stinner [Fri, 21 Apr 2017 15:59:23 +0000 (17:59 +0200)]
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']

7 years agobpo-30106: Fix test_asyncore.test_quick_connect() (#1234)
Victor Stinner [Fri, 21 Apr 2017 11:51:53 +0000 (13:51 +0200)]
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-30104: configure now detects when cc is clang (#1233)
Victor Stinner [Fri, 21 Apr 2017 10:35:24 +0000 (12:35 +0200)]
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.

7 years agobpo-30104: Use -fno-strict-aliasing on clang (#1221)
Victor Stinner [Fri, 21 Apr 2017 09:24:34 +0000 (11:24 +0200)]
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

7 years agoremove configure test for inline keyword (#1231)
Benjamin Peterson [Fri, 21 Apr 2017 06:52:19 +0000 (23:52 -0700)]
remove configure test for inline keyword (#1231)

We require C99, so a configure test for this standard feature is not needed.

7 years agobpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries (#1222)
Segev Finer [Thu, 20 Apr 2017 23:33:28 +0000 (02:33 +0300)]
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.

7 years agoAdd missing .gitignore entries for VS2015 IntelliSense DB (#1223)
Segev Finer [Thu, 20 Apr 2017 23:32:26 +0000 (02:32 +0300)]
Add missing .gitignore entries for VS2015 IntelliSense DB (#1223)

7 years agobpo-29802: Fix reference counting in module-level struct functions (#1213)
Serhiy Storchaka [Thu, 20 Apr 2017 18:19:31 +0000 (21:19 +0300)]
bpo-29802: Fix reference counting in module-level struct functions (#1213)

when pass arguments of wrong type.

7 years agoOnly define get_zone() and get_gmtoff() if needed (#1193)
Victor Stinner [Thu, 20 Apr 2017 11:41:09 +0000 (13:41 +0200)]
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]

7 years agosupport.threading_cleanup() log a warning on fail (#1195)
Victor Stinner [Thu, 20 Apr 2017 11:40:08 +0000 (13:40 +0200)]
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

7 years agobpo-30108: Restore sys.path in test_site (#1197)
Victor Stinner [Thu, 20 Apr 2017 11:39:39 +0000 (13:39 +0200)]
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.

7 years agobpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168)
Dong-hee Na [Thu, 20 Apr 2017 07:31:17 +0000 (16:31 +0900)]
bpo-12414: Update code_sizeof() to take in account co_extra memory. (#1168)

7 years agobpo-30109: Fix reindent.py (GH-1207)
Mariatta [Thu, 20 Apr 2017 05:59:20 +0000 (22:59 -0700)]
bpo-30109: Fix reindent.py (GH-1207)

Skip the file if it has bad encoding.

7 years agobpo-10379: Add %char examples to locale.format() docs (GH-1145)
Berker Peksag [Thu, 20 Apr 2017 04:38:43 +0000 (07:38 +0300)]
bpo-10379: Add %char examples to locale.format() docs (GH-1145)

7 years agoRemove redundant comma in argparse HOWTO (#1141)
Berker Peksag [Thu, 20 Apr 2017 04:29:35 +0000 (07:29 +0300)]
Remove redundant comma in argparse HOWTO (#1141)

Reported by Sean Canavan on docs@p.o.

7 years agobpo-30078: Add an example of passing a path to unittest (#1178)
Louie Lu [Thu, 20 Apr 2017 03:46:59 +0000 (11:46 +0800)]
bpo-30078: Add an example of passing a path to unittest (#1178)

7 years agobpo-30106: Fix tearDown() of test_asyncore (#1194)
Victor Stinner [Thu, 20 Apr 2017 00:55:39 +0000 (02:55 +0200)]
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().

7 years agobpo-29887: test_normalization handles PermissionError (#1196)
Victor Stinner [Thu, 20 Apr 2017 00:39:59 +0000 (02:39 +0200)]
bpo-29887: test_normalization handles PermissionError (#1196)

Skip test_normalization.test_main() if download raises a permission
error.

7 years agoregrtest: always show before/after of modified env (#1192)
Victor Stinner [Wed, 19 Apr 2017 22:57:30 +0000 (00:57 +0200)]
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.

7 years agoFix/optimize test_asyncore.test_quick_connect() (#1188)
Victor Stinner [Wed, 19 Apr 2017 21:42:46 +0000 (23:42 +0200)]
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

7 years agobpo-30030: Revert f50354ad (tempfile) (#1187)
Victor Stinner [Wed, 19 Apr 2017 20:59:51 +0000 (22:59 +0200)]
bpo-30030: Revert f50354ad (tempfile) (#1187)

Revert f50354adaaafebe95ad09d09b825804a686ea843: it introduced a
regression in test_threadedtempfile.

7 years agobpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110)
Serhiy Storchaka [Wed, 19 Apr 2017 18:12:46 +0000 (21:12 +0300)]
bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110)

7 years agobpo-30070: Fixed leaks and crashes in errors handling in the parser module. (#1131)
Serhiy Storchaka [Wed, 19 Apr 2017 18:09:21 +0000 (21:09 +0300)]
bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (#1131)

7 years agobpo-22352: Adjust widths in the output of dis.dis() for large line numbers and (...
Serhiy Storchaka [Wed, 19 Apr 2017 17:36:31 +0000 (20:36 +0300)]
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.

7 years agobpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)
Serhiy Storchaka [Wed, 19 Apr 2017 17:03:52 +0000 (20:03 +0300)]
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.

7 years agobpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971)
Victor Stinner [Wed, 19 Apr 2017 11:01:03 +0000 (13:01 +0200)]
bpo-29925: Skip test_uuid1_safe() on OS X Tiger (#971)

7 years agoMinor grammar fixes (GH-1174)
Mariatta [Wed, 19 Apr 2017 01:59:47 +0000 (18:59 -0700)]
Minor grammar fixes (GH-1174)

7 years agoFix minor typos (GH-1173)
cocoatomo [Wed, 19 Apr 2017 00:38:26 +0000 (09:38 +0900)]
Fix minor typos (GH-1173)

7 years agobpo-29514: Check magic number for bugfix release (#54)
Eric Appelt [Mon, 17 Apr 2017 18:35:43 +0000 (13:35 -0500)]
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

7 years agofix a refleak in slot_sq_length (#1162)
Xiang Zhang [Sun, 16 Apr 2017 16:54:21 +0000 (00:54 +0800)]
fix a refleak in slot_sq_length (#1162)

7 years agobpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)
Serhiy Storchaka [Sun, 16 Apr 2017 07:46:38 +0000 (10:46 +0300)]
bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)

7 years agobpo-10076: Compiled regular expression and match objects now are copyable. (#1000)
Serhiy Storchaka [Sun, 16 Apr 2017 07:16:03 +0000 (10:16 +0300)]
bpo-10076: Compiled regular expression and match objects now are copyable. (#1000)

7 years agobpo-28765: Use concrete types API in _sre.c. (#1009)
Serhiy Storchaka [Sun, 16 Apr 2017 06:39:30 +0000 (09:39 +0300)]
bpo-28765: Use concrete types API in _sre.c. (#1009)