Commit Graph

100752 Commits

Author SHA1 Message Date
xdegaye 961dbe0548
bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link list' (GH-4696) 2017-12-07 12:59:13 +01:00
Pablo Galindo fb77e0d855 Fix hardcoded value in test_os.py (#4744) 2017-12-07 07:55:44 +01:00
Steve Dower 9ab11b3a02
Allows non-critical upload steps to fail (#4742) 2017-12-06 11:33:15 -08:00
Eric V. Smith 24e77f9265
Use raw strings for regex to avoid invalid escape sequences. (GH-4741) 2017-12-06 14:00:34 -05:00
Rob Boehne 9d25bd11ca Modify configure to link with the compiler driver under HP-UX when not using gcc. (#2519) 2017-12-06 09:58:17 -08:00
Stefan Krah bd4ed77f73
bpo-32233: Fix build with --with-system-libmpdec. (#4739) 2017-12-06 18:24:17 +01:00
Victor Stinner 92a3c6f493
bpo-32030: Add _PyImport_Fini2() (#4737)
PyImport_ExtendInittab() now uses PyMem_RawRealloc() rather than
PyMem_Realloc(). PyImport_ExtendInittab() can be called before
Py_Initialize() whereas only the PyMem_Raw allocator is supposed to
be used before Py_Initialize().

Add _PyImport_Fini2() to release the memory allocated by
PyImport_ExtendInittab() at exit. PyImport_ExtendInittab() now forces
the usage of the default raw allocator, to be able to release memory
in _PyImport_Fini2().

Don't export these functions anymore to be C API, only to
Py_BUILD_CORE:

* _PyExc_Fini()
* _PyImport_Fini()
* _PyGC_DumpShutdownStats()
* _PyGC_Fini()
* _PyType_Fini()
* _Py_HashRandomization_Fini()
2017-12-06 18:12:59 +01:00
Sanyam Khurana 1b4587a246 bpo-25910: Fixes redirection from http to https (#4674) 2017-12-06 17:39:33 +01:00
Victor Stinner 6bf992a1ac
bpo-32030: Add pymain_get_global_config() (#4735)
* Py_Main() now starts by reading Py_xxx configuration variables to
  only work on its own private structure, and then later writes back
  the configuration into these variables.
* Replace Py_GETENV() with pymain_get_env_var() which ignores empty
  variables.
* Add _PyCoreConfig.dump_refs
* Add _PyCoreConfig.malloc_stats
* _PyObject_DebugMallocStats() is now responsible to check if debug
  hooks are installed. The function returns 1 if stats were written,
  or 0 if the hooks are disabled. Mark _PyMem_PymallocEnabled() as
  static.
2017-12-06 17:26:10 +01:00
Victor Stinner 672b6baa71
bpo-32030: pass interp to _PyImport_Init() (#4736)
Remove also the initstr variable, unused since the commit
e69f0df45b pushed in 2012: "bpo-13959:
Re-implement imp.find_module() in Lib/imp.py"
2017-12-06 17:25:50 +01:00
Ned Deily a2a25eb037 Bump to 3.7.0a3+ 2017-12-05 21:06:12 -05:00
Ned Deily d86f29e9c9 Python 3.7.0a3
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAlomWNwACgkQLTR+pqpl
 Qh34Aw/+LDgBou5bRTgHXRAyx4vU8gDT97K0Fm604FXTcQLtTMo/3LDVa+7NbROg
 EWIaSxOjObRwZxjTVU1P063QKBDpjzeqK0PE+DYtEfpKVcqm8tADG30jHx9FYnXp
 yalV6/NzzHhcdxdhwrcbbAYnykk7xcUqEAimJ6YLgQYqe5Z1cemprjuPIcDWAagV
 Jw9ARZI9somzoqDRNAT1s72rJ7V/nKFGOcZ0PL+pv65o7essht+v7ReSxLsbyJYC
 ZAAxTiJT6fpyGc6/ZcKJ6xnbxINvlkdfqwELFMM7/+6l5Xwg07pZSEzOdh1Ng1sz
 woBIJkAoCTV4xAiKZ4DW6vxEeRFDnJgSO7Vd2zFKpSa9iLorZBEpNSObP/1gLTUC
 0fah7ddY2ZIHsi6vdAKnD877FoYFlNsSnlYxHxE1dOOB/5LbHd25/4gTjOHvav8n
 Xrd0qZ4SVVNSdqvDIhsf3GHnao9N5wKkcs9YBX/BK8ryRdIyUof3a2vXoOJtsNNt
 poyIhmrnqjRYttDVHefPk+vi/rS3l3kLfj71AKdmfO5Fv7xFXbzcJBU3ax5SBvbp
 w1XoMoTOSJDZt/GdMvC2htsG5PZWw8Bg8RGqBrLyUFEN0rnoIh5ykEH6YuPSusDQ
 fFUuaE1pGETNhrE50YWYYb4MGOE4xakdRV6cT402DhrzexFwuCA=
 =CREY
 -----END PGP SIGNATURE-----

Merge tag 'v3.7.0a3'
2017-12-05 20:57:44 -05:00
Guido van Rossum 5e8cbcc4f2 Add Guido and Ivan as owners for typing.py (#4729) 2017-12-05 16:56:39 -05:00
Eric V. Smith 2582f6f24e
Add dataclasses to CODEOWNERS. (GH-4730) 2017-12-05 15:52:19 -05:00
Victor Stinner 33c377ed9b
bpo-32030: Simplify _PyCoreConfig_INIT macro (#4728)
* Simplify _PyCoreConfig_INIT, _PyMainInterpreterConfig_INIT,
  _PyPathConfig_INIT macros: no need to set fields to 0/NULL, it's
  redundant (the C language sets them to 0/NULL for us).
* Fix typo: pymain_run_statup() => pymain_run_startup()
* Remove a few XXX/TODO
2017-12-05 15:12:41 +01:00
Ned Deily 90a6785f63 Bump to 3.7.0a3 2017-12-05 03:27:19 -05:00
Ned Deily 3f9a728d95 Update NEWS and pydoc topics. 2017-12-05 03:17:33 -05:00
Ned Deily d4d2b56302 Tidy NEWS entry. 2017-12-05 02:45:57 -05:00
Julien Palard ae342cf7de Add a missing space in tkinter documentation. (GH-4692) 2017-12-04 21:05:33 -08:00
Ned Deily b3edde8dd4
bpo-31380: Skip test_httpservers test_undecodable_file on macOS. (#4720)
The undecodable file name cannot be created on macOS APFS file systems.
2017-12-04 23:42:02 -05:00
Ned Deily e6f8a7378d
Update macOS installer to XZ 5.2.3 (#4718) 2017-12-04 22:55:20 -05:00
Ned Deily 24e046987b
bpo-31392: Update macOS installer to use OpenSSL 1.0.2m (#4715) 2017-12-04 22:24:41 -05:00
Neil Schemenauer 8837dd092f
bpo-19610: Warn if distutils is provided something other than a list to some fields (#4685)
* Rather than raise TypeError, warn and call list() on the value.

* Fix tests, revise NEWS and whatsnew text.

* Revise documentation, a string is okay as well.

* Ensure 'requires' and 'obsoletes' are real lists.

* Test that requires and obsoletes are turned to lists.
2017-12-04 18:58:12 -08:00
Ned Deily 9625bf520e
Enable SQLite JSON functions for macOS installer build (#4712) 2017-12-04 21:50:29 -05:00
Ivan Levkivskyi 29bc193210 [bpo-28556] Minor fixes for typing module (#4710) 2017-12-04 21:43:58 -05:00
Mariatta ca7562a7fe bpo-28791: Update macOS installer to use SQLite 3.21.0. (#4245) 2017-12-04 21:04:49 -05:00
Terry Jan Reedy 2c0c68d927
bpo-30928: update idlelib/NEWS.txt. (#4706) 2017-12-04 17:04:15 -05:00
Eric V. Smith f0db54a0a1
bpo-32214: Implement PEP 557: Data Classes (#4704) 2017-12-04 16:58:55 -05:00
Terry Jan Reedy 1e2fcac497
bpo-32207: Improve tk event exception tracebacks in IDLE. (#4703)
When tk event handling is driven by IDLE's run loop, a confusing
and distracting queue.EMPTY traceback context is no longer added
to tk event exception tracebacks.  The traceback is now the same
as when event handling is driven by user code.  Patch based on
a suggestion by Serhiy Storchaka.
2017-12-04 16:16:18 -05:00
Terry Jan Reedy 21255fc393
bpo-30928: Update idlelib/NEWS.txt to 2017 Dec 3. (#4701)
Patches are in 3.7.0a3 even if this update is not.
2017-12-04 14:48:25 -05:00
Victor Stinner 31a8393cf6
Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)" (#4694)
* Revert "bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)"

This reverts commit 13badcbc60.

Re-apply commits:

* "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)"
  commit af5a895073.
* "bpo-32030: Fix config_get_program_name() on macOS (#4669)"
  commit e23c06e2b0.
* "bpo-32030: Add Python/pathconfig.c (#4668)"
  commit 0ea395ae96.
* "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)"
  commit ebac19dad6.
* "bpo-32030: Fix Py_GetPath(): init program_name (#4665)"
  commit 9ac3d88827.

* Fix compilation error on macOS
2017-12-04 13:39:15 +01:00
Serhiy Storchaka 70d56fb525
bpo-25054, bpo-1647489: Added support of splitting on zerowidth patterns. (#4471)
Also fixed searching patterns that could match an empty string.
2017-12-04 14:29:05 +02:00
Serhiy Storchaka e69fbb6a56
Fix a regression in uuid added in bpo-32107. (#4677)
uuid.get_node() always must return a stable result.
Also added a test for non-reproducibility of _random_getnode().
Original patch by Xavier de Gaye.
2017-12-04 11:51:55 +02:00
R. David Murray 85d5c18c9d
bpo-27240 Rewrite the email header folding algorithm. (#3488)
The original algorithm tried to delegate the folding to the tokens so
that those tokens whose folding rules differed could specify the
differences.  However, this resulted in a lot of duplicated code because
most of the rules were the same.

The new algorithm moves all folding logic into a set of functions
external to the token classes, but puts the information about which
tokens can be folded in which ways on the tokens...with the exception of
mime-parameters, which are a special case (which was not even
implemented in the old folder).

This algorithm can still probably be improved and hopefully simplified
somewhat.

Note that some of the test expectations are changed.  I believe the
changes are toward more desirable and consistent behavior: in general
when (re) folding a line the canonical version of the tokens is
generated, rather than preserving errors or extra whitespace.
2017-12-03 18:51:41 -05:00
Serhiy Storchaka 29ba688034
bpo-31619: Fixed integer overflow in converting huge strings to int. (#3884) 2017-12-03 22:16:21 +02:00
Serhiy Storchaka 1fb72d2ad2
bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)
instead of crashing due to a stack overflow.

This perhaps will fix similar problems in other extension types.
2017-12-03 22:12:11 +02:00
Neil Schemenauer eea3cc1ef0
Refactor PyImport_ImportModuleLevelObject(). (#4680)
Add import_find_and_load() helper function.  The addition of
the importtime option has made PyImport_ImportModuleLevelObject() large
and so using a helper seems worthwhile.  It also makes it clearer that
abs_name is the only argument needed by _find_and_load().
2017-12-03 09:26:03 -08:00
Nick Coghlan 078f1814f1
bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)
Previously, CO_NOFREE was set in the compiler, which meant
it could end up being set incorrectly when code objects
were created directly. Setting it in the constructor based
on freevars and cellvars ensures it is always accurate,
regardless of how the code object is defined.
2017-12-03 11:12:20 +10:00
Julien Palard 7324b5ce8e bpo-31589 : Build PDF using xelatex for better UTF8 support. (#3940)
Also addresses doc build failures documented in bpo-32200.
2017-12-02 17:24:39 -05:00
Neil Schemenauer 1eaa1169c5
Add a minimal unit test for Python/frozen.c. (#2995)
If the marshal or bytecode formats get changed, frozen.c needs to
be updated as well.  It can be easy to miss this step and not doing
so can cause test_importlib to crash in mysterious ways.  Add an
explict unit test to make it easier to track down the problem.
2017-12-02 13:54:00 -08:00
Serhiy Storchaka 13badcbc60
bpo-32197: Try to fix a compiler error on OS X introduced in bpo-32030. (#4681)
* Revert "bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)"

This reverts commit af5a895073.

* Revert "bpo-32030: Fix config_get_program_name() on macOS (#4669)"

This reverts commit e23c06e2b0.

* Revert "bpo-32030: Add Python/pathconfig.c (#4668)"

This reverts commit 0ea395ae96.

* Revert "bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)"

This reverts commit ebac19dad6.

* Revert "bpo-32030: Fix Py_GetPath(): init program_name (#4665)"

This reverts commit 9ac3d88827.
2017-12-02 21:36:00 +02:00
Victor Stinner af5a895073
bpo-32030: _PyPathConfig_Init() sets home and program_name (#4673)
_PyPathConfig_Init() now also initialize home and program_name:

* Rename existing _PyPathConfig_Init() to _PyPathConfig_Calculate().
  Add a new _PyPathConfig_Init() function in pathconfig.c which
  handles the _Py_path_config variable and call
  _PyPathConfig_Calculate().
* Add home and program_name fields to _PyPathConfig.home
* _PyPathConfig_Init() now initialize home and program_name
  from main_config
* Py_SetProgramName(), Py_SetPythonHome() and Py_GetPythonHome() now
  calls Py_FatalError() on failure, instead of silently ignoring
  failures.
* config_init_home() now gets directly _Py_path_config.home to only
  get the value set by Py_SetPythonHome(), or NULL if
  Py_SetPythonHome() was not called.
* config_get_program_name() now gets directly
  _Py_path_config.program_name to only get the value set by
  Py_SetProgramName(), or NULL if Py_SetProgramName() was not called.
* pymain_init_python() doesn't call Py_SetProgramName() anymore,
  _PyPathConfig_Init() now always sets the program name
* Call _PyMainInterpreterConfig_Read() in
  pymain_parse_cmdline_envvars_impl() to control the memory allocator
* C API documentation: it's no more safe to call Py_GetProgramName()
  before Py_Initialize().
2017-12-02 10:11:32 +01:00
Victor Stinner e23c06e2b0
bpo-32030: Fix config_get_program_name() on macOS (#4669) 2017-12-01 21:19:48 +01:00
Victor Stinner 0ea395ae96
bpo-32030: Add Python/pathconfig.c (#4668)
* Factorize code from PC/getpathp.c and Modules/getpath.c to remove
  duplicated code
* rename pathconfig_clear() to _PyPathConfig_Clear()
* Inline _PyPathConfig_Fini() in pymain_impl() and then remove it,
  since it's a oneliner
2017-12-01 20:50:58 +01:00
Victor Stinner ebac19dad6
bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)
Changes:

* _PyPathConfig_Fini() cannot be called in Py_FinalizeEx().
  Py_Initialize() and Py_Finalize() can be called multiple times, but
  it must not "forget" parameters set by Py_SetProgramName(),
  Py_SetPath() or Py_SetPythonHome(), whereas _PyPathConfig_Fini()
  clear all these parameters.
* config_get_program_name() and calculate_program_full_path() now
  also decode paths using Py_DecodeLocale() to use the
  surrogateescape error handler, rather than decoding using
  mbstowcs() which is strict.
* Change _Py_CheckPython3() prototype: () => (void)
* Truncate a few lines which were too long
2017-12-01 20:09:52 +01:00
Victor Stinner 9ac3d88827
bpo-32030: Fix Py_GetPath(): init program_name (#4665)
* _PyMainInterpreterConfig_ReadEnv() now sets program_name from
  environment variables and pymain_parse_envvars() implements the
  falls back on argv[0].
* Remove _PyMain.program_name: use the program_name from
  _PyMainInterpreterConfig
* Move the Py_SetProgramName() call back to pymain_init_python(),
  just before _Py_InitializeCore().
* pathconfig_global_init() now also calls
  _PyMainInterpreterConfig_Read() to set program_name if it isn't set
  yet
* Cleanup PyCalculatePath: pass main_config to subfunctions to get
  directly fields from main_config (home, module_search_path_env and
  program_name)
2017-12-01 19:30:41 +01:00
Victor Stinner b64de46aae
bpo-32030: Cleanup "path config" code (#4663)
* Rename PyPathConfig structure to _PyPathConfig and move it to
  Include/internal/pystate.h
* Rename path_config to _Py_path_config
* _PyPathConfig: Rename program_name field to program_full_path
* Add assert(str != NULL); to _PyMem_RawWcsdup(), _PyMem_RawStrdup()
  and _PyMem_Strdup().
* Rename calculate_path() to pathconfig_global_init(). The function
  now does nothing if it's already initiallized.
2017-12-01 18:27:09 +01:00
John Chen 8f5c28b193 Fix asyncio.streams.FlowControlMixin docstring typo. (#4578) 2017-12-01 14:33:40 +02:00
xdegaye bf2b65e413
bpo-28668: test.support.requires_multiprocessing_queue is removed (GH-4560)
Skip tests with test.support.import_module('multiprocessing.synchronize')
instead when the semaphore implementation is broken or missing.
2017-12-01 08:08:49 +01:00
Serhiy Storchaka a561862048
Don't hide unexpected errors in PyErr_WarnExplicitObject(). (#4585) 2017-12-01 08:40:23 +02:00