]> granicus.if.org Git - python/log
python
7 years agobpo-28684: Remove useless import added by the previous commit (GH-4547)
xdegaye [Fri, 24 Nov 2017 17:56:22 +0000 (18:56 +0100)]
bpo-28684: Remove useless import added by the previous commit (GH-4547)

7 years agoImprove the String tutorial docs (GH-4541)
Will White [Fri, 24 Nov 2017 17:28:12 +0000 (17:28 +0000)]
Improve the String tutorial docs (GH-4541)

The paragraph that contains example of string literal concatenation was placed
after the section about concatenation using the '+' sign.
Moved the paragraph to the appropriate section.

7 years agobpo-28684: asyncio tests handle PermissionError raised on binding unix sockets (GH...
xdegaye [Fri, 24 Nov 2017 16:35:55 +0000 (17:35 +0100)]
bpo-28684: asyncio tests handle PermissionError raised on binding unix sockets (GH-4503)

The test.support.skip_unless_bind_unix_socket() decorator is used to skip
asyncio tests that fail because the platform lacks a functional bind()
function for unix domain sockets (as it is the case for non root users on the
recent Android versions that run now SELinux in enforcing mode).

7 years agobpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539)
Berker Peksag [Fri, 24 Nov 2017 15:11:18 +0000 (18:11 +0300)]
bpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539)

The previous behavior was to raise an exception

    NotImplementedError: result of type 0

when the value of the property is VT_EMPTY.

7 years agobpo-32096: Remove obj and mem from _PyRuntime (#4532)
Victor Stinner [Fri, 24 Nov 2017 11:09:24 +0000 (12:09 +0100)]
bpo-32096: Remove obj and mem from _PyRuntime (#4532)

bpo-32096, bpo-30860:  Partially revert the commit
2ebc5ce42a8a9e047e790aefbf9a94811569b2b6:

* Move structures back from Include/internal/mem.h to
  Objects/obmalloc.c
* Remove _PyObject_Initialize() and _PyMem_Initialize()
* Remove Include/internal/pymalloc.h
* Add test_capi.test_pre_initialization_api():
   Make sure that it's possible to call Py_DecodeLocale(), and then call
   Py_SetProgramName() with the decoded string, before Py_Initialize().

PyMem_RawMalloc() and Py_DecodeLocale() can be called again before
_PyRuntimeState_Init().

Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
7 years agobpo-12382: Make OpenDatabase() raise better exception messages (GH-4528)
Berker Peksag [Fri, 24 Nov 2017 09:53:58 +0000 (12:53 +0300)]
bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528)

Previously, 'msilib.OpenDatabase()' function raised a
cryptical exception message when it couldn't open or
create an MSI file. For example:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    _msi.MSIError: unknown error 6e

7 years agoExtending Python Doc minor updates (GH-4518)
Emanuele Gaifas [Fri, 24 Nov 2017 08:49:57 +0000 (09:49 +0100)]
Extending Python Doc minor updates  (GH-4518)

Move footnote markers to be closer to the related terminology:
before the end of the sentence, instead of after.

7 years agobpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529)
Berker Peksag [Thu, 23 Nov 2017 23:40:26 +0000 (02:40 +0300)]
bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529)

7 years agobpo-32099 Add deque variant of roundrobin() recipe (#4497)
Raymond Hettinger [Thu, 23 Nov 2017 21:32:23 +0000 (13:32 -0800)]
bpo-32099 Add deque variant of roundrobin() recipe (#4497)

* Minor wording tweaks

7 years agobpo-19610: setup() now raises TypeError for invalid types (GH-4519)
Berker Peksag [Thu, 23 Nov 2017 18:34:20 +0000 (21:34 +0300)]
bpo-19610: setup() now raises TypeError for invalid types (GH-4519)

The Distribution class now explicitly raises an
exception when 'classifiers', 'keywords' and
'platforms' fields are not specified as a list.

7 years agobpo-31979: Remove unused align_maxchar() function (#4527)
Victor Stinner [Thu, 23 Nov 2017 18:02:23 +0000 (19:02 +0100)]
bpo-31979: Remove unused align_maxchar() function (#4527)

7 years agobpo-32030: Fix calculate_path() on macOS (#4526)
Victor Stinner [Thu, 23 Nov 2017 18:02:04 +0000 (19:02 +0100)]
bpo-32030: Fix calculate_path() on macOS (#4526)

7 years agobpo-27535: Cleanup create_filter() (#4516)
Victor Stinner [Thu, 23 Nov 2017 16:13:44 +0000 (17:13 +0100)]
bpo-27535: Cleanup create_filter() (#4516)

create_filter() now expects the action as a _Py_Identifier which
avoids string comparison, and more important, to avoid handling the
"unknown action" annoying case.

7 years agobpo-32030: Rewrite calculate_path() (#4521)
Victor Stinner [Thu, 23 Nov 2017 16:03:20 +0000 (17:03 +0100)]
bpo-32030: Rewrite calculate_path() (#4521)

* calculate_path() rewritten in Modules/getpath.c and PC/getpathp.c
* Move global variables into a new PyPathConfig structure.
* calculate_path():

  * Split the huge calculate_path() function into subfunctions.
  * Add PyCalculatePath structure to pass data between subfunctions.
  * Document PyCalculatePath fields.
  * Move cleanup code into a new calculate_free() subfunction
  * calculate_init() now handles Py_DecodeLocale() failures properly
  * calculate_path() is now atomic: only replace PyPathConfig
    (path_config) at once on success.

* _Py_GetPythonHomeWithConfig() now returns an error on failure
* Add _Py_INIT_NO_MEMORY() helper: report a memory allocation failure
* Coding style fixes (PEP 7)

7 years agobpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
Berker Peksag [Thu, 23 Nov 2017 12:47:30 +0000 (15:47 +0300)]
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)

7 years agobpo-28762: Revert last commit (now using Android Unified Headers) (GH-4488)
xdegaye [Thu, 23 Nov 2017 11:01:36 +0000 (12:01 +0100)]
bpo-28762: Revert last commit (now using Android Unified Headers) (GH-4488)

7 years agobpo-29040: Support building Android with Unified Headers (GH-4492)
xdegaye [Thu, 23 Nov 2017 10:44:38 +0000 (11:44 +0100)]
bpo-29040: Support building Android with Unified Headers (GH-4492)

7 years agobpo-28538: Revert all the changes (now using Android Unified Headers) (GH-4479)
xdegaye [Thu, 23 Nov 2017 10:13:22 +0000 (11:13 +0100)]
bpo-28538: Revert all the changes (now using Android Unified Headers) (GH-4479)

7 years agobpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513)
Victor Stinner [Thu, 23 Nov 2017 09:43:14 +0000 (10:43 +0100)]
bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513)

* Py_Main() now reads the PYTHONHOME environment variable
* Add _Py_GetPythonHomeWithConfig() private function
* Add _PyWarnings_InitWithConfig()
* init_filters() doesn't get the current core configuration from the
  current interpreter or Python thread anymore. Pass explicitly the
  configuration to _PyWarnings_InitWithConfig().
* _Py_InitializeCore() now fails on _PyWarnings_InitWithConfig()
  failure.
* Pass configuration as constant

7 years agobpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)
Victor Stinner [Thu, 23 Nov 2017 00:49:45 +0000 (01:49 +0100)]
bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)

Move _PyCoreConfig.module_search_path_env to _PyMainInterpreterConfig
structure.

7 years agobpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Jesse-Bakker [Thu, 23 Nov 2017 00:23:28 +0000 (01:23 +0100)]
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)

Adds a simpler and faster alternative to ExitStack for handling
single optional context managers without having to change the
lexical structure of your code.

7 years agobpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484)
Cheryl Sabella [Thu, 23 Nov 2017 00:05:25 +0000 (19:05 -0500)]
bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484)

Patch mostly by Cheryl Sabella

7 years agobpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)
Victor Stinner [Wed, 22 Nov 2017 23:12:09 +0000 (00:12 +0100)]
bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)

Changes:

* Py_Main() initializes _PyCoreConfig.module_search_path_env from
  the PYTHONPATH environment variable.
* PyInterpreterState_New() now initializes core_config and config
  fields
* Compute sys.path a little bit ealier in
  _Py_InitializeMainInterpreter() and new_interpreter()
* Add _Py_GetPathWithConfig() private function.

7 years agobpo-27535: Optimize warnings.warn() (#4508)
Victor Stinner [Wed, 22 Nov 2017 22:51:42 +0000 (23:51 +0100)]
bpo-27535: Optimize warnings.warn() (#4508)

* Optimize warnings.filterwarnings(). Replace re.compile('') with
  None to avoid the cost of calling a regex.match() method, whereas
  it always matchs.
* Optimize get_warnings_attr(): replace PyObject_GetAttrString() with
  _PyObject_GetAttrId().

Cleanup also create_filter():

* Use _Py_IDENTIFIER() to allow to cleanup strings at Python
  finalization
* Replace Py_FatalError() with a regular exceptions

7 years agobpo-31324: Fix test.support.set_match_tests(None) (#4505)
Victor Stinner [Wed, 22 Nov 2017 19:58:59 +0000 (20:58 +0100)]
bpo-31324: Fix test.support.set_match_tests(None) (#4505)

7 years agobpo-31324: Optimize support._match_test() (#4421)
Victor Stinner [Tue, 21 Nov 2017 23:34:02 +0000 (15:34 -0800)]
bpo-31324: Optimize support._match_test() (#4421)

* Rename support._match_test() to support.match_test(): make it
  public
* Remove support.match_tests global variable. It is replaced with a
  new support.set_match_tests() function, so match_test() doesn't
  have to check each time if patterns were modified.
* Rewrite match_test(): use different code paths depending on the
  kind of patterns for best performances.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-32105: add asyncio.BaseEventLoop.connect_accepted_socket versionadded to document...
AraHaan [Tue, 21 Nov 2017 16:06:26 +0000 (11:06 -0500)]
bpo-32105: add asyncio.BaseEventLoop.connect_accepted_socket versionadded to documentation. (#4491)

7 years agobpo-31672 - Add one last minor clarification for idpattern (#4483)
Barry Warsaw [Tue, 21 Nov 2017 15:28:13 +0000 (10:28 -0500)]
bpo-31672 - Add one last minor clarification for idpattern (#4483)

Add one last minor clarification for idpattern

7 years agoAdd comment and improve variable name in roundrobin() (#4486)
Raymond Hettinger [Tue, 21 Nov 2017 08:23:34 +0000 (00:23 -0800)]
Add comment and improve variable name in roundrobin() (#4486)

7 years agobpo-32043: Rephrase -X dev documentation (#4478)
Victor Stinner [Tue, 21 Nov 2017 02:59:50 +0000 (18:59 -0800)]
bpo-32043: Rephrase -X dev documentation (#4478)

* should not be more verbose if the code is correct
* enabled checks can be "expensive"

7 years agobpo-32030: Add more options to _PyCoreConfig (#4485)
Victor Stinner [Tue, 21 Nov 2017 02:12:22 +0000 (18:12 -0800)]
bpo-32030: Add more options to _PyCoreConfig (#4485)

Py_Main() now handles two more -X options:

* -X showrefcount: new _PyCoreConfig.show_ref_count field
* -X showalloccount: new _PyCoreConfig.show_alloc_count field

7 years agobpo-32089: Fix warnings filters in dev mode (#4482)
Victor Stinner [Tue, 21 Nov 2017 01:32:40 +0000 (17:32 -0800)]
bpo-32089: Fix warnings filters in dev mode (#4482)

The developer mode (-X dev) now creates all default warnings filters
to order filters in the correct order to always show ResourceWarning
and make BytesWarning depend on the -b option.

Write a functional test to make sure that ResourceWarning is logged
twice at the same location in the developer mode.

Add a new 'dev_mode' field to _PyCoreConfig.

7 years agobpo-32094: Update subprocess for -X dev (#4480)
Victor Stinner [Mon, 20 Nov 2017 23:24:56 +0000 (15:24 -0800)]
bpo-32094: Update subprocess for -X dev (#4480)

Modify subprocess._args_from_interpreter_flags() to handle -X dev
option.

Add also unit tests for test.support.args_from_interpreter_flags()
and test.support.optim_args_from_interpreter_flags().

7 years agobpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optiona...
Yury Selivanov [Mon, 20 Nov 2017 22:26:28 +0000 (17:26 -0500)]
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optional (#4447)

7 years agobpo-32088: Display Deprecation in debug mode (#4474)
Victor Stinner [Mon, 20 Nov 2017 17:47:03 +0000 (09:47 -0800)]
bpo-32088: Display Deprecation in debug mode (#4474)

When Python is build is debug mode (Py_DEBUG), DeprecationWarning,
PendingDeprecationWarning and ImportWarning warnings are now
displayed by default.

test_venv: run "-m pip" and "-m ensurepip._uninstall" with -W
ignore::DeprecationWarning since pip code is not part of Python.

7 years agobpo-32050: Fix -x option documentation (#4475)
Victor Stinner [Mon, 20 Nov 2017 16:08:03 +0000 (08:08 -0800)]
bpo-32050: Fix -x option documentation (#4475)

The line number in correct when using the -x option: Py_Main() uses
ungetc() to not skip the first newline character.

7 years agobpo-32047: -X dev enables asyncio debug mode (#4418)
Victor Stinner [Mon, 20 Nov 2017 15:14:07 +0000 (07:14 -0800)]
bpo-32047: -X dev enables asyncio debug mode (#4418)

The new -X dev command line option now also enables asyncio debug
mode.

7 years agoRemove duplicated import from datetime tests (#4444)
Riccardo Magliocchetti [Mon, 20 Nov 2017 08:48:56 +0000 (09:48 +0100)]
Remove duplicated import from datetime tests (#4444)

7 years agobpo-30904: Removed duplicated Host: header. (#4465)
Vinay Sajip [Sun, 19 Nov 2017 18:36:17 +0000 (18:36 +0000)]
bpo-30904: Removed duplicated Host: header. (#4465)

7 years agoRemove outdated .pyo reference from msilib docs (GH-4461)
Berker Peksag [Sun, 19 Nov 2017 10:04:25 +0000 (13:04 +0300)]
Remove outdated .pyo reference from msilib docs (GH-4461)

Since f299abdafa0f2b6eb7abae274861b19b361c96bc
the remove_pyc() method no longer tries to
remove .pyo files.

7 years agoDocument parameters of BaseServer.finish_request() (GH-4445)
Masayuki Yamamoto [Sun, 19 Nov 2017 07:33:37 +0000 (16:33 +0900)]
Document parameters of BaseServer.finish_request() (GH-4445)

7 years ago[Doc] Update opcode for var-positional arguments (#4446)
Moses Koledoye [Sat, 18 Nov 2017 22:49:15 +0000 (23:49 +0100)]
[Doc] Update opcode for var-positional arguments (#4446)

`BUILD_MAP_UNPACK_WITH_CALL` was duplicated as the opcode for both var-positional and var-keyword arguments. The opcode for the former was updated as `BUILD_TUPLE_UNPACK_WITH_CALL`.

7 years agobpo-32031: Fix pydoc `test_mixed_case_module_names_are_lower_cased` (GH-4441)
xdegaye [Sat, 18 Nov 2017 17:20:21 +0000 (18:20 +0100)]
bpo-32031: Fix pydoc `test_mixed_case_module_names_are_lower_cased` (GH-4441)

When there is a symlink in the directory path of the standard library.

7 years agobpo-29185: Fix `test_distutils` failures on Android (GH-4438)
xdegaye [Sat, 18 Nov 2017 17:17:16 +0000 (18:17 +0100)]
bpo-29185: Fix `test_distutils` failures on Android (GH-4438)

* Run gzip with separate command line options (Android understands  '-f9' as the name of a file).
* Creation of a hard link is controled by SELinux on Android.

7 years agobpo-29184: Skip test_socketserver tests on PermissionError raised by Android (GH...
xdegaye [Sat, 18 Nov 2017 17:10:53 +0000 (18:10 +0100)]
bpo-29184: Skip test_socketserver tests on PermissionError raised by Android (GH-4387)

7 years agobpo-32069: Drop legacy SSL transport (#4451)
Andrew Svetlov [Sat, 18 Nov 2017 16:54:05 +0000 (18:54 +0200)]
bpo-32069: Drop legacy SSL transport (#4451)

* Drop legacy SSL transport

* Drop unused import

* Fix Windows tests

* Drop never executed on Python 3.4+ code

7 years agobpo-31867: Remove duplicates in default mimetypes. (#4388)
Henk-Jaap Wagenaar [Fri, 17 Nov 2017 10:10:19 +0000 (10:10 +0000)]
bpo-31867: Remove duplicates in default mimetypes. (#4388)

7 years agotokenizer: Remove unused tabs options (#4422)
Victor Stinner [Fri, 17 Nov 2017 09:25:47 +0000 (01:25 -0800)]
tokenizer: Remove unused tabs options (#4422)

Remove the following fields from tok_state structure which are now
used unused:

* altwarning: "Issue warning if alternate tabs don't match"
* alterror: "Issue error if alternate tabs don't match"
* alttabsize: "Alternate tab spacing"

Replace alttabsize variable with ALTTABSIZE define.

7 years agobpo-31691: Specify where to find build instructions for the Windows installer (#4426)
native-api [Thu, 16 Nov 2017 23:56:27 +0000 (02:56 +0300)]
bpo-31691: Specify where to find build instructions for the Windows installer (#4426)

7 years agoFix typo in atexit documentation. (GH-4419)
Erik Bray [Thu, 16 Nov 2017 16:48:52 +0000 (17:48 +0100)]
Fix typo in atexit documentation. (GH-4419)

`kargs` -> `kwargs`

7 years agobpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)
Serhiy Storchaka [Thu, 16 Nov 2017 11:22:51 +0000 (13:22 +0200)]
bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)

The log_rounds parameter for Blowfish has been replaced with the rounds parameter.

7 years agobpo-32043: New "developer mode": "-X dev" option (#4413)
Victor Stinner [Thu, 16 Nov 2017 11:20:31 +0000 (03:20 -0800)]
bpo-32043: New "developer mode": "-X dev" option (#4413)

Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.

Changes:

* Add unit tests for -X dev
* test_cmd_line: replace test.support with support.
* Fix _PyRuntimeState_Fini(): Use the same memory allocator
   than _PyRuntimeState_Init().
* Fix _PyMem_GetDefaultRawAllocator()

7 years agobpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
Serhiy Storchaka [Thu, 16 Nov 2017 10:38:26 +0000 (12:38 +0200)]
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)

in regular expressions.

7 years agobpo-32037: Use the INT opcode for 32-bit integers in protocol 0 pickles. (#4407)
Serhiy Storchaka [Thu, 16 Nov 2017 07:44:43 +0000 (09:44 +0200)]
bpo-32037: Use the INT opcode for 32-bit integers in protocol 0 pickles. (#4407)

7 years agobpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262)
Serhiy Storchaka [Thu, 16 Nov 2017 07:16:24 +0000 (09:16 +0200)]
bpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262)

from collections.abc rather than collections.

7 years agobpo-32030: Enhance Py_Main() (#4412)
Victor Stinner [Thu, 16 Nov 2017 02:11:45 +0000 (18:11 -0800)]
bpo-32030: Enhance Py_Main() (#4412)

Parse more env vars in Py_Main():

* Add more options to _PyCoreConfig:

  * faulthandler
  * tracemalloc
  * importtime

* Move code to parse environment variables from _Py_InitializeCore()
  to Py_Main(). This change fixes a regression from Python 3.6:
  PYTHONUNBUFFERED is now read before calling pymain_init_stdio().
* _PyFaulthandler_Init() and _PyTraceMalloc_Init() now take an
  argument to decide if the module has to be enabled at startup.
* tracemalloc_start() is now responsible to check the maximum number
  of frames.

Other changes:

* Cleanup Py_Main():

  * Rename some pymain_xxx() subfunctions
  * Add pymain_run_python() subfunction

* Cleanup Py_NewInterpreter()
* _PyInterpreterState_Enable() now reports failure
* init_hash_secret() now considers pyurandom() failure as an "user
  error": don't fail with abort().
* pymain_optlist_append() and pymain_strdup() now sets err on memory
  allocation failure.

7 years agobpo-32030: Split Py_Main() into subfunctions (#4399)
Victor Stinner [Wed, 15 Nov 2017 23:48:08 +0000 (15:48 -0800)]
bpo-32030: Split Py_Main() into subfunctions (#4399)

* Don't use "Python runtime" anymore to parse command line options or
  to get environment variables: pymain_init() is now a strict
  separation.
* Use an error message rather than "crashing" directly with
  Py_FatalError(). Limit the number of calls to Py_FatalError(). It
  prepares the code to handle errors more nicely later.
* Warnings options (-W, PYTHONWARNINGS) and "XOptions" (-X) are now
  only added to the sys module once Python core is properly
  initialized.
* _PyMain is now the well identified owner of some important strings
  like: warnings options, XOptions, and the "program name". The
  program name string is now properly freed at exit.
  pymain_free() is now responsible to free the "command" string.
* Rename most methods in Modules/main.c to use a "pymain_" prefix to
  avoid conflits and ease debug.
* Replace _Py_CommandLineDetails_INIT with memset(0)
* Reorder a lot of code to fix the initialization ordering. For
  example, initializing standard streams now comes before parsing
  PYTHONWARNINGS.
* Py_Main() now handles errors when adding warnings options and
  XOptions.
* Add _PyMem_GetDefaultRawAllocator() private function.
* Cleanup _PyMem_Initialize(): remove useless global constants: move
  them into _PyMem_Initialize().
* Call _PyRuntime_Initialize() as soon as possible:
  _PyRuntime_Initialize() now returns an error message on failure.
* Add _PyInitError structure and following macros:

  * _Py_INIT_OK()
  * _Py_INIT_ERR(msg)
  * _Py_INIT_USER_ERR(msg): "user" error, don't abort() in that case
  * _Py_INIT_FAILED(err)

7 years agobpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409
Yury Selivanov [Wed, 15 Nov 2017 22:14:28 +0000 (17:14 -0500)]
bpo-32034: Make IncompleteReadError & LimitOverrunError pickleable #4409

7 years agobpo-32025: Add time.thread_time() (#4410)
Antoine Pitrou [Wed, 15 Nov 2017 21:52:21 +0000 (22:52 +0100)]
bpo-32025: Add time.thread_time() (#4410)

* bpo-32025: Add time.thread_time()

* Add missing #endif

* Add NEWS blurb

* Add docs and whatsnew

* Address review comments

* Review comments

7 years agobpo-32018: Fix inspect.signature repr to follow PEP 8 (#4408)
Dong-hee Na [Wed, 15 Nov 2017 18:30:59 +0000 (03:30 +0900)]
bpo-32018: Fix inspect.signature repr to follow PEP 8 (#4408)

7 years agobpo-30399: Get rid of trailing comma in the repr of BaseException. (#1650)
Serhiy Storchaka [Wed, 15 Nov 2017 15:53:28 +0000 (17:53 +0200)]
bpo-30399: Get rid of trailing comma in the repr of BaseException. (#1650)

7 years agobpo-30950: Convert round() to Argument Clinic. (#2740)
Serhiy Storchaka [Wed, 15 Nov 2017 15:51:14 +0000 (17:51 +0200)]
bpo-30950: Convert round() to Argument Clinic. (#2740)

7 years agobpo-32011: Revert "Issue #15480: Remove the deprecated and unused TYPE_INT64 code...
Serhiy Storchaka [Wed, 15 Nov 2017 15:41:05 +0000 (17:41 +0200)]
bpo-32011: Revert "Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal." (#4381)

Simplify the reverted code.

This reverts commit e9bbe8b87ba2874efba0474af5cc7d5941dbf742.

7 years agobpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)
Serhiy Storchaka [Wed, 15 Nov 2017 15:39:37 +0000 (17:39 +0200)]
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)

7 years agobpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (#4289)
Serhiy Storchaka [Wed, 15 Nov 2017 15:38:52 +0000 (17:38 +0200)]
bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (#4289)

* Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks.
* Setting sys.tracebacklimit to None now causes using the default limit.
* Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using
  the limit LONG_MAX rather than the default limit.
* Fixed integer overflows in the case of more than 2**31 traceback items on
  Windows.
* Fixed output errors handling.

7 years agobpo-32032: Test both implementations of module-level pickle API. (#4401)
Serhiy Storchaka [Wed, 15 Nov 2017 12:01:08 +0000 (14:01 +0200)]
bpo-32032: Test both implementations of module-level pickle API. (#4401)

7 years agoChanged lambda to str.strip in _strip_spaces in logging.config (#4332)
sanjayp [Wed, 15 Nov 2017 09:28:11 +0000 (14:58 +0530)]
Changed lambda to str.strip in _strip_spaces in logging.config (#4332)

7 years agobpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382)
Serhiy Storchaka [Wed, 15 Nov 2017 06:49:40 +0000 (08:49 +0200)]
bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382)

7 years agobpo-31948: Fix broken links in msilib docs (GH-4397)
Jesse-Bakker [Tue, 14 Nov 2017 23:06:15 +0000 (00:06 +0100)]
bpo-31948: Fix broken links in msilib docs (GH-4397)

7 years agobpo-15606: Improve the re.VERBOSE documentation. (#4366)
Serhiy Storchaka [Tue, 14 Nov 2017 15:21:26 +0000 (17:21 +0200)]
bpo-15606: Improve the re.VERBOSE documentation. (#4366)

7 years agobpo-32015: Asyncio looping during simultaneously socket read/write an… (#4386)
Andrey Egorov [Tue, 14 Nov 2017 09:18:59 +0000 (12:18 +0300)]
bpo-32015: Asyncio looping during simultaneously socket read/write an… (#4386)

* bpo-32015: Asyncio cycling during simultaneously socket read/write and reconnection

* Tests fix

* Tests fix

* News add

* Add new unit tests

7 years agobpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array(...
Mat M [Tue, 14 Nov 2017 06:00:54 +0000 (01:00 -0500)]
bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (#4391)

7 years agobpo-16055: Fixes incorrect error text for int('1', base=1000) (#4376)
Sanyam Khurana [Mon, 13 Nov 2017 21:49:26 +0000 (03:19 +0530)]
bpo-16055: Fixes incorrect error text for int('1', base=1000) (#4376)

* bpo-16055: Fixes incorrect error text for int('1', base=1000)

* bpo-16055: Address review comments

7 years agobpo-31979: Simplify transforming decimals to ASCII (#4336)
Serhiy Storchaka [Mon, 13 Nov 2017 19:23:48 +0000 (21:23 +0200)]
bpo-31979: Simplify transforming decimals to ASCII (#4336)

in int(), float() and complex() parsers.

This also speeds up parsing non-ASCII numbers by around 20%.

7 years agobpo-28369: Enhance transport socket check in add_reader/writer (#4365)
Yury Selivanov [Mon, 13 Nov 2017 18:38:22 +0000 (13:38 -0500)]
bpo-28369: Enhance transport socket check in add_reader/writer (#4365)

7 years agobpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (#4384)
Mat M [Mon, 13 Nov 2017 07:50:16 +0000 (02:50 -0500)]
bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (#4384)

7 years agoremove detect_math_libs (#4383)
Benjamin Peterson [Mon, 13 Nov 2017 04:53:39 +0000 (20:53 -0800)]
remove detect_math_libs (#4383)

Darwin may not require libm, but it doesn't hurt to link it and simplifies configuration logic.

7 years agobpo-29181: Skip test_tarfile tests on PermissionError raised by Android (GH-4375)
xdegaye [Sun, 12 Nov 2017 17:02:06 +0000 (18:02 +0100)]
bpo-29181: Skip test_tarfile tests on PermissionError raised by Android (GH-4375)

7 years agobpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374)
xdegaye [Sun, 12 Nov 2017 16:57:04 +0000 (17:57 +0100)]
bpo-29180: Skip test_os tests on PermissionError raised by Android (GH-4374)

7 years agobpo-28759: Skip some tests on PermissionError raised by Android (GH-4350)
xdegaye [Sun, 12 Nov 2017 16:31:07 +0000 (17:31 +0100)]
bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350)

Access to mkfifo(), mknod() and hard link creation is controled
by SELinux on Android.
Also remove test.support.android_not_root.

7 years agobpo-30696: Fix the REPL looping endlessly when no memory (GH-4160)
xdegaye [Sun, 12 Nov 2017 15:50:48 +0000 (16:50 +0100)]
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160)

7 years agobpo-28180: Fix the implementation of PEP 538 on Android (GH-4334)
xdegaye [Sun, 12 Nov 2017 11:45:59 +0000 (12:45 +0100)]
bpo-28180: Fix the implementation of PEP 538 on Android (GH-4334)

7 years agoMove comments in configure.ac to more appropriate place. (#4371)
Serhiy Storchaka [Sat, 11 Nov 2017 17:18:28 +0000 (19:18 +0200)]
Move comments in configure.ac to more appropriate place. (#4371)

7 years agoThe termios man page is in section 3 (GH-2450)
Edward Betts [Sat, 11 Nov 2017 16:40:26 +0000 (16:40 +0000)]
The termios man page is in section 3 (GH-2450)

7 years agoRemove redundant 'exc = True' line (GH-4357)
Berker Peksag [Sat, 11 Nov 2017 14:55:05 +0000 (17:55 +0300)]
Remove redundant 'exc = True' line (GH-4357)

It can be removed after https://github.com/python/peps/commit/c28890fb421c906241da6da718f9eacc5a3109ee

7 years agobpo-31572: Get rid of _PyObject_HasAttrId() in the ASDL parser. (#3725)
Serhiy Storchaka [Sat, 11 Nov 2017 14:41:32 +0000 (16:41 +0200)]
bpo-31572: Get rid of _PyObject_HasAttrId() in the ASDL parser. (#3725)

Silence only expected AttributeError.

7 years agobpo-31572: Get rid of _PyObject_HasAttrId() in dict and OrderedDict. (#3728)
Serhiy Storchaka [Sat, 11 Nov 2017 14:19:56 +0000 (16:19 +0200)]
bpo-31572: Get rid of _PyObject_HasAttrId() in dict and OrderedDict. (#3728)

Silence only AttributeError when get "key" and "items" attributes in
the constructor and the update() method of dict and OrderedDict .

7 years agobpo-31572: Silence only AttributeError when get the __copy__ attribute in itertools...
Serhiy Storchaka [Sat, 11 Nov 2017 13:51:42 +0000 (15:51 +0200)]
bpo-31572: Silence only AttributeError when get the __copy__ attribute in itertools.tee(). (#3724)

7 years agobpo-31572: Don't silence unexpected errors in the _warnings module. (#3731)
Serhiy Storchaka [Sat, 11 Nov 2017 13:19:47 +0000 (15:19 +0200)]
bpo-31572: Don't silence unexpected errors in the _warnings module. (#3731)

Get rid of _PyObject_HasAttrId() and PyDict_GetItemString().
Silence only expected AttributeError, KeyError and ImportError when
get an attribute, look up in a dict or import a module.

7 years agoAdd the const qualifier to "char *" variables that refer to literal strings. (#4370)
Serhiy Storchaka [Sat, 11 Nov 2017 11:06:26 +0000 (13:06 +0200)]
Add the const qualifier to "char *" variables that refer to literal strings. (#4370)

7 years agobpo-31824: Document default value of 'errors' parameters (GH-4328)
Pablo Galindo [Fri, 10 Nov 2017 23:05:12 +0000 (23:05 +0000)]
bpo-31824: Document default value of 'errors' parameters (GH-4328)

7 years agobpo-31976: Fix race condition when flushing a file is slow. (#4331)
benfogle [Fri, 10 Nov 2017 21:03:40 +0000 (16:03 -0500)]
bpo-31976: Fix race condition when flushing a file is slow. (#4331)

7 years agoRewrite asyncio test to be more meaningful (#4363)
Yury Selivanov [Fri, 10 Nov 2017 20:34:17 +0000 (15:34 -0500)]
Rewrite asyncio test to be more meaningful (#4363)

7 years agobpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)
Brian Curtin [Fri, 10 Nov 2017 16:38:25 +0000 (11:38 -0500)]
bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)

The openfp functions of aifp, sunau, and wave had pointed to the open
function of each module since 1993 as a matter of backwards
compatibility. In the case of aifc.openfp, it was both undocumented
and untested. This change begins the formal deprecation of those
openfp functions, with their removal coming in 3.9.

This additionally adds a TODO in test_pyclbr around using aifc.openfp,
though it shouldn't be changed until removal in 3.9.

7 years agobpo-31999: Fix test_venv in case the zlib module is not available. (#4359)
Serhiy Storchaka [Fri, 10 Nov 2017 10:09:39 +0000 (12:09 +0200)]
bpo-31999: Fix test_venv in case the zlib module is not available. (#4359)

7 years agobpo-31998: Fix test_zipapp in case the zlib module is not available. (#4358)
Serhiy Storchaka [Fri, 10 Nov 2017 10:09:24 +0000 (12:09 +0200)]
bpo-31998: Fix test_zipapp in case the zlib module is not available. (#4358)

7 years agobpo-31222: Make (datetime|date|time).replace return subclass type in Pure Python...
Paul Ganssle [Thu, 9 Nov 2017 21:34:29 +0000 (16:34 -0500)]
bpo-31222: Make (datetime|date|time).replace return subclass type in Pure Python (#4176)

7 years agoFix phrasing in Doc/whatsnew/3.7.rst (GH-4318)
Cody Scott [Thu, 9 Nov 2017 18:58:59 +0000 (13:58 -0500)]
Fix phrasing in Doc/whatsnew/3.7.rst (GH-4318)

7 years agoCorrect the location of a function mentioned in a comment (GH-4327)
Ned Batchelder [Thu, 9 Nov 2017 16:55:34 +0000 (11:55 -0500)]
Correct the location of a function mentioned in a comment (GH-4327)

7 years agobpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (#4235)
Serhiy Storchaka [Thu, 9 Nov 2017 16:00:38 +0000 (18:00 +0200)]
bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (#4235)

* Fix compilation of the socket module on NetBSD 8.
* Fix the assertion failure or reading arbitrary data when parse
  a AF_BLUETOOTH address on NetBSD and DragonFly BSD.
* Fix other potential errors and make the code more reliable.