]> granicus.if.org Git - python/log
python
6 years agobpo-35384: The repr of ctypes.CArgObject no longer fails for non-ascii character...
Serhiy Storchaka [Thu, 6 Dec 2018 09:16:24 +0000 (11:16 +0200)]
bpo-35384: The repr of ctypes.CArgObject no longer fails for non-ascii character. (GH-10863)

6 years agoRevert "bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450...
Victor Stinner [Thu, 6 Dec 2018 07:51:47 +0000 (08:51 +0100)]
Revert "bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450)" (GH-10971)

This reverts commit 97bfe8d3ebb0a54c8798f57555cb4152f9b2e1d0.

6 years agobpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278)
native-api [Thu, 6 Dec 2018 07:04:35 +0000 (10:04 +0300)]
bpo-33709: test_ntpath and test_posixpath fail in Windows with ACP!=1252. (GH-7278)

6 years agobpo-34162: Update idlelib NEWS to 2018-12-05. (GH-10964)
Terry Jan Reedy [Thu, 6 Dec 2018 05:46:22 +0000 (00:46 -0500)]
bpo-34162: Update idlelib NEWS to 2018-12-05. (GH-10964)

6 years agobpo-35363: test_eintr runs eintr_tester.py in verbose mode (GH-10965)
Victor Stinner [Wed, 5 Dec 2018 23:18:30 +0000 (00:18 +0100)]
bpo-35363: test_eintr runs eintr_tester.py in verbose mode (GH-10965)

Moreover, "python3 -m test test_eintr -v" now avoids redirecting
stdout/stderr to a pipe, the child process inherits stdout/stderr
from the parent.

6 years agobpo-35389: test.pythoninfo logs platform.libc_ver (GH-10951)
Victor Stinner [Wed, 5 Dec 2018 22:21:54 +0000 (23:21 +0100)]
bpo-35389: test.pythoninfo logs platform.libc_ver (GH-10951)

6 years agoFix typo in xml.dom.minidom documentation (GH-10956)
E Kawashima [Wed, 5 Dec 2018 22:15:42 +0000 (07:15 +0900)]
Fix typo in xml.dom.minidom documentation (GH-10956)

Escape the \t and \n.
Follow up from https://github.com/python/cpython/pull/10814.

6 years agobpo-35344: platform.platform() uses mac_ver() on macOS (GH-10780)
Victor Stinner [Wed, 5 Dec 2018 21:41:52 +0000 (22:41 +0100)]
bpo-35344: platform.platform() uses mac_ver() on macOS (GH-10780)

On macOS, platform.platform() now uses mac_ver(), if it returns a
non-empty release string, to get the macOS version rather than darwin
version.

6 years agoFix typos in concurrent.Futures documentation (GH-10920)
Matt Wheeler [Wed, 5 Dec 2018 21:41:20 +0000 (21:41 +0000)]
Fix typos in concurrent.Futures documentation (GH-10920)

Add a missing word `as` in `as well as an`.
Linkify `threading.Thread`.

6 years agobpo-35310: Clear select() lists before returning upon EINTR (GH-10877)
Oran Avraham [Wed, 5 Dec 2018 20:36:03 +0000 (22:36 +0200)]
bpo-35310: Clear select() lists before returning upon EINTR (GH-10877)

select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.

6 years agobpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)
Serhiy Storchaka [Wed, 5 Dec 2018 19:46:25 +0000 (21:46 +0200)]
bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419)

6 years agoCorrect a couple of unbalanced parenthesis. (GH-10779)
Andre Delfino [Wed, 5 Dec 2018 19:45:30 +0000 (16:45 -0300)]
Correct a couple of unbalanced parenthesis. (GH-10779)

6 years agoMove __missing__ after __delitem__ in Data model. (GH-10923)
Andre Delfino [Wed, 5 Dec 2018 19:42:44 +0000 (16:42 -0300)]
Move __missing__ after __delitem__ in Data model. (GH-10923)

6 years agobpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)
Alex H [Wed, 5 Dec 2018 19:32:16 +0000 (20:32 +0100)]
bpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)

When running test_bdb.py as a script, `import test_module` would be
importing the existing Lib/test/test_modules.py instead of the
tempcwd/test_module.py module which was dynamically created by
test_bdb.py itself.

6 years agobpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165)
William Grzybowski [Wed, 5 Dec 2018 19:10:18 +0000 (17:10 -0200)]
bpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165)

6 years agobpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce()....
Zackery Spytz [Wed, 5 Dec 2018 18:29:20 +0000 (11:29 -0700)]
bpo-34987: Fix a possible null pointer dereference in _pickle.c's save_reduce(). (GH-9886)

6 years agobpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113)
Sergey Fedoseev [Wed, 5 Dec 2018 17:50:26 +0000 (22:50 +0500)]
bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113)

6 years agobpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919)
Victor Stinner [Wed, 5 Dec 2018 15:49:35 +0000 (16:49 +0100)]
bpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919)

* posixpath.expanduser() now returns the input path unchanged if
  the HOME environment variable is not set and pwd.getpwuid() raises
  KeyError (the current user identifier doesn't exist in the password
  database).
* Add test_no_home_directory() to test_site.

6 years agobpo-32787: Better error handling in ctypes. (#3727)
Serhiy Storchaka [Wed, 5 Dec 2018 14:44:14 +0000 (16:44 +0200)]
bpo-32787: Better error handling in ctypes. (#3727)

* bpo-31572: Get rid of PyObject_HasAttrString() in ctypes.

* Fix error handling for _pack_.

* Don't silence errors when look up in a dict.

* Use _PyObject_LookupAttrId().

* More changes.

6 years agobpo-35389: platform.libc_ver() uses os.confstr() (GH-10891)
Victor Stinner [Wed, 5 Dec 2018 13:04:52 +0000 (14:04 +0100)]
bpo-35389: platform.libc_ver() uses os.confstr() (GH-10891)

platform.libc_ver() now uses os.confstr('CS_GNU_LIBC_VERSION') if
available and the *executable* parameter is not set. The default
value of the libc_ver() *executable* parameter becomes None.

Quick benchmark on Fedora 29:

python3 -m perf command ./python -S -c 'import platform; platform.libc_ver()'
94.9 ms +- 4.3 ms -> 33.2 ms +- 1.4 ms: 2.86x faster (-65%)

6 years agobpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)
Zackery Spytz [Wed, 5 Dec 2018 07:14:00 +0000 (00:14 -0700)]
bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)

6 years agobpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)
Victor Stinner [Wed, 5 Dec 2018 00:58:31 +0000 (01:58 +0100)]
bpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)

On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".

test.pythoninfo now also logs TRAVIS environment variable.

6 years agoRemove unnecessary and over-restrictive type check (GH-10905)
Raymond Hettinger [Tue, 4 Dec 2018 22:53:14 +0000 (14:53 -0800)]
Remove unnecessary and over-restrictive type check (GH-10905)

6 years agobpo-35346, platform: import subprocess in _syscmd_file() (GH-10892)
Victor Stinner [Tue, 4 Dec 2018 16:18:12 +0000 (17:18 +0100)]
bpo-35346, platform: import subprocess in _syscmd_file() (GH-10892)

Only platform._syscmd_file() uses subprocess. Move subprocess import
inside this function to reduce the number of imports at Python
startup.

Remove also warnings import which is no longer needed.

6 years agobpo-35363, test_eintr: skip test_open() on macOS (GH-10896)
Victor Stinner [Tue, 4 Dec 2018 16:13:33 +0000 (17:13 +0100)]
bpo-35363, test_eintr: skip test_open() on macOS (GH-10896)

6 years agobpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)
stratakis [Tue, 4 Dec 2018 14:54:01 +0000 (15:54 +0100)]
bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)

When using link time optimizations, the -flto flag is passed to
BASECFLAGS, which makes it propagate to distutils. Those flags
should be reserved for the interpreter and the stdlib extension
modules only, thus moving those flags to CFLAGS_NODIST.

6 years agobpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy...
Andrew Dunai [Tue, 4 Dec 2018 09:08:45 +0000 (11:08 +0200)]
bpo-35357: Add _mock_ prefix to name/parent/from_kall attributes of _Call/_MagicProxy. (#10873)

Fix minor typo in test function name.

6 years agobpo-35365: Use a wchar_t* buffer in the code page decoder. (GH-10837)
Serhiy Storchaka [Tue, 4 Dec 2018 08:25:50 +0000 (10:25 +0200)]
bpo-35365: Use a wchar_t* buffer in the code page decoder. (GH-10837)

6 years agoAdd comments regarding speed/space/entropy trade-offs (GH-10885)
Raymond Hettinger [Tue, 4 Dec 2018 08:13:38 +0000 (00:13 -0800)]
Add comments regarding speed/space/entropy trade-offs (GH-10885)

6 years agobpo-35395: fix typos in asyncio eventloop documentation (GH-10880)
Naglis [Tue, 4 Dec 2018 07:31:15 +0000 (09:31 +0200)]
bpo-35395: fix typos in asyncio eventloop documentation (GH-10880)

Fixes `loop.add_writer` and `loop.add_signal_handler` method documentation to correctly reference the callback parameter from method signature.

https://bugs.python.org/issue35395

6 years agobpo-35226: Fix equality for nested unittest.mock.call objects. (#10555)
Chris Withers [Mon, 3 Dec 2018 21:31:37 +0000 (21:31 +0000)]
bpo-35226: Fix equality for nested unittest.mock.call objects. (#10555)

Also refactor the call recording imolementation and add some notes
about its limitations.

6 years agobpo-35380: Enable TCP_NODELAY for proactor event loop (#10867)
Andrew Svetlov [Mon, 3 Dec 2018 19:08:13 +0000 (21:08 +0200)]
bpo-35380: Enable TCP_NODELAY for proactor event loop (#10867)

6 years agobpo-35373: Fix PyInit_time() error handling (GH-10865)
Victor Stinner [Mon, 3 Dec 2018 12:45:38 +0000 (13:45 +0100)]
bpo-35373: Fix PyInit_time() error handling (GH-10865)

* PyInit_time() now returns NULL if an exception is raised.
* Rename PyInit_timezone() to init_timezone(). "PyInit_" prefix is
  a special prefix for function initializing a module.
  init_timezone() doesn't initialize a module and the function is not
  exported.

6 years agobpo-35373: Fix PyInit_timezone() if HAVE_DECL_TZNAME is defined (GH-10861)
Victor Stinner [Mon, 3 Dec 2018 11:02:43 +0000 (12:02 +0100)]
bpo-35373: Fix PyInit_timezone() if HAVE_DECL_TZNAME is defined (GH-10861)

If HAVE_DECL_TZNAME, PyInit_timezone() now returns -1 on error.

6 years agobpo-35372: Fix the code page decoder for input > 2 GiB. (GH-10848)
Serhiy Storchaka [Mon, 3 Dec 2018 08:36:45 +0000 (10:36 +0200)]
bpo-35372: Fix the code page decoder for input > 2 GiB. (GH-10848)

6 years agobpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(...
Zackery Spytz [Mon, 3 Dec 2018 08:31:35 +0000 (01:31 -0700)]
bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' PyCArg_repr(). (GH-10853)

Use "ll" instead of the nonstandard "q".

6 years agobpo-32153: Add unit test for create_autospec with partial function returned in getatt...
Xtreak [Mon, 3 Dec 2018 07:58:15 +0000 (13:28 +0530)]
bpo-32153: Add unit test for create_autospec with partial function returned in getattr (#10398)

* Add create_autospec with partial function returned in getattr

* Use self.assertFalse instead of assert

* Use different names and remove object

6 years agobpo-35341: Add generic version of OrderedDict to typing (GH-10850)
Ismo Toijala [Sun, 2 Dec 2018 15:53:14 +0000 (17:53 +0200)]
bpo-35341: Add generic version of OrderedDict to typing (GH-10850)

6 years agobpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)
Serhiy Storchaka [Sat, 1 Dec 2018 12:30:20 +0000 (14:30 +0200)]
bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)

6 years agobpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)
Xtreak [Sat, 1 Dec 2018 10:03:54 +0000 (15:33 +0530)]
bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)

6 years agoFix compiler warning in structseq_repr() (GH-10841)
Victor Stinner [Sat, 1 Dec 2018 01:46:40 +0000 (02:46 +0100)]
Fix compiler warning in structseq_repr() (GH-10841)

Replace strncpy() with memcpy() in structseq_repr() to fix the
following compiler warning:

Objects/structseq.c:187:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
     strncpy(pbuf, typ->tp_name, len);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Objects/structseq.c:185:11: note: length computed here
     len = strlen(typ->tp_name) > TYPE_MAXSIZE ? TYPE_MAXSIZE :

The function writes the terminating NUL byte later.

6 years agoget_gmtoff() now returns time_t (GH-10838)
Victor Stinner [Fri, 30 Nov 2018 23:39:36 +0000 (00:39 +0100)]
get_gmtoff() now returns time_t (GH-10838)

get_gmtoff() now returns time_t instead of int to fix the following
Visual Studio warning:

    Modules\timemodule.c(1183): warning C4244: 'return':
    conversion from 'time_t' to 'int', possible loss of data

6 years agobpo-35352: Cleanup test_asyncio/utils.py (GH-10831)
Victor Stinner [Fri, 30 Nov 2018 17:30:09 +0000 (18:30 +0100)]
bpo-35352: Cleanup test_asyncio/utils.py (GH-10831)

'here' variable is no longer needed.

6 years agobpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)
stratakis [Fri, 30 Nov 2018 16:56:56 +0000 (17:56 +0100)]
bpo-35352: test_asyncio uses the certificate set from the test directory (GH-10826)

Modify asyncio tests to utilize the certificates from the test directory
instead of its own set, as they are the same and with each update they had
to be updated as well.

6 years agobpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)
Siddhesh Poyarekar [Fri, 30 Nov 2018 15:14:25 +0000 (20:44 +0530)]
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)

Fix an undefined behaviour in the pthread implementation of
PyThread_start_new_thread(): add a function wrapper to always return
NULL.

Add pythread_callback struct and pythread_wrapper() to thread_pthread.h.

6 years agoFix compiler warning in call_readline() (GH-10820)
Victor Stinner [Fri, 30 Nov 2018 14:03:53 +0000 (15:03 +0100)]
Fix compiler warning in call_readline() (GH-10820)

Replace strncpy() with memcpy() in call_readline() to fix the
following warning, the NUL byte is written manually just after:

Modules/readline.c: In function ‘call_readline’:
Modules/readline.c:1303:9: warning: ‘strncpy’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]
         strncpy(p, q, n);
         ^~~~~~~~~~~~~~~~
Modules/readline.c:1279:9: note: length computed here
     n = strlen(p);
         ^~~~~~~~~

6 years agoFix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814)
E Kawashima [Fri, 30 Nov 2018 14:03:00 +0000 (23:03 +0900)]
Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814)

6 years agobpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818)
Victor Stinner [Fri, 30 Nov 2018 12:22:44 +0000 (13:22 +0100)]
bpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818)

* Replace testInheritFlags() with two tests:
  testInheritFlagsBlocking() and testInheritFlagsTimeout()
  to test different default socket timeout. Moreover, the test now
  checks sock.gettimeout() rather than a functional test on recv().
* Replace time.time() with time.monotonic()
* Add socket_setdefaulttimeout() context manager to restore the
  default timeout when the test completes.
* Remove testConnect(): accept() wasn't blocking and testAccept()
  already tests non-blocking accept().
* Remove accept() functional test from testInitNonBlocking():
  already tested by testAccept()
* Rewrite testSetBlocking() with a new assert_sock_timeout() method
* Use addCleanup() and context manager to close sockets
* Replace assertTrue(x < y) with assertLess(x, y)

6 years agobpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
Victor Stinner [Fri, 30 Nov 2018 11:29:25 +0000 (12:29 +0100)]
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)

testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a
race condition: time.sleep() is used as a weak synchronization
primitive and the tests fail randomly on slow buildbots.

Use a reliable threading.Event to fix these tests.

Other changes:

* Replace send() with sendall()
* Expect specific BlockingIOError rather than generic OSError
* Add a timeout to select() in testAccept() and testRecv()
* Use addCleanup() to close sockets
* Use assertRaises()

6 years agobpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806)
Victor Stinner [Fri, 30 Nov 2018 10:34:47 +0000 (11:34 +0100)]
bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806)

Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C
locale if the LC_CTYPE locale is "C".

6 years agoFix typo in Memory Management doc. (GH-10798)
Kevin Adler [Fri, 30 Nov 2018 07:42:47 +0000 (01:42 -0600)]
Fix typo in Memory Management doc. (GH-10798)

6 years agobpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
Zackery Spytz [Fri, 30 Nov 2018 07:40:16 +0000 (00:40 -0700)]
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)

6 years agobpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150)
Pablo Galindo [Thu, 29 Nov 2018 17:17:44 +0000 (17:17 +0000)]
bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10150)

6 years agoUse assertEqual to fix DeprecationWarning. (GH-10794)
Xtreak [Thu, 29 Nov 2018 13:07:00 +0000 (18:37 +0530)]
Use assertEqual to fix DeprecationWarning. (GH-10794)

6 years agobpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415)
INADA Naoki [Thu, 29 Nov 2018 11:01:27 +0000 (20:01 +0900)]
bpo-30167: Remove __cached__ from __main__ when removing __file__ (GH-7415)

6 years agobpo-16086: Fix PyType_GetFlags() documentation (GH-10758)
Eddie Elizondo [Thu, 29 Nov 2018 09:11:36 +0000 (01:11 -0800)]
bpo-16086: Fix PyType_GetFlags() documentation (GH-10758)

PyType_GetFlags() return type is unsigned long, not long.

6 years agobpo-35345: Remove platform.popen() (GH-10781)
Victor Stinner [Thu, 29 Nov 2018 08:58:20 +0000 (09:58 +0100)]
bpo-35345: Remove platform.popen() (GH-10781)

Remove platform.popen() function, it was deprecated since Python 3.3:
use os.popen() instead.

Rename also the "Removed" section to "API and Feature Removals"
of What's New in Python 3.8.

6 years agobpo-28167: Remove platform._dist_try_harder() (GH-10787)
Victor Stinner [Thu, 29 Nov 2018 02:14:03 +0000 (03:14 +0100)]
bpo-28167: Remove platform._dist_try_harder() (GH-10787)

platform._dist_try_harder() was an helper function
for platform.linux_distribution() which has been removed by the
commit 8b94b41ab7b12f745dea744e8940631318816935.

6 years agobpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)
Victor Stinner [Thu, 29 Nov 2018 00:34:51 +0000 (01:34 +0100)]
bpo-35189, bpo-35316: Make test_eintr less strict (GH-10782)

test_eintr no longer fails if the signal handler has not been called.

6 years agobpo-33723: Remove busy loop from test_time (GH-10773)
Victor Stinner [Wed, 28 Nov 2018 17:30:10 +0000 (18:30 +0100)]
bpo-33723: Remove busy loop from test_time (GH-10773)

The "busy loops" of test_process_time() and test_thread_time() are
not reliable and fail randomly on Windows: remove them.

6 years agobpo-34100: compile: Re-enable frozenset merging (GH-10760)
INADA Naoki [Wed, 28 Nov 2018 15:58:46 +0000 (00:58 +0900)]
bpo-34100: compile: Re-enable frozenset merging (GH-10760)

This reverts commit 1005c84535191a72ebb7587d8c5636a065b7ed79.

6 years agobpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765)
Victor Stinner [Wed, 28 Nov 2018 14:19:51 +0000 (15:19 +0100)]
bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765)

PyStructSequence_GET_ITEM() must be used instead of
PyTuple_GET_ITEM() on a StructTimeType.

6 years agobpo-35134: Create Include/cpython/tupleobject.h (GH-10764)
Victor Stinner [Wed, 28 Nov 2018 12:01:32 +0000 (13:01 +0100)]
bpo-35134: Create Include/cpython/tupleobject.h (GH-10764)

Move tupleobject.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/tupleobject.h header file.

Add cpython/ header files to Makefile.pre.in and pythoncore project
of PCbuild.

6 years agobpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759)
Victor Stinner [Wed, 28 Nov 2018 09:26:20 +0000 (10:26 +0100)]
bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759)

Fix memory leak in PyUnicode_EncodeLocale() and
PyUnicode_EncodeFSDefault() on error handling.

Changes:

* Fix unicode_encode_locale() error handling
* Fix test_codecs.LocaleCodecTest

6 years agobpo-35240: Add "doctest" job to Travis CI (GH-10753)
Victor Stinner [Wed, 28 Nov 2018 09:24:08 +0000 (10:24 +0100)]
bpo-35240: Add "doctest" job to Travis CI (GH-10753)

Create a new "doctest" job in Travis CI to run "make doctest".

6 years agobpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)
Victor Stinner [Wed, 28 Nov 2018 00:14:31 +0000 (01:14 +0100)]
bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)

Fix WithThreadsTestPool.test_wrapped_exception()
of test_multiprocessing_fork: join the pool.

WithThreadsTestPool.test_del_pool() is now also decorated
with @support.reap_threads.

6 years agobpo-35134: Don't define types twice in header files (GH-10754)
Victor Stinner [Tue, 27 Nov 2018 22:54:59 +0000 (23:54 +0100)]
bpo-35134: Don't define types twice in header files (GH-10754)

Fix the following clang warning:

    Include/cpython/pystate.h:217:3: warning: redefinition of
    typedef 'PyThreadState' is a C11 feature [-Wtypedef-redefinition]

6 years agobpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751)
Serhiy Storchaka [Tue, 27 Nov 2018 19:34:27 +0000 (21:34 +0200)]
bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751)

Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts.

6 years agobpo-35312: Make lib2to3.pgen2.parse.ParseError round-trip pickle-able. (GH-10710)
Anthony Sottile [Tue, 27 Nov 2018 18:39:49 +0000 (10:39 -0800)]
bpo-35312: Make lib2to3.pgen2.parse.ParseError round-trip pickle-able. (GH-10710)

6 years agobpo-33029: Fix signatures of getter and setter functions. (GH-10746)
Serhiy Storchaka [Tue, 27 Nov 2018 17:34:35 +0000 (19:34 +0200)]
bpo-33029: Fix signatures of getter and setter functions. (GH-10746)

Fix also return type for few other functions (clear, releasebuffer).

6 years agobpo-34100: Partially revert merge_consts_recursive() (GH-10743)
Victor Stinner [Tue, 27 Nov 2018 14:12:47 +0000 (15:12 +0100)]
bpo-34100: Partially revert merge_consts_recursive() (GH-10743)

Partically revert commit c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 to
fix a reference leak.

6 years agobpo-35134: Update "make tags": add Include/cpython/ (GH-10739)
Victor Stinner [Tue, 27 Nov 2018 11:42:25 +0000 (12:42 +0100)]
bpo-35134: Update "make tags": add Include/cpython/ (GH-10739)

"make tags" and "make TAGS" now also parse Include/cpython/ header
files.

6 years agobpo-33954: Fix compiler warning in _PyUnicode_FastFill() (GH-10737)
Victor Stinner [Tue, 27 Nov 2018 11:41:17 +0000 (12:41 +0100)]
bpo-33954: Fix compiler warning in _PyUnicode_FastFill() (GH-10737)

'data' argument of unicode_fill() is modified, so it must not be
constant.

Add more assertions to unicode_fill(): check the maximum character
value.

6 years agobpo-35317: Fix mktime() error in test_email (GH-10721)
Victor Stinner [Tue, 27 Nov 2018 11:40:50 +0000 (12:40 +0100)]
bpo-35317: Fix mktime() error in test_email (GH-10721)

Fix mktime() overflow error in test_email: run
test_localtime_daylight_true_dst_true() and
test_localtime_daylight_false_dst_true() with a specific timezone.

6 years agobpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)
Serhiy Storchaka [Tue, 27 Nov 2018 11:27:31 +0000 (13:27 +0200)]
bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)

Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS excluding Argument Clinic generated code.

6 years agobpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736)
Serhiy Storchaka [Tue, 27 Nov 2018 11:05:02 +0000 (13:05 +0200)]
bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736)

6 years agobpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. (GH...
Serhiy Storchaka [Tue, 27 Nov 2018 09:27:36 +0000 (11:27 +0200)]
bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. (GH-6748)

Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS in Argument Clinic generated code.

6 years agobpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633)
Serhiy Storchaka [Tue, 27 Nov 2018 07:40:29 +0000 (09:40 +0200)]
bpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633)

The lineno and col_offset attributes of AST nodes for list comprehensions,
generator expressions and tuples are now point to the opening parenthesis or
square brace. For tuples without parenthesis they point to the position
of the first item.

6 years agoInclude the highest pickle protocol in a couple of tests. (GH-10735)
Zackery Spytz [Tue, 27 Nov 2018 05:40:49 +0000 (22:40 -0700)]
Include the highest pickle protocol in a couple of tests. (GH-10735)

test_reduce_ex() in test_array.py and
test_reversevaluesiterator_pickling() in test_dict.py weren't using
the highest pickle protocol.

6 years agocloses bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)
E. M. Bray [Tue, 27 Nov 2018 02:21:31 +0000 (03:21 +0100)]
closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)

6 years agobpo-35134: Create Include/cpython/pystate.h (GH-10733)
Victor Stinner [Mon, 26 Nov 2018 23:20:00 +0000 (00:20 +0100)]
bpo-35134: Create Include/cpython/pystate.h (GH-10733)

Move pystate.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/pystate.h header file.

6 years agobpo-35134: Create Include/cpython/dictobject.h (GH-10732)
Victor Stinner [Mon, 26 Nov 2018 23:12:26 +0000 (00:12 +0100)]
bpo-35134: Create Include/cpython/dictobject.h (GH-10732)

* Move dictobject.h code surrounded by "#ifndef Py_LIMITED_API"
  to a new Include/cpython/dictobject.h header file.
* Add PyAPI_FUNC() to _PyDictView_New().
* Reorganize dictobject.h: move views and iterators at the end.

6 years agobpo-35134: Create Include/cpython/pylifecycle.h (GH-10731)
Victor Stinner [Mon, 26 Nov 2018 23:12:05 +0000 (00:12 +0100)]
bpo-35134: Create Include/cpython/pylifecycle.h (GH-10731)

Move pylifecycle.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/pylifecycle.h header file.

6 years agobpo-35134: Create Include/cpython/abstract.h (GH-10728)
Victor Stinner [Mon, 26 Nov 2018 21:42:04 +0000 (22:42 +0100)]
bpo-35134: Create Include/cpython/abstract.h (GH-10728)

Move abstract.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/abstract.h header file.

6 years agobpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693)
Zhiming Wang [Mon, 26 Nov 2018 21:29:45 +0000 (16:29 -0500)]
bpo-35308: Fix regression where BROWSER env var is not respected. (GH-10693)

Regression introduced in e3ce695 and 25b804a, where the old parameter
update_tryorder to _synthesize was first ignored, then given the opposite
value in the attempt to fix bpo-31014.

6 years agobpo-35134: Add Include/cpython/pyerrors.h (GH-10727)
Victor Stinner [Mon, 26 Nov 2018 21:11:25 +0000 (22:11 +0100)]
bpo-35134: Add Include/cpython/pyerrors.h (GH-10727)

Move pyerrors.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/pyerrors.h header file.

6 years agobpo-33723: Fix test_time.test_thread_time() (GH-10724)
Victor Stinner [Mon, 26 Nov 2018 20:19:29 +0000 (21:19 +0100)]
bpo-33723: Fix test_time.test_thread_time() (GH-10724)

Tolerate up to 30 ms, instead of 15 min, in other threads.

6 years agoAdds IPv6 support when invoking http.server directly. (GH-10595)
Lisa Roach [Mon, 26 Nov 2018 18:43:38 +0000 (10:43 -0800)]
Adds IPv6 support when invoking http.server directly. (GH-10595)

6 years agobpo-35134: Create Include/cpython/unicodeobject.h (GH-10680)
Victor Stinner [Mon, 26 Nov 2018 16:29:38 +0000 (17:29 +0100)]
bpo-35134: Create Include/cpython/unicodeobject.h (GH-10680)

Move unicodeobject.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/unicodeobject.h header file.

6 years agoDoc: Delete now useless Windows FAQ section (GH-10557)
Mathieu Dupuy [Mon, 26 Nov 2018 16:13:41 +0000 (17:13 +0100)]
Doc: Delete now useless Windows FAQ section (GH-10557)

6 years agobpo-35134: Create Include/cpython/object.h (GH-10679)
Victor Stinner [Mon, 26 Nov 2018 16:09:16 +0000 (17:09 +0100)]
bpo-35134: Create Include/cpython/object.h (GH-10679)

* Move object.h code surrounded by "#ifndef Py_LIMITED_API"
  to a new Include/cpython/object.h header file.
* "typedef struct _typeobject PyTypeObject;" is now always defined
  in object.h, but if Py_LIMITED_API is not defined,
  Include/cpython/object.h also defines the structure.
* Complete the printfunc comment to mention Py_LIMITED_API define.

6 years agopythoninfo: log more environment variable (GH-10719)
Victor Stinner [Mon, 26 Nov 2018 16:03:16 +0000 (17:03 +0100)]
pythoninfo: log more environment variable (GH-10719)

Log TZ to debug a timezone issue... and a few more :-)

6 years agobpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623)
Victor Stinner [Mon, 26 Nov 2018 12:40:01 +0000 (13:40 +0100)]
bpo-33954: Fix _PyUnicode_InsertThousandsGrouping() (GH-10623)

Fix str.format(), float.__format__() and complex.__format__() methods
for non-ASCII decimal point when using the "n" formatter.

Changes:

* Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires
  a _PyUnicodeWriter object for the buffer and a Python str object
  for digits.
* Rename FILL() macro to unicode_fill(), convert it to static inline function,
  add "assert(0 <= start);" and rework its code.

6 years agoAdd assertion to _PyTuple_CAST(op) (GH-10712)
Victor Stinner [Mon, 26 Nov 2018 12:37:13 +0000 (13:37 +0100)]
Add assertion to _PyTuple_CAST(op) (GH-10712)

Add "assert(PyTuple_Check(op));" to _PyTuple_CAST() to check that the
argument is a tuple object in debug mode.

PyTuple_GET_SIZE() now uses _PyTuple_CAST() to get its assertion.

6 years agobpo-34100: Merge constants recursively (GH-8341)
INADA Naoki [Mon, 26 Nov 2018 12:23:22 +0000 (21:23 +0900)]
bpo-34100: Merge constants recursively (GH-8341)

There are some same consts in a module.  This commit merges them into
single instance.  It reduces number of objects in memory after loading modules.

https://bugs.python.org/issue34100

6 years agobpo-35313: Cleanup test_embed.py (GH-10716)
Victor Stinner [Mon, 26 Nov 2018 11:37:34 +0000 (12:37 +0100)]
bpo-35313: Cleanup test_embed.py (GH-10716)

* Remove an unused import.
* Move get_expected_config() call to check_config() to ease backport
  to Python 3.7.

6 years agobpo-35313: Fix test_embed when run from venv (GH-10713)
Victor Stinner [Mon, 26 Nov 2018 10:54:12 +0000 (11:54 +0100)]
bpo-35313: Fix test_embed when run from venv (GH-10713)

test_embed.InitConfigTests now gets the expected configuration from
a child process run with -S to not run the site module.

6 years agobpo-35300: Add usage note to the lru_cache() docs (GH-10707)
Raymond Hettinger [Mon, 26 Nov 2018 00:24:52 +0000 (16:24 -0800)]
bpo-35300: Add usage note to the lru_cache() docs (GH-10707)

https://bugs.python.org/issue35300

6 years agobpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)
Victor Stinner [Sun, 25 Nov 2018 22:56:17 +0000 (23:56 +0100)]
bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)

Move _PyTuple_ITEMS() to a new header file:
Include/internal/pycore_tupleobject.h

6 years agobpo-35081: Add _PyTuple_CAST() (GH-10704)
Victor Stinner [Sun, 25 Nov 2018 22:30:32 +0000 (23:30 +0100)]
bpo-35081: Add _PyTuple_CAST() (GH-10704)