Commit Graph

41521 Commits

Author SHA1 Message Date
Victor Stinner 109a9fe796 Merge 3.6 2017-02-10 12:38:02 +01:00
Victor Stinner 2a35c939cc Fix test_datetime on Windows
Issue #29100: On Windows, datetime.datetime.fromtimestamp(min_ts) fails with an
OSError in test_timestamp_limits().
2017-02-10 12:37:21 +01:00
Victor Stinner 07547cdad3 Merge 3.6 2017-02-10 11:45:28 +01:00
Victor Stinner 6f37e3645d Fix test_datetime on system with 32-bit time_t
Issue #29100: Catch OverflowError in the new test_timestamp_limits() test.
2017-02-10 11:45:14 +01:00
Victor Stinner 05e218c37d Merge 3.6 2017-02-10 10:34:37 +01:00
Victor Stinner b67f096738 Fix datetime.fromtimestamp(): check bounds
Issue #29100: Fix datetime.fromtimestamp() regression introduced in Python
3.6.0: check minimum and maximum years.
2017-02-10 10:34:02 +01:00
Łukasz Langa 40ee824d1d Merge 3.6 (fix #29519) 2017-02-10 00:20:16 -08:00
Łukasz Langa 57fe245e8c Merge 3.5 (fix #29519) 2017-02-10 00:16:10 -08:00
Łukasz Langa 9cd7e17640 Fix #29519: weakref spewing exceptions during interp finalization 2017-02-10 00:14:55 -08:00
Victor Stinner 331bbe6aaa Issue #29507: Update test_exceptions
test_unraisable() of test_exceptions expects that PyErr_WriteUnraisable(method)
fails on repr(method).

Before the previous change (7b8df4a5d81d), slot_tp_finalize() called
PyErr_WriteUnraisable() with a PyMethodObject. In this case, repr(method) calls
repr(self) which is BrokenRepr.__repr__() and the calls raises a new exception.

After the previous change, slot_tp_finalize() uses an unbound method: repr() is
called on a regular __del__() method which doesn't call repr(self). repr()
doesn't fail anymore.

PyErr_WriteUnraisable() doesn't call __repr__() anymore, so remove BrokenRepr
unit test.
2017-02-09 23:49:50 +01:00
Victor Stinner 3722f1f483 support: temp_dir() and change_cwd() uses repr() in error message
Serhiy Storshaka pointed me that str(path) can emit a BytesWarning: use
repr(path) instead.
2017-02-08 15:49:10 +01:00
Victor Stinner 17a63e2169 Fix regrtest -j0 -R output
Write also dots into stderr, instead of stdout.
2017-02-08 13:06:08 +01:00
Victor Stinner 04054d9ac2 Update test_support for my temp_dir/change_cwd changes 2017-02-08 12:49:02 +01:00
Victor Stinner edb4881441 support: add more info on temp_dir() and change_cwd() failure
Log the OSError exception message.
2017-02-08 12:25:00 +01:00
Mariatta Wijaya 189413dcfe Issue #29314: Merge with 3.6 2017-02-06 22:06:04 -08:00
Mariatta Wijaya 6138432e59 Issue #29314: Merge with 3.5 2017-02-06 22:05:10 -08:00
Mariatta Wijaya 4e7ff8b1a3 Issue #29314: Set the stacklevel to two in asyncio.async() Deprecation Warning 2017-02-06 22:03:00 -08:00
Steve Dower 18d2c934e3 Issue #28164: Improves test on Windows 7 2017-02-06 14:53:21 -08:00
Steve Dower 2dfa6cb9ff Issue #28164: Improves test on Windows 7 2017-02-06 14:50:17 -08:00
Victor Stinner 5bad70def6 regrtest: don't fail immediately if a child does crash
Issue #29362: Catch a crash of a worker process as a normal failure and
continue to run next tests. It allows to get the usual test summary: single
line result (OK/FAIL), total duration, etc.
2017-02-06 12:42:00 +01:00
Xiang Zhang 6aee6fbce8 Issue #29405: Make total calculation in _guess_delimiter more accurate. 2017-02-06 10:50:09 +08:00
Steve Dower 64a2f9e882 Merge from 3.6 2017-02-04 16:46:53 -08:00
Steve Dower 0c8ee60e91 Updates test_winconsoleio to better show the source of its issues. 2017-02-04 16:46:34 -08:00
Steve Dower 824c6fdfaa Issue #29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev) 2017-02-04 15:19:46 -08:00
Steve Dower 5f9193a6ed Issue #29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev) 2017-02-04 15:19:29 -08:00
Steve Dower 43fec9b419 Merge issue #28164 and issue #29409 2017-02-04 15:14:18 -08:00
Steve Dower 722e3e2705 Issue #28164: Correctly handle special console filenames (patch by Eryk Sun) 2017-02-04 15:07:46 -08:00
Steve Dower 479d96c694 Issue #29416: Prevent infinite loop in pathlib.Path.mkdir 2017-02-04 14:56:57 -08:00
Steve Dower 1add96f1b6 Issue #29416: Prevent infinite loop in pathlib.Path.mkdir 2017-02-04 14:55:16 -08:00
Steve Dower d3c4853b78 Issue #29416: Prevent infinite loop in pathlib.Path.mkdir 2017-02-04 14:54:56 -08:00
Steve Dower eacee98679 Issue #29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun) 2017-02-04 14:38:11 -08:00
Serhiy Storchaka ef5176769d Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object.  Based on patch by WGH.
2017-02-04 22:57:44 +02:00
Serhiy Storchaka 86e42376c2 Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object.  Based on patch by WGH.
2017-02-04 22:55:40 +02:00
Serhiy Storchaka 7e10dbbd45 Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object.  Based on patch by WGH.
2017-02-04 22:53:57 +02:00
INADA Naoki 5566bbb8d5 Issue #29263: LOAD_METHOD support for C methods
Calling builtin method is at most 10% faster.
2017-02-03 07:43:03 +09:00
Vinay Sajip 144fff8b90 Closes #29213: Merged fix from 3.6. 2017-02-02 19:33:43 +00:00
Vinay Sajip 3746619b84 Fixes #29213: merged fix from 3.5. 2017-02-02 19:26:48 +00:00
Vinay Sajip db38b6c9a9 Fixes #29213: regularised EOLs of venv scripts. 2017-02-02 19:25:24 +00:00
Vinay Sajip 7601d780a7 Closes #24875: Merged fix from 3.6. 2017-02-02 19:17:51 +00:00
Vinay Sajip 993f535ae9 Fixes #24875: Merged fix from 3.5. 2017-02-02 19:17:02 +00:00
Vinay Sajip db6322cb8a Fixes #24875: pip can now be installed in a venv with --system-site-packages. 2017-02-02 19:05:19 +00:00
Victor Stinner c0f59ad145 Rename struct.unpack() 2nd parameter to "buffer"
Issue #29300: Rename struct.unpack() second parameter from "inputstr" to
"buffer", and use the Py_buffer type.

Fix also unit tests on struct.unpack() which passed a Unicode string instead of
a bytes string as struct.unpack() second parameter. The purpose of
test_trailing_counter() is to test invalid format strings, not to test the
buffer parameter.
2017-02-02 14:24:16 +01:00
Victor Stinner 64e91275e3 Merge 3.5 2017-02-02 14:18:43 +01:00
Victor Stinner a5917d1d15 Issue #29300: test_struct tests unpack_from() with keywords
Add an unit test on the _struct.Struct.unpack_from() method to test passing
arguments as keywords.
2017-02-02 14:18:18 +01:00
Victor Stinner 3f2d10132d Issue #29300: Convert _struct module to Argument Clinic
* The struct module now requires contiguous buffers.
* Convert most functions and methods of the _struct module to Argument Clinic
* Use "Py_buffer" type for the "buffer" argument. Argument Clinic is
  responsible to create and release the Py_buffer object.
* Use "PyStructObject *" type for self to avoid explicit conversions.
* Add an unit test on the _struct.Struct.unpack_from() method to test passing
  arguments as keywords.
* Rephrase docstrings.
* Rename "fmt" argument to "format" in docstrings and the documentation.

As a side effect, functions and methods which used METH_VARARGS calling
convention like struct.pack() now use the METH_FASTCALL calling convention
which avoids the creation of temporary tuple to pass positional arguments and
so is faster. For example, struct.pack("i", 1) becomes 1.56x faster (-36%)::

    $ ./python -m perf timeit \
        -s 'import struct; pack=struct.pack' 'pack("i", 1)' \
        --compare-to=../default-ref/python
    Median +- std dev: 119 ns +- 1 ns -> 76.8 ns +- 0.4 ns: 1.56x faster (-36%)
    Significant (t=295.91)

Patch co-written with Serhiy Storchaka.
2017-02-02 12:09:30 +01:00
Serhiy Storchaka bee09aecc2 Issue #29368: The extend() method is now called instead of the append()
method when unpickle collections.deque and other list-like objects.
This can speed up unpickling to 2 times.
2017-02-02 11:12:47 +02:00
Guido van Rossum 934aba66ef Issue #29377: Add three new wrappers to types.py (Manuel Krebber). 2017-02-01 10:55:58 -08:00
Victor Stinner 72268ae1c0 Fix test_gdb.test_wrapper_call() on Python 2
Issue #29367. On Python 2, __init__ name is render as u'__init__'.
2017-02-01 18:26:14 +01:00
Victor Stinner f94b68a025 Make test_gdb.test_wrapper_call() make reliable
Issue #29367. Use two break points to prevent breakpoint during Python
initialization.
2017-02-01 17:00:32 +01:00
Victor Stinner 611083331d python-gdb.py supports method-wrapper
Issue #29367: python-gdb.py now supports also method-wrapper (wrapperobject)
objects.
2017-02-01 16:29:54 +01:00