]> granicus.if.org Git - python/log
python
6 years agobpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532)
MartinAltmayer [Tue, 31 Jul 2018 14:06:12 +0000 (15:06 +0100)]
bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532)

6 years agobpo-33089: Add math.dist() for computing the Euclidean distance between two points...
Raymond Hettinger [Tue, 31 Jul 2018 07:45:49 +0000 (00:45 -0700)]
bpo-33089: Add math.dist() for computing the Euclidean distance between two points (GH-8561)

6 years agobpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)
Serhiy Storchaka [Tue, 31 Jul 2018 07:24:54 +0000 (10:24 +0300)]
bpo-33871: Fix os.sendfile(), os.writev(), os.readv(), etc. (GH-7931)

* Fix integer overflow in os.readv(), os.writev(), os.preadv()
  and os.pwritev() and in os.sendfile() with headers or trailers
  arguments (on BSD-based OSes and MacOS).

* Fix sending the part of the file in os.sendfile() on MacOS.
  Using the trailers argument could cause sending more bytes from
  the input file than was specified.

Thanks Ned Deily for testing on 32-bit MacOS.

6 years agobpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)
Serhiy Storchaka [Tue, 31 Jul 2018 06:50:16 +0000 (09:50 +0300)]
bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)

* help(hashlib) didn't work because of incorrect module name in blake2b and
  blake2s classes.
* Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly
  accepted keyword argument "string" for binary data, but documented as
  accepting the "data" keyword argument. Now this parameter is positional-only.
* Keyword-only parameters in blake2b() and blake2s() were not documented as
  keyword-only.
* Default value for some parameters of blake2b() and blake2s() was None,
  which is not acceptable value.
* The length argument for shake_*.digest() was wrapped out to 32 bits.
* The argument for shake_128.digest() and shake_128.hexdigest() was not
  positional-only as intended.
* TypeError messages for incorrect arguments in all constructors sha3_*(),
  shake_*() and keccak_*() incorrectly referred to sha3_224.

Also made the following enhancements:

* More accurately specified input and result types for strings, bytes and
  bytes-like objects.
* Unified positional parameter names for update() and constructors.
* Improved formatting.

6 years ago Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator...
Serhiy Storchaka [Tue, 31 Jul 2018 06:34:30 +0000 (09:34 +0300)]
 Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (GH-3771)" (#8241)

This reverts commit af810b35b494ef1d255d4bf340b92a9dad446995.

This is not valid syntax (see bpo-32012).

6 years agobpo-1617161: Make the hash and equality of methods not depending on the value of...
Serhiy Storchaka [Tue, 31 Jul 2018 06:18:24 +0000 (09:18 +0300)]
bpo-1617161: Make the hash and equality of methods not depending on the value of self. (GH-7848)

* The hash of BuiltinMethodType instances no longer depends on the hash
  of __self__. It depends now on the hash of id(__self__).
* The hash and equality of ModuleType and MethodWrapperType instances no
  longer depend on the hash and equality of __self__. They depend now on
  the hash and equality of id(__self__).
* MethodWrapperType instances no longer support ordering.

6 years agobpo-27671: Update FAQ about why len is function (GH-8432)
INADA Naoki [Tue, 31 Jul 2018 05:49:22 +0000 (14:49 +0900)]
bpo-27671: Update FAQ about why len is function (GH-8432)

6 years agoRemove creation of a list for row_cast_map in pysqlite_cursor_init() (GH-8494)
Sergey Fedoseev [Mon, 30 Jul 2018 21:11:50 +0000 (02:11 +0500)]
Remove creation of a list for row_cast_map in pysqlite_cursor_init() (GH-8494)

This list is never used: if detect_types is on, this list will be
replaced with another one before row_cast_map is used, if
detect_types is off, row_cast_map is not used at all.

6 years agobpo-33833: Fix ProactorSocketTransport AssertionError (#7893)
twisteroid ambassador [Mon, 30 Jul 2018 18:58:50 +0000 (02:58 +0800)]
bpo-33833: Fix ProactorSocketTransport AssertionError (#7893)

6 years agoUse 'for example' instead of 'in other words' in compound statement doc (GH-8401)
Andrés Delfino [Mon, 30 Jul 2018 18:44:35 +0000 (15:44 -0300)]
Use 'for example' instead of 'in other words' in compound statement doc (GH-8401)

6 years agoFix typos & formatting in Using Python on Windows doc (GH-8559)
Segev Finer [Mon, 30 Jul 2018 17:11:30 +0000 (20:11 +0300)]
Fix typos & formatting in Using Python on Windows doc (GH-8559)

6 years agoAdd docstrings to public methods from context.c (GH-8531)
Peter Lamut [Mon, 30 Jul 2018 15:15:44 +0000 (16:15 +0100)]
Add docstrings to public methods from context.c (GH-8531)

6 years agobpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() (GH-8533)
Elvis Pranskevichus [Mon, 30 Jul 2018 10:42:43 +0000 (11:42 +0100)]
bpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() (GH-8533)

Various asyncio internals expect that the default executor is a
`ThreadPoolExecutor`, so deprecate passing anything else to
`loop.set_default_executor()`.

6 years agobpo-34182: Fix test_pydoc running as a script. (GH-8389)
Bo Bayles [Sun, 29 Jul 2018 19:15:14 +0000 (14:15 -0500)]
bpo-34182: Fix test_pydoc running as a script. (GH-8389)

6 years agobpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527)
Mickaël Schoentgen [Sun, 29 Jul 2018 18:26:52 +0000 (20:26 +0200)]
bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527)

6 years agobpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)
Franz Wöllert [Sun, 29 Jul 2018 12:47:09 +0000 (14:47 +0200)]
bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)

6 years agobpo-34231: PYTHONBREAKPOINT is not documented on python --help (GH-8475)
Stéphane Wirtel [Sun, 29 Jul 2018 10:27:16 +0000 (12:27 +0200)]
bpo-34231: PYTHONBREAKPOINT is not documented on python --help (GH-8475)

6 years agoUpdated MSI README to mention dependency on .NET 3.5. (GH-8375)
Vinay Sajip [Sun, 29 Jul 2018 09:05:20 +0000 (10:05 +0100)]
Updated MSI README to mention dependency on .NET 3.5. (GH-8375)

6 years agobpo-8145: Improve isolation_level documentation (GH-8499)
Berker Peksag [Sun, 29 Jul 2018 09:01:38 +0000 (12:01 +0300)]
bpo-8145: Improve isolation_level documentation (GH-8499)

Initial patch by R. David Murray.

6 years agobpo-34251: Restore msilib.Win64 to preserve compatibility (GH-8510)
Berker Peksag [Sat, 28 Jul 2018 21:02:56 +0000 (00:02 +0300)]
bpo-34251: Restore msilib.Win64 to preserve compatibility (GH-8510)

6 years agobpo-42349: Switch to test.support.unlink per review by Serhiy Storchaka (GH-8529)
Tim Golden [Sat, 28 Jul 2018 17:27:11 +0000 (18:27 +0100)]
bpo-42349: Switch to test.support.unlink per review by Serhiy Storchaka (GH-8529)

Serhiy Storchaka pointed out that using test.support.unlink was preferable

6 years agobpo-33089: Multidimensional math.hypot() (GH-8474)
Raymond Hettinger [Sat, 28 Jul 2018 14:48:04 +0000 (07:48 -0700)]
bpo-33089: Multidimensional math.hypot() (GH-8474)

6 years agobpo-24356: Specify which Python binary will be used with venv (GH-6589)
Elena Oat [Sat, 28 Jul 2018 12:58:05 +0000 (05:58 -0700)]
bpo-24356: Specify which Python binary will be used with venv (GH-6589)

6 years agobpo-33476: Fix _header_value_parser when address group is missing final ';' (GH-7484)
Dong-hee Na [Sat, 28 Jul 2018 12:55:11 +0000 (21:55 +0900)]
bpo-33476: Fix _header_value_parser when address group is missing final ';' (GH-7484)

6 years agobpo-33666: Add what's new entry for os.errno removal (GH-#8497)
INADA Naoki [Sat, 28 Jul 2018 12:47:31 +0000 (21:47 +0900)]
bpo-33666: Add what's new entry for os.errno removal (GH-#8497)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
6 years agobpo-33921: Clarify how to bind to all interfaces using socket (GH-7877)
johnthagen [Sat, 28 Jul 2018 10:03:23 +0000 (06:03 -0400)]
bpo-33921: Clarify how to bind to all interfaces using socket (GH-7877)

Clarify how to bind to all interfaces using socket

6 years agobpo-5978: Document that profiling needs cmd/function to return (GH-7938)
Andrés Delfino [Sat, 28 Jul 2018 10:01:24 +0000 (07:01 -0300)]
bpo-5978: Document that profiling needs cmd/function to return (GH-7938)

<!-- issue-number: bpo-5978 -->
https://bugs.python.org/issue5978
<!-- /issue-number -->

6 years agobpo-29710: Clarify documentation for Bitwise binary operation (GH-1691)
Sanyam Khurana [Sat, 28 Jul 2018 05:15:50 +0000 (10:45 +0530)]
bpo-29710: Clarify documentation for Bitwise binary operation (GH-1691)

Mathematically, bitwise operations on integers behave as if there were an
infinite number of sign bits. Pragmatically, that gives the same answer as
using one extra sign bit for the bitwise logical operations.

6 years agobpo-30722: Fix NEWS entries (GH-8501)
Berker Peksag [Fri, 27 Jul 2018 15:49:58 +0000 (18:49 +0300)]
bpo-30722: Fix NEWS entries (GH-8501)

6 years agoRemove some unused code in _pysqlite_query_execute() (GH-8495)
Sergey Fedoseev [Fri, 27 Jul 2018 10:06:03 +0000 (15:06 +0500)]
Remove some unused code in _pysqlite_query_execute() (GH-8495)

Unused since commit ab994ed8b97e1b0dac151ec827c857f5e7277565.

6 years agovsts: Avoid conflict with Homebrew Python (GH-8430)
INADA Naoki [Fri, 27 Jul 2018 07:52:24 +0000 (16:52 +0900)]
vsts: Avoid conflict with Homebrew Python (GH-8430)

/usr/local/lib/pythonX.Y is used by Homebrew's Python already.

6 years agobpo-12743: Delete comment from marshal.rst (GH-8457)
Berker Peksag [Fri, 27 Jul 2018 04:35:11 +0000 (07:35 +0300)]
bpo-12743: Delete comment from marshal.rst (GH-8457)

Also, update the list of exceptions that may raised by PyMarshal_*
functions. We usually don't document exceptions raised by a
function, but in this case most of them were already documented
in C API and standard library documentation.

6 years agobpo-34239: Convert test_bz2 to use tempfile (#8485)
Tim Golden [Thu, 26 Jul 2018 21:05:00 +0000 (22:05 +0100)]
bpo-34239: Convert test_bz2 to use tempfile (#8485)

* bpo-34239: Convert test_bz2 to use tempfile

test_bz2 currently uses the test.support.TESTFN functionality which creates a temporary file local to the test directory named around the pid.

This can give rise to race conditions where tests are competing with each other to delete and recreate the file.

This change converts the tests to use tempfile.mkstemp which gives a different file every time from the system's temp area

6 years agobpo-34170, test_embed: write Py_Initialize() tests (GH-8484)
Victor Stinner [Thu, 26 Jul 2018 16:57:56 +0000 (18:57 +0200)]
bpo-34170, test_embed: write Py_Initialize() tests (GH-8484)

6 years agoFix typo: variables(s) (GH-8482)
Andrés Delfino [Thu, 26 Jul 2018 15:35:23 +0000 (12:35 -0300)]
Fix typo: variables(s) (GH-8482)

Remove extra `(s)` in the documentation of `compound_stmts`.

6 years agobpo-34201: Tweak test_buffer. (GH-8481)
Serhiy Storchaka [Thu, 26 Jul 2018 14:34:07 +0000 (17:34 +0300)]
bpo-34201: Tweak test_buffer. (GH-8481)

6 years agobpo-34170: Cleanup pymain_read_conf() (GH-8476)
Victor Stinner [Thu, 26 Jul 2018 14:04:56 +0000 (16:04 +0200)]
bpo-34170: Cleanup pymain_read_conf() (GH-8476)

* Config: Rename ignore_environment field to use_environment.
* _PyCoreConfig_Read(): if isolated is set, use_environment and
  site_import are now always set to 0.
* Inline pymain_free_raw() into pymain_free()
* Move config_init_warnoptions() call into pymain_read_conf_impl()
* _PyCoreConfig_Read(): don't replace values if they are already set:
  faulthandler, pycache_prefix, home.

6 years agobpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. (GH-8464)
Steve Dower [Thu, 26 Jul 2018 11:23:10 +0000 (04:23 -0700)]
bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. (GH-8464)

6 years agobpo-34201: Make ndarray.readonly a bool and use stricter tests in test_buffer. (GH...
Serhiy Storchaka [Thu, 26 Jul 2018 10:23:03 +0000 (13:23 +0300)]
bpo-34201: Make ndarray.readonly a bool and use stricter tests in test_buffer. (GH-8414)

6 years agobpo-20260: Implement non-bitwise unsigned int converters for Argument Clinic. (GH...
Serhiy Storchaka [Thu, 26 Jul 2018 10:22:16 +0000 (13:22 +0300)]
bpo-20260: Implement non-bitwise unsigned int converters for Argument Clinic. (GH-8434)

6 years agobpo-34197: Make _csv.Dialect attributes booleans. (GH-8440)
Serhiy Storchaka [Thu, 26 Jul 2018 10:21:09 +0000 (13:21 +0300)]
bpo-34197: Make _csv.Dialect attributes booleans. (GH-8440)

Attributes skipinitialspace, doublequote and strict are now
booleans instead of integers 0 or 1.

6 years agobpo-34170: Enhance _PyCoreConfig_Read() (GH-8468)
Victor Stinner [Thu, 26 Jul 2018 00:37:22 +0000 (02:37 +0200)]
bpo-34170: Enhance _PyCoreConfig_Read() (GH-8468)

* Inline cmdline_get_env_flags() into config_read_env_vars():
  _PyCoreConfig_Read() now reads much more environment variables like
  PYTHONVERBOSE.
* Allow to override faulthandler and allocator even if dev_mode=1.
  PYTHONMALLOC is now the priority over PYTHONDEVMODE.
* Fix _PyCoreConfig_Copy(): copy also install_signal_handlers,
  coerce_c_locale and coerce_c_locale_warn
* _PyCoreConfig.install_signal_handlers default is now 1: install
  signals by default
* Fix also a compiler warning: don't define _PyPathConfig type twice.

6 years agobpo-32663 Make SMTPUTF8SimTests run (#5314)
chason [Wed, 25 Jul 2018 19:01:28 +0000 (04:01 +0900)]
bpo-32663 Make SMTPUTF8SimTests run (#5314)

Enable and fix SMTPUTF8SimTests in test_smtplib.

The tests for SMTPUTF8SimTests in test_smtplib.py were not actually
being run because test_smtplib was still using the 'test_main' pattern,
and the class was never added to test_main.

Additionally, one of the tests needed to be moved to the non-UTF8 server
class because it relies on the server not being UTF-8 compatible (and it
had a bug in in).

6 years agobpo-34228: Allow PYTHONTRACEMALLOC=0 (GH-8467)
Victor Stinner [Wed, 25 Jul 2018 17:23:53 +0000 (19:23 +0200)]
bpo-34228: Allow PYTHONTRACEMALLOC=0 (GH-8467)

PYTHONTRACEMALLOC=0 environment variable and -X tracemalloc=0 command
line option are now allowed to disable explicitly tracemalloc at
startup.

6 years agobpo-29097: Forego fold detection on windows for low timestamp values (GH-2385)
Ammar Askar [Wed, 25 Jul 2018 16:54:58 +0000 (09:54 -0700)]
bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385)

On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows.

6 years agobpo-13041: Use shutil.get_terminal_size() in argparse.HelpFormatter (GH-8459)
Berker Peksag [Wed, 25 Jul 2018 15:23:44 +0000 (18:23 +0300)]
bpo-13041: Use shutil.get_terminal_size() in argparse.HelpFormatter (GH-8459)

6 years agobpo-28677: Improve phrasing of when instance attribute is referenced (GH-6208)
Aaron Ang [Wed, 25 Jul 2018 14:21:32 +0000 (07:21 -0700)]
bpo-28677: Improve phrasing of when instance attribute is referenced (GH-6208)

6 years agobpo-34195: Fix case-sensitive comparison in test_nt_helpers (GH-8448)
Tim Golden [Wed, 25 Jul 2018 13:36:54 +0000 (14:36 +0100)]
bpo-34195: Fix case-sensitive comparison in test_nt_helpers (GH-8448)

* Fix case-sensitive comparison

test_nt_helpers assumed that two versions of a Windows path could be compared case-sensitively. This is not the case, and the difference can be triggered (apparently) by running the test on a path somewhere below a Junction.

6 years agobpo-34218: Fix a leak in _elementtree.c introduced in GH-6769. (GH-8460)
Serhiy Storchaka [Wed, 25 Jul 2018 11:52:45 +0000 (14:52 +0300)]
bpo-34218: Fix a leak in _elementtree.c introduced in GH-6769. (GH-8460)

6 years agobpo-34170: Cleanup pymain_run_python() (GH-8455)
Victor Stinner [Wed, 25 Jul 2018 08:21:03 +0000 (10:21 +0200)]
bpo-34170: Cleanup pymain_run_python() (GH-8455)

* Move _PyMain.main_importer_path inside pymain_run_python
* If main_importer_path is non-NULL, update sys.path[0] earlier

6 years agobpo-34170: Add _Py_InitializeFromConfig() (GH-8454)
Victor Stinner [Wed, 25 Jul 2018 00:49:17 +0000 (02:49 +0200)]
bpo-34170: Add _Py_InitializeFromConfig() (GH-8454)

* If _Py_InitializeCore() is called twice, the second call now copies
  and apply (partially) the new configuration.
* Rename _Py_CommandLineDetails to _PyCmdline
* Move more code into pymain_init(). The core configuration created
  by Py_Main() is new destroyed before running Python to reduce the
  memory footprint.
* _Py_InitializeCore() now returns the created interpreter.
  _Py_InitializeMainInterpreter() now expects an interpreter.
* Remove _Py_InitializeEx_Private(): _freeze_importlib now uses
  _Py_InitializeFromConfig()
* _PyCoreConfig_InitPathConfig() now only computes the path
  configuration if needed.

6 years agobpo-34217: Use lowercase header for Windows (GH-8453)
erikjanss [Wed, 25 Jul 2018 00:41:46 +0000 (02:41 +0200)]
bpo-34217: Use lowercase header for Windows (GH-8453)

6 years agobpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)
Victor Stinner [Tue, 24 Jul 2018 23:37:05 +0000 (01:37 +0200)]
bpo-34170: Add _PyCoreConfig.bytes_warning (GH-8447)

Add more fields to _PyCoreConfig:

* _check_hash_pycs_mode
* bytes_warning
* debug
* inspect
* interactive
* legacy_windows_fs_encoding
* legacy_windows_stdio
* optimization_level
* quiet
* unbuffered_stdio
* user_site_directory
* verbose
* write_bytecode

Changes:

* Remove pymain_get_global_config() and pymain_set_global_config()
  which became useless. These functions have been replaced by
  _PyCoreConfig_GetGlobalConfig() and
  _PyCoreConfig_SetGlobalConfig().
* sys.flags.dont_write_bytecode value is now restricted to 1 even if
  -B option is specified multiple times on the command line.
* PyThreadState_Clear() now uses the config from the current
  interpreter rather than using global Py_VerboseFlag

6 years agoFix site module documentation. (GH-8441)
Mariatta [Tue, 24 Jul 2018 16:14:20 +0000 (09:14 -0700)]
Fix site module documentation. (GH-8441)

The script will exit with the number 0 (zero), instead of the letter O.

6 years agobpo-34136: Make test_do_not_recreate_annotations more lenient. (GH-8437)
Serhiy Storchaka [Tue, 24 Jul 2018 12:05:28 +0000 (15:05 +0300)]
bpo-34136: Make test_do_not_recreate_annotations more lenient. (GH-8437)

6 years agobpo-34170: Add _PyCoreConfig.isolated (GH-8417)
Victor Stinner [Tue, 24 Jul 2018 11:55:48 +0000 (13:55 +0200)]
bpo-34170: Add _PyCoreConfig.isolated (GH-8417)

* _PyCoreConfig: add isolated and site_import attributes
* Replace Py_IgnoreEnvironment with config->ignore_environment when
  reading the current configuration
* _PyCoreConfig_Read() now sets ignore_environment, utf8_mode,
  isolated and site_import from Py_IgnoreEnvironment, Py_UTF8Mode,
  Py_IsolatedFlag and Py_NoSiteFlag
* _Py_InitializeCore() now sets Py_xxx flags from the configuration
* pymain_read_conf() now uses _PyCoreConfig_Copy() to save/restore
  the configuration.
* Rename _disable_importlib of _PyCoreConfig to _install_importlib
* _PyCoreConfig_SetGlobalConfig() now also set
  Py_HashRandomizationFlag
* Replace !Py_NoSiteFlag with core_config->site_import

6 years agobpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351)
Serhiy Storchaka [Tue, 24 Jul 2018 09:52:51 +0000 (12:52 +0300)]
bpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351)

Now base64.Error is always raised instead of UnboundLocalError or
OverflowError.

6 years agobpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)
Serhiy Storchaka [Tue, 24 Jul 2018 09:03:34 +0000 (12:03 +0300)]
bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)

Also make getchildren() and getiterator() emitting
a DeprecationWarning instead of PendingDeprecationWarning.

6 years agobpo-33720: Refactor marshalling/unmarshalling floats. (GH-8071)
Serhiy Storchaka [Tue, 24 Jul 2018 07:55:47 +0000 (10:55 +0300)]
bpo-33720: Refactor marshalling/unmarshalling floats. (GH-8071)

6 years agobpo-34149: Behavior of the min/max with key=None (GH-8328)
Alexander Marshalov [Tue, 24 Jul 2018 03:58:21 +0000 (10:58 +0700)]
bpo-34149: Behavior of the min/max with key=None (GH-8328)

Improve consistency with the signature for sorted(), heapq.nsmallest(), heapq.nlargest(), and itertools.groupby().

6 years agobpo-33468: Add try-finally contextlib.contextmanager example (GH-7816)
Matthias Bussonnier [Mon, 23 Jul 2018 21:10:56 +0000 (14:10 -0700)]
bpo-33468: Add try-finally contextlib.contextmanager example (GH-7816)

6 years agobpo-32500: Fix error messages for sequence and mapping C API. (GH-7846)
Serhiy Storchaka [Mon, 23 Jul 2018 20:43:42 +0000 (23:43 +0300)]
bpo-32500: Fix error messages for sequence and mapping C API. (GH-7846)

Fix error messages for PySequence_Size(), PySequence_GetItem(),
PySequence_SetItem() and PySequence_DelItem() called with a mapping
and PyMapping_Size() called with a sequence.

6 years agobpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. (GH-8262)
Serhiy Storchaka [Mon, 23 Jul 2018 20:41:11 +0000 (23:41 +0300)]
bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. (GH-8262)

6 years agobpo-34183: Fix running Lib/test/test_contextlib_async.py as a script. (GH-8381)
Serhiy Storchaka [Mon, 23 Jul 2018 20:38:31 +0000 (23:38 +0300)]
bpo-34183: Fix running Lib/test/test_contextlib_async.py as a script. (GH-8381)

6 years agobpo-34184: Fix running Lib/test/test_dataclasses.py as a script. (GH-8382)
Serhiy Storchaka [Mon, 23 Jul 2018 20:37:55 +0000 (23:37 +0300)]
bpo-34184: Fix running Lib/test/test_dataclasses.py as a script. (GH-8382)

6 years agobpo-34190: Fix reference leak in call_function() (GH-8413)
jdemeyer [Mon, 23 Jul 2018 16:41:20 +0000 (18:41 +0200)]
bpo-34190: Fix reference leak in call_function() (GH-8413)

6 years agobpo-33336, imaplib: Legalize MOVE command (GH-6569)
Matěj Cepl [Mon, 23 Jul 2018 11:28:54 +0000 (13:28 +0200)]
bpo-33336, imaplib: Legalize MOVE command (GH-6569)

imaplib now allows MOVE command in IMAP4.uid() (RFC 6851:
IMAP MOVE Extension) and potentially as a name of supported
method of IMAP4 object.

6 years agobpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)
Victor Stinner [Mon, 23 Jul 2018 11:17:59 +0000 (13:17 +0200)]
bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)

When Python is installed on Windows, python -m test test_tools failed
because it tried to run Tools\scripts\2to3.py which requires an
argument. Skip this script. On other platforms or on Windows but when
run from source code (not installed), the script is called "2to3"
instead of "2to.py" and so was already skipped.

Modify also the unit test to unload all modules which have been
loaded by the test.

6 years agoAppVeyor: build Python in 64-bit mode (GH-8363)
Victor Stinner [Mon, 23 Jul 2018 11:16:41 +0000 (13:16 +0200)]
AppVeyor: build Python in 64-bit mode (GH-8363)

Previously, Python was built in 32-bit mode and so issues specific to
64-bit mode like compiler warnings could be missed.

6 years agobpo-21446: Update reload fixer to use importlib (GH-8391)
Berker Peksag [Mon, 23 Jul 2018 06:49:08 +0000 (09:49 +0300)]
bpo-21446: Update reload fixer to use importlib (GH-8391)

6 years agobpo-940286: Fix pydoc to show cross refs correctly (GH-8390)
Berker Peksag [Mon, 23 Jul 2018 05:37:47 +0000 (08:37 +0300)]
bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)

6 years agobpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
Xtreak [Sun, 22 Jul 2018 20:13:26 +0000 (01:43 +0530)]
bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)

6 years agobpo-34189: Fix checking for bugfix Tcl version. (GH-8397)
Serhiy Storchaka [Sun, 22 Jul 2018 18:41:48 +0000 (21:41 +0300)]
bpo-34189: Fix checking for bugfix Tcl version. (GH-8397)

6 years agobpo-34189: Add simple tests for new Tk widget options. (GH-8396)
Serhiy Storchaka [Sun, 22 Jul 2018 16:50:14 +0000 (19:50 +0300)]
bpo-34189: Add simple tests for new Tk widget options. (GH-8396)

6 years agoFix versionchanged indentation in popitem documentation (GH-8387)
Andrés Delfino [Sat, 21 Jul 2018 22:14:56 +0000 (19:14 -0300)]
Fix versionchanged indentation in popitem documentation (GH-8387)

6 years agobpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380)
Serhiy Storchaka [Sat, 21 Jul 2018 19:46:26 +0000 (22:46 +0300)]
bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380)

6 years agobpo-34179: Make sure decimal context doesn't affect other tests. (#8376)
Bo Bayles [Sat, 21 Jul 2018 17:54:14 +0000 (12:54 -0500)]
bpo-34179:  Make sure decimal context doesn't affect other tests.  (#8376)

6 years agobpo-34126: Fix crashes while profiling invalid calls. (GH-8300)
jdemeyer [Sat, 21 Jul 2018 08:30:59 +0000 (10:30 +0200)]
bpo-34126: Fix crashes while profiling invalid calls. (GH-8300)

6 years agobpo-34166: Fix warnings in Tools/msgfmt.py. (GH-8367)
Xtreak [Sat, 21 Jul 2018 06:22:12 +0000 (11:52 +0530)]
bpo-34166: Fix warnings in Tools/msgfmt.py. (GH-8367)

6 years agobpo-34136: Make test_do_not_recreate_annotations more reliable. (GH-8364)
Serhiy Storchaka [Sat, 21 Jul 2018 04:44:04 +0000 (07:44 +0300)]
bpo-34136: Make test_do_not_recreate_annotations more reliable. (GH-8364)

6 years agobpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged (GH-8361)
Victor Stinner [Sat, 21 Jul 2018 01:54:20 +0000 (03:54 +0200)]
bpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged (GH-8361)

* _PyCoreConfig_Read() no longer directly modifies Py_IsolatedFlag
  and Py_NoSiteFlag global configuration flags. The function now
  requires two pointers to integer, so these flags can be set later,
  to avoid side effets in _PyCoreConfig_Read().
* pathconfig_global_init() now leaves Py_IsolatedFlag and
  Py_NoSiteFlag unchanged.
* Fix pathconfig_global_init(): avoid computing the path
  configuration twice, use _PyCoreConfig_SetPathConfig().

6 years agoFix Windows compiler warning in tokenize.c (GH-8359)
Victor Stinner [Sat, 21 Jul 2018 01:36:06 +0000 (03:36 +0200)]
Fix Windows compiler warning in tokenize.c (GH-8359)

Fix the following warning on Windows:

parser\tokenizer.c(1297): warning C4244: 'function': conversion from
'__int64' to 'int', possible loss of data.

6 years agobpo-33723: Fix test_time.test_process_time() (GH-8358)
Victor Stinner [Sat, 21 Jul 2018 01:31:51 +0000 (03:31 +0200)]
bpo-33723: Fix test_time.test_process_time() (GH-8358)

The test failed on my laptop because the busy loop took 15.9 ms
whereas the test expects at least 20 ms. Modify test_process_time()
as test_thread_time() has been modified recently: only require 15 ms
instead of 20 ms.

6 years agobpo-34170: Rework _PyCoreConfig_Read() to avoid side effect (GH-8353)
Victor Stinner [Sat, 21 Jul 2018 00:06:16 +0000 (02:06 +0200)]
bpo-34170: Rework _PyCoreConfig_Read() to avoid side effect (GH-8353)

Rework _PyCoreConfig_Read() function which *reads* core configuration
to not *modify* the path configuration.

A new _PyCoreConfig_SetPathConfig() function now recreates the path
configuration from the core configuration. This function is now
called very late in _Py_InitializeCore(), just before calling
initimport().

Changes:

* Add _PyCoreConfig.dll_path
* Py_SetPath() now fails with a fatal python error on memory
   allocation failure.
* Rename _PyPathConfig_Calculate() to _PyPathConfig_Calculate_impl()
* Replace _PyPathConfig_Init() with _PyPathConfig_Calculate(): the
  function now requires a _PyPathConfig
* Add _PyPathConfig_SetGlobal() to set the _Py_path_config global
  variable.
* Add _PyCoreConfig_InitPathConfig(): compute the path configuration
* Add _PyCoreConfig_SetPathConfig(): set path configuration from core
  configuration
* Rename wstrlist_append() to _Py_wstrlist_append()
* _Py_wstrlist_append() now handles integer overflow.

6 years agobpo-34011: Update code copying DLLs and init.tcl into venvs. (GH-8253)
Vinay Sajip [Fri, 20 Jul 2018 16:07:38 +0000 (17:07 +0100)]
bpo-34011: Update code copying DLLs and init.tcl into venvs. (GH-8253)

6 years agoRemove extra parentheses in output formatting tutorial (GH-8350)
Aaqa Ishtyaq [Fri, 20 Jul 2018 16:06:44 +0000 (21:36 +0530)]
Remove extra parentheses in output formatting tutorial (GH-8350)

The parentheses were incorrect.

6 years agobpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)
Victor Stinner [Fri, 20 Jul 2018 15:34:23 +0000 (17:34 +0200)]
bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)

Py_Main() can again be called after Py_Initialize(), as in Python
3.6. The new configuration is ignored, except of
_PyMainInterpreterConfig.argv which is used to update sys.argv.

6 years agobpo-34162: idlelib/NEWS.txt entries to 2018-7-20 (GH-8345)
Terry Jan Reedy [Fri, 20 Jul 2018 06:14:56 +0000 (02:14 -0400)]
bpo-34162: idlelib/NEWS.txt entries to 2018-7-20 (GH-8345)

6 years agobpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. (GH...
ValeriyaSinevich [Thu, 19 Jul 2018 22:34:03 +0000 (15:34 -0700)]
bpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. (GH-7911)

6 years agobpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)
Victor Stinner [Thu, 19 Jul 2018 08:49:58 +0000 (10:49 +0200)]
bpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)

Increase the timeout: give timeout x 4 instead of timeout x 2 to
threads to wait until the Event is set, but reduce the sleep from 500
ms to 250 ms. So the test should be more reliable and faster!

6 years agobpo-34130: Fix test_signal.test_warn_on_full_buffer() (GH-8327)
Victor Stinner [Wed, 18 Jul 2018 16:29:54 +0000 (18:29 +0200)]
bpo-34130: Fix test_signal.test_warn_on_full_buffer() (GH-8327)

On Windows, sometimes test_signal.test_warn_on_full_buffer() fails to
fill the socketpair buffer. In that case, the C signal handler
succeed to write into the socket, it doesn't log the expected send
error, and so the test fail.

On Windows, the test now uses a timeout of 50 ms to fill the
socketpair buffer to fix this race condition.

Other changes:

* Begin with large chunk size to fill the buffer to speed up the
  test.
* Add error messages to assertion errors to more easily identify
  which assertion failed.
* Don't set the read end of the socketpair as non-blocking.

6 years agobpo-34130: Fix test_signal.test_socket() (GH-8326)
Victor Stinner [Wed, 18 Jul 2018 15:43:57 +0000 (17:43 +0200)]
bpo-34130: Fix test_signal.test_socket() (GH-8326)

test_signal.test_socket(): On Windows, sometimes even if the C signal handler
succeed to write the signal number into the write end of the socketpair, the
test fails with a BlockingIOError on the non-blocking read.recv(1) because the
read end of the socketpair didn't receive the byte yet.

Fix the race condition on Windows by setting the read end as blocking.

6 years agobpo-34141: Optimized pickling simple non-recursive values. (GH-8318)
Serhiy Storchaka [Wed, 18 Jul 2018 07:10:49 +0000 (10:10 +0300)]
bpo-34141: Optimized pickling simple non-recursive values. (GH-8318)

6 years agoClarify ValueError's broad applicability (GH-8313)
Raymond Hettinger [Tue, 17 Jul 2018 15:35:26 +0000 (08:35 -0700)]
Clarify ValueError's broad applicability (GH-8313)

6 years agobpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an exception...
Zackery Spytz [Tue, 17 Jul 2018 06:31:44 +0000 (00:31 -0600)]
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an exception set (GH-8282)

6 years agobpo-33967: Fix wrong use of assertRaises (GH-8306)
INADA Naoki [Tue, 17 Jul 2018 04:44:47 +0000 (13:44 +0900)]
bpo-33967: Fix wrong use of assertRaises (GH-8306)

6 years agobpo-34123: Fix missed documentation update for dict.popitem(). (GH-8292)
Raymond Hettinger [Tue, 17 Jul 2018 00:20:15 +0000 (17:20 -0700)]
bpo-34123: Fix missed documentation update for dict.popitem(). (GH-8292)

6 years agobpo-34124: Fix markup of message_from_binary_file() signature (GH-8297)
Jon Ribbens [Mon, 16 Jul 2018 17:19:42 +0000 (18:19 +0100)]
bpo-34124: Fix markup of message_from_binary_file() signature (GH-8297)

6 years agobpo-32430: Rename Modules/Setup.dist to Modules/Setup (GH-8229)
Antoine Pitrou [Mon, 16 Jul 2018 17:03:03 +0000 (19:03 +0200)]
bpo-32430: Rename Modules/Setup.dist to Modules/Setup (GH-8229)

bpo-32430: Rename Modules/Setup.dist to Modules/Setup

Remove the necessity to copy the former manually to the latter when updating the local source tree.

6 years agobpo-33911: Fixed deprecation warning in xmlrpc.server (GH-7847)
Nicolas Noé [Mon, 16 Jul 2018 08:46:04 +0000 (10:46 +0200)]
bpo-33911: Fixed deprecation warning in xmlrpc.server (GH-7847)

Replace deprecated inspect.getfullargspec() with inspect.signature().