Commit Graph

21970 Commits

Author SHA1 Message Date
gescheit 3bbcc92577 bpo-25430: improve performance of IPNetwork.__contains__ (GH-1785)
make a compare in bit-operation manner.
2019-04-30 16:54:30 +09:00
Pablo Galindo d5d2b45469
bpo-36751: Deprecate getfullargspec and report positional-only args as regular args (GH-13016)
* bpo-36751: Deprecate getfullargspec and report positional-only args as regular args

* Use inspect.signature in testhelpers
2019-04-30 02:01:14 +01:00
Marco Rougeth 81c5a90595 bpo-36232: Improve error message on dbm.open() when the db doesn't exist (GH-12060) 2019-04-29 16:23:28 -07:00
Ned Deily 883dfc668f
bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011)
Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  For now, revert the original change and resume using
the default stack size when linking the interpreter.
2019-04-29 15:07:39 -04:00
Berker Peksag be6dbfb43b
bpo-1613500: Don't hardcode output file mode in fileinput.FileInput (GH-12986) 2019-04-29 17:55:39 +03:00
Paul Ganssle 88c0937056 bpo-36004: Add date.fromisocalendar (GH-11888)
This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.
2019-04-29 15:22:03 +02:00
xdegaye a86e06433a bpo-35952: Fix test.pythoninfo when the compiler is missing (GH-13007) 2019-04-29 14:53:30 +02:00
Pablo Galindo 8c77b8cb91
bpo-36540: PEP 570 -- Implementation (GH-12701)
This commit contains the implementation of PEP570: Python positional-only parameters.

* Update Grammar/Grammar with new typedarglist and varargslist

* Regenerate grammar files

* Update and regenerate AST related files

* Update code object

* Update marshal.c

* Update compiler and symtable

* Regenerate importlib files

* Update callable objects

* Implement positional-only args logic in ceval.c

* Regenerate frozen data

* Update standard library to account for positional-only args

* Add test file for positional-only args

* Update other test files to account for positional-only args

* Add News entry

* Update inspect module and related tests
2019-04-29 13:36:57 +01:00
xdegaye 7a5a1cfe04 bpo-36747: Remove the stale scriptsinstall Makefile target (GH-13003) 2019-04-29 11:01:42 +02:00
Joannah Nanjekye f781d202a2 bpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly (GH-12667)
PyEval_AcquireLock() and PyEval_AcquireThread() now
terminate the current thread if called while the interpreter is
finalizing, making them consistent with PyEval_RestoreThread(),
Py_END_ALLOW_THREADS, and PyGILState_Ensure().
2019-04-29 10:38:45 +02:00
xdegaye 254b309c80 bpo-21536: On Android, C extensions are linked to libpython (GH-12989) 2019-04-29 09:27:40 +02:00
Gordon P. Hemsley 50fed0b64f bpo-32424: Improve test coverage for xml.etree.ElementTree (GH-12891)
* Fix typo in test_cyclic_gc subtest
* Improve test coverage for xml.etree.ElementTree
2019-04-28 06:41:43 +02:00
Paul Ganssle 4d8c8c0ad6 bpo-36025: Fix PyDate_FromTimestamp API (GH-11922)
In the process of converting the date.fromtimestamp function to use
argument clinic in GH-8535, the C API for PyDate_FromTimestamp was
inadvertently changed to expect a timestamp object rather than an
argument tuple.

This PR fixes this backwards-incompatible change by adding a new wrapper
function for the C API function that unwraps the argument tuple and
passes it to the underlying function.

This PR also adds tests for both PyDate_FromTimestamp and
PyDateTime_FromTimestamp to prevent any further regressions.
2019-04-27 22:39:40 +03:00
Paul Ganssle 5c403b2035 bpo-36722: Style and grammar edits for ABI news entries (GH-12979) 2019-04-27 20:14:35 +02:00
Victor Stinner 75120d2205
bpo-36719: regrtest always detect uncollectable objects (GH-12951)
regrtest now always detects uncollectable objects. Previously, the
check was only enabled by --findleaks. The check now also works with
-jN/--multiprocess N.

--findleaks becomes a deprecated alias to --fail-env-changed.
2019-04-26 09:28:53 +02:00
Mark Dickinson 7abb6c05af
bpo-36669: add matmul support to weakref.proxy (GH-12932) 2019-04-26 15:56:15 +09:00
Victor Stinner 3cde440f20
bpo-36725: Refactor regrtest multiprocessing code (GH-12961)
Rewrite run_tests_multiprocess() function as a new MultiprocessRunner
class with multiple methods to better report errors and stop
immediately when needed.

Changes:

* Worker processes are now killed immediately if tests are
  interrupted or if a test does crash (CHILD_ERROR): worker
  processes are killed.
* Rewrite how errors in a worker thread are reported to
  the main thread. No longer ignore BaseException or parsing errors
  silently.
* Remove 'finished' variable: use worker.is_alive() instead
* Always compute omitted tests. Add Regrtest.get_executed() method.
2019-04-26 08:40:25 +02:00
Victor Stinner 5422e3cfb7
bpo-36722: Debug build loads libraries built in release mode (GH-12952)
In debug build, import now also looks for C extensions compiled in
release mode and for C extensions compiled in the stable ABI.
2019-04-26 01:40:00 +02:00
Paul Monson 62dfd7d6fe bpo-35920: Windows 10 ARM32 platform support (GH-11774) 2019-04-25 18:36:45 +00:00
Victor Stinner 8c3ecc6bac
bpo-21536: C extensions are no longer linked to libpython (GH-12946)
On Unix, C extensions are no longer linked to libpython.

It is now possible to load a C extension built using a shared library
Python with a statically linked Python.

When Python is embedded, libpython must not be loaded with
RTLD_LOCAL, but RTLD_GLOBAL instead. Previously, using RTLD_LOCAL, it
was already not possible to load C extensions which were not linked
to libpython, like C extensions of the standard library built by the
"*shared*" section of Modules/Setup.

distutils, python-config and python-config.py have been modified.
2019-04-25 20:13:10 +02:00
Victor Stinner 0ef8c157e9
bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875)
bpo-28552, bpo-7774: Fix distutils.sysconfig if sys.executable is
None or an empty string: use os.getcwd() to initialize project_base.

Fix also the distutils build command: don't use sys.executable if
it's evaluated as false (None or empty string).
2019-04-25 11:59:34 +02:00
Victor Stinner 235e7b2b0d
bpo-36465: Fix test_regrtest on Windows (GH-12945)
Fix Py_DEBUG constant: check for sys.gettotalrefcount attribute
rather than sys.getobjects.

Update also SpecialBuilds.txt documentation.
2019-04-25 01:46:31 +02:00
Victor Stinner f4e4703e74
bpo-36465: Make release and debug ABI compatible (GH-12615)
Release build and debug build are now ABI compatible: the Py_DEBUG
define no longer implies Py_TRACE_REFS define which introduces the
only ABI incompatibility.

A new "./configure --with-trace-refs" build option is now required to
get Py_TRACE_REFS define which adds sys.getobjects() function and
PYTHONDUMPREFS environment variable.

Changes:

* Add ./configure --with-trace-refs
* Py_DEBUG no longer implies Py_TRACE_REFS
2019-04-25 00:56:28 +02:00
Thomas Moreau 004b93ea89 bpo-36668: FIX reuse semaphore tracker for child processes (#5172)
Fix the multiprocessing.semaphore_tracker so it is reused by child processes.
2019-04-24 21:45:52 +02:00
Joannah Nanjekye 70bf713617 bpo-30840: Document relative imports (#12831)
* document relative imports

* 📜🤖 Added by blurb_it.

* fix indentation error

* remove indentation

* Document relative imports

* Document relative imports

* remove from ...package

* Document relative imports

* remove trailing space

* Document relative imports

* Document relative imports
2019-04-25 01:14:44 +10:00
Victor Stinner 6c44fde3e0
bpo-36707: Remove the "m" flag (pymalloc) from SOABI (GH-12931)
"./configure --with-pymalloc" no longer adds the "m" flag to SOABI
(sys.implementation.cache_tag).

Enabling or disabling pymalloc has no impact on the ABI.
2019-04-24 16:10:09 +02:00
Victor Stinner d246a6766b
bpo-36454: Fix test_time.test_monotonic() (GH-12929)
Change test_time.test_monotonic() to test only the lower bound of elapsed time
after a sleep command rather than the upper bound. This prevents unnecessary
test failures on slow buildbots. Patch by Victor Stinner.
2019-04-24 00:15:12 +02:00
Zackery Spytz 359bd4f61b bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505) 2019-04-23 20:56:08 +09:00
Raymond Hettinger 9013ccf6d8
bpo-36546: Add statistics.quantiles() (#12710) 2019-04-23 00:06:35 -07:00
Marcin Niemira ab86521a9d bpo-36523: Add docstring to io.IOBase.writelines (GH-12683) 2019-04-22 20:13:51 +09:00
Xtreak 9b21856b0f bpo-23078: Add support for {class,static}method to mock.create_autospec() (GH-11613)
Co-authored-by: Felipe <felipe.nospam.ochoa@gmail.com>
2019-04-22 05:30:23 +03:00
Raymond Hettinger 14adbd4598
bpo-36650: Fix handling of empty keyword args in C version of lru_cache. (GH-12881) 2019-04-20 07:20:44 -10:00
Stefan Behnel e8113f51a8
bpo-30485: Change the prefix for defining the default namespace in ElementPath from None to '' since there is existing code that uses that and it's more convenient to have an all-string-keys dict (e.g. when sorting items etc.). (#12860) 2019-04-18 19:05:03 +02:00
Victor Stinner 23bace26ec
bpo-36635: Add _testinternalcapi module (GH-12841)
Add a new _testinternalcapi module to test the internal C API.

Move _Py_GetConfigsAsDict() function to the internal C API:
_testembed now uses _testinternalcapi to access the function.
2019-04-18 11:37:26 +02:00
josh a6de52c74d bpo-32913: Added re.Match.groupdict example to regex HOWTO (GH-5821) 2019-04-17 15:43:30 -07:00
Steve Dower 4c3efd9cd0
bpo-36649: Remove trailing spaces for registry keys when installed via the Store (GH-12865) 2019-04-17 14:31:32 -07:00
Victor Stinner 5c75f37d47
bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)
Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros
of pyport.h when Py_BUILD_CORE_MODULE is defined.

The Py_BUILD_CORE_MODULE define must be now be used to build a C
extension as a dynamic library accessing Python internals: export the
PyInit_xxx() function in DLL exports on Windows.

Changes:

* Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply
  Py_BUILD_CORE directy in pyport.h.
* ceval.c compilation now fails with an error if Py_BUILD_CORE is not
  defined, just to ensure that Python is build with the correct
  defines.
* setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define.
* setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather
  than Py_BUILD_CORE_BUILTIN define
* PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.
2019-04-17 23:02:26 +02:00
Victor Stinner 3092d6b263
bpo-32849: Fix is_valid_fd() on FreeBSD (GH-12852)
Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.
2019-04-17 18:09:12 +02:00
Victor Stinner 197f0447e3
bpo-35755: Don't say "to mimick Unix which command behavior" (GH-12861) 2019-04-17 17:44:06 +02:00
Lihua Zhao 693c104ae7 bpo-31904: Port test_resource to VxWorks (GH-12719)
Skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU on VxWorks.
2019-04-17 17:41:33 +02:00
Victor Stinner 2c4c02f8a8
bpo-35755: Remove current directory from posixpath.defpath (GH-11586)
Document the change in a NEWS entry of the Security category.
2019-04-17 17:05:30 +02:00
Victor Stinner 228a3c99bd
bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858)
shutil.which() and distutils.spawn.find_executable() now use
os.confstr("CS_PATH") if available instead of os.defpath, if the PATH
environment variable is not set.

Don't use os.confstr("CS_PATH") nor os.defpath if the PATH
environment variable is set to an empty string to mimick Unix 'which'
command behavior.

Changes:

* find_executable() now starts by checking for the executable in the
  current working directly case. Add an explicit
  "if not path: return None".
* Add tests for PATH='' (empty string), PATH=':' and for PATHEXT.
2019-04-17 16:26:36 +02:00
Lihua Zhao 36c41bc201 bpo-31904: Fix test_tabnanny on VxWorks (GH-12646)
Fix test_tabnanny on VxWorks: adjust ENOENT error message,
use os.strerror().
2019-04-17 11:46:50 +02:00
Inada Naoki 926b0cb5f6
bpo-36641: Add "const" to PyDoc_VAR macro (GH-12854)
It reduces "data" segment in python about 200KB.
2019-04-17 08:39:46 +09:00
Stéphane Wirtel 2b7f93b99a
bpo-36345: Update wsgiref example (GH-12562)
Use literalinclude markup to include Tools/scripts/serve.py code.
Tools/scripts/serve.py first argument on the command line is now optional.
2019-04-16 14:52:54 +02:00
Victor Stinner 74125a60b7
bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)
The imap.IMAP4.logout() method no longer ignores silently arbitrary
exceptions.

Changes:

* The IMAP4.logout() method now expects a "BYE" untagged response,
  rather than relying on _check_bye() which raises a self.abort()
  exception.
* IMAP4.__exit__() now does nothing if the client already logged out.
* Add more debug info if test_logout() tests fail.
2019-04-15 18:23:20 +02:00
Jakub Molinski a9a28808e5 bpo-36625: Remove obsolete comments from docstrings in fractions module (GH-12822)
Remove left-over references to Python 3.0 as the future in Fraction class docstrings.
2019-04-15 13:37:04 +01:00
Victor Stinner 3c7931e514
bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834)
Fix test_imap4_host_default_value() of test_imaplib: catch also
errno.ENETUNREACH error.
2019-04-15 12:34:53 +02:00
pxinwr f1464f4d2e bpo-31904: Port the time module on VxWorks (GH-12305)
time.clock() is not available on VxWorks.
2019-04-15 11:06:21 +02:00
pxinwr 236d0b75c4 bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833) 2019-04-15 11:02:20 +02:00