Commit Graph

102841 Commits

Author SHA1 Message Date
Victor Stinner 1005c84535
bpo-34100: Partially revert merge_consts_recursive() (GH-10743)
Partically revert commit c2e1607a51 to
fix a reference leak.
2018-11-27 15:12:47 +01:00
Victor Stinner 480833808e
bpo-35134: Update "make tags": add Include/cpython/ (GH-10739)
"make tags" and "make TAGS" now also parse Include/cpython/ header
files.
2018-11-27 12:42:25 +01:00
Victor Stinner 163403a63e
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.
2018-11-27 12:41:17 +01:00
Victor Stinner cfaafda8e3
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.
2018-11-27 12:40:50 +01:00
Serhiy Storchaka 62be74290a
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.
2018-11-27 13:27:31 +02:00
Serhiy Storchaka 81524022d0
bpo-33012: Fix signatures of METH_NOARGS funstions. (GH-10736) 2018-11-27 13:05:02 +02:00
Serhiy Storchaka 4a934d490f
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.
2018-11-27 11:27:36 +02:00
Serhiy Storchaka b619b09792
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.
2018-11-27 09:40:29 +02:00
Zackery Spytz d1cbc6f8a0 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.
2018-11-27 07:40:49 +02:00
E. M. Bray da324d53d4 closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712) 2018-11-26 20:21:31 -06:00
Victor Stinner f2a9d5c837
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.
2018-11-27 00:20:00 +01:00
Victor Stinner ffedd9ad2a
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.
2018-11-27 00:12:26 +01:00
Victor Stinner dd12aa0aea
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.
2018-11-27 00:12:05 +01:00
Victor Stinner 4060283fce
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.
2018-11-26 22:42:04 +01:00
Zhiming Wang 8c281ed403 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.
2018-11-26 23:29:45 +02:00
Victor Stinner 5a8c240b1d
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.
2018-11-26 22:11:25 +01:00
Victor Stinner 65c216e74f
bpo-33723: Fix test_time.test_thread_time() (GH-10724)
Tolerate up to 30 ms, instead of 15 min, in other threads.
2018-11-26 21:19:29 +01:00
Lisa Roach 433433fa6d
Adds IPv6 support when invoking http.server directly. (GH-10595) 2018-11-26 10:43:38 -08:00
Victor Stinner 75e4699b31
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.
2018-11-26 17:29:38 +01:00
Mathieu Dupuy 5719f275b7 Doc: Delete now useless Windows FAQ section (GH-10557) 2018-11-26 17:13:41 +01:00
Victor Stinner 6eb996685e
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.
2018-11-26 17:09:16 +01:00
Victor Stinner 282c03d45d
pythoninfo: log more environment variable (GH-10719)
Log TZ to debug a timezone issue... and a few more :-)
2018-11-26 17:03:16 +01:00
Victor Stinner 59423e3ddd
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.
2018-11-26 13:40:01 +01:00
Victor Stinner df108dc661
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.
2018-11-26 13:37:13 +01:00
INADA Naoki c2e1607a51 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
2018-11-26 04:23:22 -08:00
Victor Stinner f0b366a8d7
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.
2018-11-26 12:37:34 +01:00
Victor Stinner a6537fb7c2
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.
2018-11-26 11:54:12 +01:00
Raymond Hettinger f0e0f2008d bpo-35300: Add usage note to the lru_cache() docs (GH-10707)
https://bugs.python.org/issue35300
2018-11-25 16:24:52 -08:00
Victor Stinner ec13b9322d
bpo-35081: Add Include/internal/pycore_tupleobject.h (GH-10705)
Move _PyTuple_ITEMS() to a new header file:
Include/internal/pycore_tupleobject.h
2018-11-25 23:56:17 +01:00
Victor Stinner 8ac6539d85
bpo-35081: Add _PyTuple_CAST() (GH-10704) 2018-11-25 23:30:32 +01:00
Boštjan Mejak 158695817d closes bpo-35309: cpath should be capath (GH-10699) 2018-11-25 12:32:50 -06:00
Serhiy Storchaka 4bb186d7e2
bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) 2018-11-25 09:51:14 +02:00
Julien Palard 7f4ba4afd4
Doc: Bump sphinx. (GH-10676) 2018-11-24 11:35:21 +01:00
Zackery Spytz 5b83ef71d3 bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689) 2018-11-23 21:26:46 +02:00
Dustin Spicuzza 1d817e4c82 bpo-29877: compileall: import ProcessPoolExecutor only when needed (GH-4856)
Importing ProcessPoolExecutor may hang or cause an error when the import
accesses urandom on a low resource platform


https://bugs.python.org/issue29877
2018-11-23 09:06:55 -08:00
Victor Stinner 9de3632715
bpo-34812: subprocess._args_from_interpreter_flags(): add isolated (GH-10675)
The "-I" command line option (run Python in isolated mode) is now
also copied by the multiprocessing and distutils modules when
spawning child processes. Previously, only -E and -s options (enabled
by -I) were copied.

subprocess._args_from_interpreter_flags() now copies the -I flag.
2018-11-23 17:54:20 +01:00
takey ba57963a95 Linkify SMTP.quit() in smtplib documentation. (GH-9785) 2018-11-23 08:53:24 -08:00
Victor Stinner e421106b9e
bpo-35134: Create Include/cpython/ subdirectory (GH-10624)
Include/*.h should be the "portable Python API", whereas
Include/cpython/*.h should be the "CPython API": CPython
implementation details.

Changes:

* Create Include/cpython/ subdirectory
* "make install" now creates $prefix/include/cpython and copy
  Include/cpython/* to $prefix/include/cpython
* Create Include/cpython/objimpl.h: move objimpl.h code
  surrounded by "#ifndef Py_LIMITED_API" to cpython/objimpl.h.
* objimpl.h now includes cpython/objimpl.h
* Windows installer (MSI) now also install Include/ subdirectories:
  Include/cpython/ and Include/internal/.
2018-11-23 17:00:00 +01:00
nierob b409ffa848 bpo-35189: Retry fnctl calls on EINTR (GH-10413)
Modify the following fnctl function to retry if interrupted by a signal
(EINTR): flock, lockf, fnctl.
2018-11-23 16:46:12 +01:00
Victor Stinner f653fd4d95
bpo-35296: make install now installs the internal API (GH-10665)
make install now also installs the internal API: Include/internal/*.h
header files.
2018-11-23 16:30:12 +01:00
Mathieu Dupuy a1c4001408 Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487)
That section is a tip on how to kill process on Windows for Python prior to 2.7 and 3.2.
3.1 end of support was April 2012 and 2.6 was October 2013, so that hasn't been need for supported versions of Python for more than 5 years. Beside not being needed anymore for a long time, when I read it with the eyes of a Python profane, it makes Python looks bad, like a language from the parts with warts you need to circumvent.
Let's delete that :)
2018-11-23 15:35:07 +01:00
Victor Stinner 4ac5328aff
bpo-35081: add NEWS entry for new Include/internal/pycore_*.h files (GH-10666) 2018-11-23 15:05:15 +01:00
Victor Stinner b509d52083
bpo-35059: PyObject_INIT() casts to PyObject* (GH-10674)
PyObject_INIT() and PyObject_INIT_VAR() now cast their first argument
to PyObject*, as done in Python 3.7.

Revert partially commit b4435e20a9.
2018-11-23 14:27:38 +01:00
Victor Stinner 353933e712
bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672)
bpo-34523, bpo-35290: C locale coercion now resets the Python
internal "force ASCII" mode. This change fix the filesystem encoding
on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when
the UTF-8 mode is disabled.

Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it.
2018-11-23 13:08:26 +01:00
Victor Stinner e89607c0fc
bpo-35059: NEWS entry for macros converted to inline funcs (GH-10671) 2018-11-23 12:34:35 +01:00
Victor Stinner 984061eeb4
bpo-35081: Add new internal headers to Makefile (GH-10670)
Add pycore_fileutils.h and pycore_object.h to Makefile.pre.in and to
the pythoncore project of PCbuild/.
2018-11-23 12:30:40 +01:00
Victor Stinner 3bb183d7fb
bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664)
Partially revert commit 5f2df88b63e50d23914e97ec778861a52abdeaad:
add "#undef Yield" to .c files after including Python-ast.h.

Fix the warning:

    winbase.h(102): warning C4005: 'Yield': macro redefinition
2018-11-22 18:38:38 +01:00
Victor Stinner 2cf5d32fd9
bpo-9263: Fix _PyObject_Dump() for freed object (#10661)
If _PyObject_Dump() detects that the object is freed, don't try to
dump it (exit immediately).

Enhance also _PyObject_IsFreed(): it now detects if the pointer
itself looks like freed memory.
2018-11-22 16:32:57 +01:00
Victor Stinner 9a0d7a7648
bpo-24658: os.read() reuses _PY_READ_MAX (GH-10657)
os_read_impl() now also truncates the size to _PY_READ_MAX
on macOS, to avoid to allocate a larger buffer even if _Py_read() is
limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS).
2018-11-22 15:03:40 +01:00
Victor Stinner 4d73ae7761
bpo-18407: ast.c uses Py_ssize_t for asdl_seq_LEN() iterator (GH-10655)
When iterating using asdl_seq_LEN(), use 'Py_ssize_t' type instead of
'int' for the iterator variable, to avoid downcast on 64-bit platforms.

_Py_asdl_int_seq_new() now also ensures that the index is greater than
or equal to 0.
2018-11-22 14:45:16 +01:00