]> granicus.if.org Git - python/log
python
5 years agoRevert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295...
Pablo Galindo [Wed, 7 Nov 2018 23:55:40 +0000 (23:55 +0000)]
Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403)

This reverts commit c64583b6d3e8516a8cd2b5f84fc1e300bfac2206 due to multiple buildbot failures when building it.

5 years agoDoc: Make all versions sidebars the same for consistency. (GH-10288)
Julien Palard [Wed, 7 Nov 2018 23:11:49 +0000 (00:11 +0100)]
Doc: Make all versions sidebars the same for consistency. (GH-10288)

5 years agoFix the construction of subprocess.CalledProcessError in test_venv (GH-10400)
Pablo Galindo [Wed, 7 Nov 2018 22:21:17 +0000 (22:21 +0000)]
Fix the construction of subprocess.CalledProcessError in test_venv (GH-10400)

The constructor of subprocess.CalledProcessError in the check_output function had an extra None in it.

5 years agobpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360)
Julien Palard [Wed, 7 Nov 2018 21:42:40 +0000 (22:42 +0100)]
bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360)

5 years agobpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327)
Elvis Pranskevichus [Wed, 7 Nov 2018 18:34:59 +0000 (13:34 -0500)]
bpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327)

Current support for hash-based bytecode files in `zipimport` is rather
sparse, which leads to test failures when the test suite is ran with
the ``SOURCE_DATE_EPOCH`` environment variable set.

This teaches zipimport to handle hash-based pycs properly.

5 years agoAdd link to PEP 525 in Expressions. (GH-10333)
Andrés Delfino [Wed, 7 Nov 2018 18:12:12 +0000 (15:12 -0300)]
Add link to PEP 525 in Expressions. (GH-10333)

5 years agoglob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)
Andrés Delfino [Wed, 7 Nov 2018 18:09:11 +0000 (15:09 -0300)]
glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)

5 years agoAdd a reference to the name mangling description in the tutorial to the index. (GH...
Andrés Delfino [Wed, 7 Nov 2018 17:59:45 +0000 (14:59 -0300)]
Add a reference to the name mangling description in the tutorial to the index. (GH-10138)

5 years agoAdd future_stmt to simple_stmt production list. (GH-8239)
Andrés Delfino [Wed, 7 Nov 2018 17:32:18 +0000 (14:32 -0300)]
Add future_stmt to simple_stmt production list. (GH-8239)

5 years agoFix markup for xml.sax in 3.8 notes. (GH-9603)
Andrés Delfino [Wed, 7 Nov 2018 17:29:14 +0000 (14:29 -0300)]
Fix markup for xml.sax in 3.8 notes. (GH-9603)

5 years agoCorrect grammar mistakes in string.rst. (GH-9752)
Andrés Delfino [Wed, 7 Nov 2018 17:24:56 +0000 (14:24 -0300)]
Correct grammar mistakes in string.rst. (GH-9752)

5 years agoMark len call as a code snippet in stdtypes.rst. (GH-9804)
Andrés Delfino [Wed, 7 Nov 2018 17:22:47 +0000 (14:22 -0300)]
Mark len call as a code snippet in stdtypes.rst. (GH-9804)

5 years agoMark -c and -O as command line options in reStructuredText. (GH-10103)
Andrés Delfino [Wed, 7 Nov 2018 17:06:45 +0000 (14:06 -0300)]
Mark -c and -O as command line options in reStructuredText. (GH-10103)

5 years agobpo-32409: Fix regression in activate.bat on international Windows (GH-10295)
samstagern [Wed, 7 Nov 2018 16:49:14 +0000 (17:49 +0100)]
bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)

Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.

We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.

5 years agobpo-2504: Add pgettext() and variants to gettext. (GH-7253)
Cheryl Sabella [Wed, 7 Nov 2018 14:12:20 +0000 (09:12 -0500)]
bpo-2504: Add pgettext() and variants to gettext. (GH-7253)

5 years agobpo-34160: Preserve order of attributes in minidom. (GH-10219)
Diego Rojas [Wed, 7 Nov 2018 14:09:04 +0000 (09:09 -0500)]
bpo-34160: Preserve order of attributes in minidom. (GH-10219)

5 years agobpo-31553: add --json-lines option to json.tool (#10051)
HongWeipeng [Wed, 7 Nov 2018 10:09:32 +0000 (18:09 +0800)]
bpo-31553: add --json-lines option to json.tool (#10051)

* add jsonlines option to json.tool

* code review

* fix:avoid read infile after it close

* improve doc in whatsnew 3.8

5 years agobpo-34898: Add mtime parameter to gzip.compress(). (GH-9704)
guoci [Wed, 7 Nov 2018 09:50:23 +0000 (04:50 -0500)]
bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704)

Without setting mtime, time.time() will be used as the timestamp which will
end up in the compressed data and each invocation of the compress() function
will vary over time.

5 years agoRemove duplicate "Reference Guide" in optparse.rst. (GH-10372)
Andrés Delfino [Wed, 7 Nov 2018 05:47:11 +0000 (02:47 -0300)]
Remove duplicate "Reference Guide" in optparse.rst. (GH-10372)

5 years agobpo-33000: Document that IDLE's shell has no line limit. (#10373)
Terry Jan Reedy [Wed, 7 Nov 2018 04:55:06 +0000 (23:55 -0500)]
bpo-33000: Document that IDLE's shell has no line limit. (#10373)

A program that runs indefinitely can overfill memory.

5 years agobpo-35081: Add pycore_fileutils.h (GH-10371)
Victor Stinner [Tue, 6 Nov 2018 23:44:03 +0000 (00:44 +0100)]
bpo-35081: Add pycore_fileutils.h (GH-10371)

Move Py_BUILD_CORE code from Include/fileutils.h to a new
Include/internal/pycore_fileutils.h file.

5 years agobpo-17560: Too small type for struct.pack/unpack in mutliprocessing.Connection (GH...
Alexander Buchkovsky [Tue, 6 Nov 2018 19:38:34 +0000 (21:38 +0200)]
bpo-17560: Too small type for struct.pack/unpack in mutliprocessing.Connection (GH-10305)

Allow sending more than 2 GB at once on a multiprocessing connection on non-Windows systems.

5 years agobpo-23220: Explain how IDLE's Shell displays output (GH-10356)
Terry Jan Reedy [Tue, 6 Nov 2018 17:37:36 +0000 (12:37 -0500)]
bpo-23220: Explain how IDLE's Shell displays output (GH-10356)

Add a new subsection to the doc.

5 years agobpo-35081: Add _PyCoreConfig_AsDict() (GH-10362)
Victor Stinner [Tue, 6 Nov 2018 14:59:52 +0000 (15:59 +0100)]
bpo-35081: Add _PyCoreConfig_AsDict() (GH-10362)

_testcapimodule.c must not include pycore_pathconfig.h, since it's an
internal header files.

Changes:

* Add _PyCoreConfig_AsDict() function to coreconfig.c.
* Remove pycore_pathconfig.h include from _testcapimodule.h.
* pycore_pathconfig.h now requires Py_BUILD_CORE to be defined.
* _testcapimodule.c compilation now fails if it's built with
  Py_BUILD_CORE defined.

5 years agocloses bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH...
Alexey Izbyshev [Tue, 6 Nov 2018 04:29:07 +0000 (07:29 +0300)]
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347)

The test depended on '/usr/share/zoneinfo/posixrules' or equivalent
because it set TZ without explicit DST transition rules. At least
on OpenSUSE Tumbleweed that file is linked to '/etc/localtime',
making the test fail with certain local timezones,
such as 'Europe/Moscow' which doesn't have DST transitions since 2011.

5 years agobpo-35099: Update idlelib/help.html (#10353)
Terry Jan Reedy [Tue, 6 Nov 2018 03:17:57 +0000 (22:17 -0500)]
bpo-35099: Update idlelib/help.html (#10353)

(This should have been done with the first PR for this issue.)

5 years ago bpo-35099: Improve the doc about IDLE running user code. (#10350)
Terry Jan Reedy [Tue, 6 Nov 2018 02:30:32 +0000 (21:30 -0500)]
 bpo-35099: Improve the doc about IDLE running user code. (#10350)

The section is renamed from "IDLE -- console differences".  It mostly
covers the implications of using custom sys.stdxxx objects.

5 years agobpo-35119: Fix RecursionError in example of customizing module attribute access....
Denis Osipov [Tue, 6 Nov 2018 01:53:21 +0000 (06:53 +0500)]
bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)

https://bugs.python.org/issue35119

5 years agobpo-33462: Add __reversed__ to dict and dict views (GH-6827)
Rémi Lapeyre [Tue, 6 Nov 2018 00:38:54 +0000 (01:38 +0100)]
bpo-33462: Add __reversed__ to dict and dict views (GH-6827)

5 years ago[Docs] Fix required version of an example of importlib (GH-10118)
E Kawashima [Mon, 5 Nov 2018 22:41:17 +0000 (07:41 +0900)]
[Docs] Fix required version of an example of importlib (GH-10118)

§31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5.

5 years agoFix possible crashes in pwdmodule.c. (GH-10331)
Zackery Spytz [Mon, 5 Nov 2018 19:26:40 +0000 (12:26 -0700)]
Fix possible crashes in pwdmodule.c. (GH-10331)

"p" was not initialized if the first PyMem_RawRealloc() call failed.

5 years agobpo-35167: Specify program for gzip and json.tool command line options. (GH-10332)
Serhiy Storchaka [Mon, 5 Nov 2018 15:47:27 +0000 (17:47 +0200)]
bpo-35167: Specify program for gzip and json.tool command line options. (GH-10332)

5 years agobpo-35133: Fix mistakes when concatenate string literals on different lines. (GH...
Serhiy Storchaka [Mon, 5 Nov 2018 14:20:25 +0000 (16:20 +0200)]
bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284)

Two kind of mistakes:

1. Missed space. After concatenating there is no space between words.

2. Missed comma. Causes unintentional concatenating in a list of strings.

5 years agobpo-32512: Add -m option to profile for profiling modules (#5132)
Mario Corchero [Mon, 5 Nov 2018 12:03:46 +0000 (15:03 +0300)]
bpo-32512: Add -m option to profile for profiling modules (#5132)

The new option in the CLI of the profile module allow to profile
executable modules. This change follows the same implementation as the
one already present in `cProfile`.

As the argument is now present on both modules, move the tests to the
common test case to be run with profile as well.

5 years agocloses bpo-32285: Add unicodedata.is_normalized. (GH-4806)
Max Bélanger [Sun, 4 Nov 2018 23:58:24 +0000 (15:58 -0800)]
closes bpo-32285: Add unicodedata.is_normalized. (GH-4806)

5 years agobpo-19675: Terminate processes if construction of a pool is failing. (GH-5614)
Julien Palard [Sun, 4 Nov 2018 22:40:32 +0000 (23:40 +0100)]
bpo-19675: Terminate processes if construction of a pool is failing. (GH-5614)

5 years agobpo-9842: Add cross-reference to the ellipsis object (GH-4063)
Pablo Galindo [Sun, 4 Nov 2018 22:36:25 +0000 (22:36 +0000)]
bpo-9842: Add cross-reference to the ellipsis object (GH-4063)

This PR adds a cross-reference to the ellipsis object and the representation of recursive item in containers as indicated in [issue 9842](https://bugs.python.org/issue9842) by @bitdancer.

https://bugs.python.org/issue9842

5 years agobpo-35118: Improve docs regarding indexing (GH-10265)
Windson yang [Sun, 4 Nov 2018 22:34:22 +0000 (06:34 +0800)]
bpo-35118: Improve docs regarding indexing (GH-10265)

5 years agobpo-10536: Enhancements to gettext docs (GH-10324)
Stéphane Wirtel [Sun, 4 Nov 2018 22:24:41 +0000 (23:24 +0100)]
bpo-10536: Enhancements to gettext docs (GH-10324)

5 years agobpo-31887: Adds documentations for special multipart/signed handling (GH-4268)
Saptak Sengupta [Sun, 4 Nov 2018 22:12:34 +0000 (03:42 +0530)]
bpo-31887: Adds documentations for special multipart/signed handling (GH-4268)

This pull request adds some information about the special multipart/signed handling to clear about disabling header folding.

https://bugs.python.org/issue31887

5 years agobpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318)
Lysandros Nikolaou [Sun, 4 Nov 2018 21:21:28 +0000 (22:21 +0100)]
bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318)

5 years agoDoc: Disable smartquotes for zh-tw, zh-cn, fr and ja translations (GH-9423)
Adrian Liaw [Sun, 4 Nov 2018 21:04:51 +0000 (05:04 +0800)]
Doc: Disable smartquotes for zh-tw, zh-cn, fr and ja translations (GH-9423)

5 years agobpo-35159: Add a link to the devguide in the sidebar of the index (Doc/) (GH-10316)
Stéphane Wirtel [Sun, 4 Nov 2018 20:41:34 +0000 (21:41 +0100)]
bpo-35159: Add a link to the devguide in the sidebar of the index (Doc/) (GH-10316)

5 years agobpo-35161: Fix stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid...
Alexey Izbyshev [Sun, 4 Nov 2018 15:44:16 +0000 (18:44 +0300)]
bpo-35161: Fix stack-use-after-scope in grp.getgr{nam,gid} and pwd.getpw{nam,uid}. (GH-10319)

Reported by ASAN.

5 years agoExplain that the orderness of the result of glob is system-dependant (GH-6587)
Elena Oat [Sun, 4 Nov 2018 14:50:55 +0000 (06:50 -0800)]
Explain that the orderness of the result of glob is system-dependant (GH-6587)

Thanks!

6 years agoDoc: -W flag for sphinx-build can be disabled (GH-10303)
Julien Palard [Sat, 3 Nov 2018 18:06:33 +0000 (19:06 +0100)]
Doc: -W flag for sphinx-build can be disabled (GH-10303)

6 years agobpo-34969: Add --fast, --best on the gzip CLI (GH-9833)
Stéphane Wirtel [Sat, 3 Nov 2018 15:24:23 +0000 (16:24 +0100)]
bpo-34969: Add --fast, --best on the gzip CLI (GH-9833)

6 years agoFix a typo about a comma. (GH-10306)
İsmail Arılık [Sat, 3 Nov 2018 15:05:59 +0000 (08:05 -0700)]
Fix a typo about a comma. (GH-10306)

6 years agobpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300)
Alexey Izbyshev [Fri, 2 Nov 2018 16:32:26 +0000 (19:32 +0300)]
bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300)

Use `__GNUC__` instead of non-existing `__GNUC_MAJOR__`.

https://bugs.python.org/issue35147

6 years agobpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101)
BNMetrics [Fri, 2 Nov 2018 15:20:19 +0000 (15:20 +0000)]
bpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101)

Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted.

6 years agobpo-33578: Fix getstate/setstate for CJK decoder (GH-10290)
Christopher Thorne [Fri, 2 Nov 2018 03:29:40 +0000 (03:29 +0000)]
bpo-33578: Fix getstate/setstate for CJK decoder (GH-10290)

Previous version was casting to Py_ssize_t incorrectly
and exhibited unexpected behavior on big-endian systems.

6 years agocloses bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup...
Max Bélanger [Fri, 2 Nov 2018 02:49:46 +0000 (19:49 -0700)]
closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now match `setup.py` (GH-10289)

This could cause compile errors on macOS or other platforms.

6 years agoSimplify sys.breakpointhook implementation (#9519)
Anthony Sottile [Thu, 1 Nov 2018 17:25:05 +0000 (10:25 -0700)]
Simplify sys.breakpointhook implementation (#9519)

6 years agobpo-35075: Fix broken url in the pprint documentation (GH-10201)
Pablo Galindo [Thu, 1 Nov 2018 12:29:38 +0000 (08:29 -0400)]
bpo-35075: Fix broken url in the pprint documentation (GH-10201)

https://bugs.python.org/issue35075

6 years agobpo-33578: Add getstate/setstate for CJK codec (GH-6984)
Christopher Thorne [Thu, 1 Nov 2018 10:48:49 +0000 (10:48 +0000)]
bpo-33578: Add getstate/setstate for CJK codec (GH-6984)

This implements getstate and setstate for the cjkcodecs multibyte incremental encoders/decoders, primarily to fix issues with seek/tell.

The encoder getstate/setstate is slightly tricky as the "state" is pending bytes + MultibyteCodec_State but only an integer can be returned. The approach I've taken is to encode this data into a long, similar to how .tell() encodes a "cookie_type" as a long.

https://bugs.python.org/issue33578

6 years agobpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268)
Pablo Aguiar [Thu, 1 Nov 2018 10:33:35 +0000 (11:33 +0100)]
bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268)

6 years agobpo-35081: And pycore_lifecycle.h and pycore_pathconfig.h (GH-10273)
Victor Stinner [Thu, 1 Nov 2018 02:15:58 +0000 (03:15 +0100)]
bpo-35081: And pycore_lifecycle.h and pycore_pathconfig.h (GH-10273)

* And pycore_lifecycle.h and pycore_pathconfig.h headers to
  Include/internal/
* Move Py_BUILD_CORE specific code from coreconfig.h and
  pylifecycle.h to pycore_pathconfig.h and pycore_lifecycle.h
* Move _Py_wstrlist_XXX() definitions and _PyPathConfig code
  from pycore_state.h to pycore_pathconfig.h
* Move "Init" and "Fini" function definitions from pylifecycle.c to
  pycore_lifecycle.h.

6 years agobpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271)
Victor Stinner [Thu, 1 Nov 2018 01:30:36 +0000 (02:30 +0100)]
bpo-35081: Move accu.h to Include/internal/pycore_accu.h (GH-10271)

The accu.h header is no longer part of the Python C API: it has been
moved to the "internal" headers which are restricted to Python
itself.

Replace #include "accu.h" with #include "pycore_accu.h".

6 years agobpo-35081: Add _PyThreadState_GET() internal macro (GH-10266)
Victor Stinner [Thu, 1 Nov 2018 00:51:40 +0000 (01:51 +0100)]
bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266)

If Py_BUILD_CORE is defined, the PyThreadState_GET() macro access
_PyRuntime which comes from the internal pycore_state.h header.
Public headers must not require internal headers.

Move PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() from
Include/pystate.h to Include/internal/pycore_state.h, and rename
PyThreadState_GET() to _PyThreadState_GET() there.

The PyThreadState_GET() macro of pystate.h is now redefined when
pycore_state.h is included, to use the fast _PyThreadState_GET().

Changes:

* Add _PyThreadState_GET() macro
* Replace "PyThreadState_GET()->interp" with
  _PyInterpreterState_GET_UNSAFE()
* Replace PyThreadState_GET() with _PyThreadState_GET() in internal C
  files (compiled with Py_BUILD_CORE defined), but keep
  PyThreadState_GET() in the public header files.
* _testcapimodule.c: replace PyThreadState_GET() with
  PyThreadState_Get(); the module is not compiled with Py_BUILD_CORE
  defined.
* pycore_state.h now requires Py_BUILD_CORE to be defined.

6 years agobpo-35081: Add pycore_ prefix to internal header files (GH-10263)
Victor Stinner [Wed, 31 Oct 2018 23:52:28 +0000 (00:52 +0100)]
bpo-35081: Add pycore_ prefix to internal header files (GH-10263)

* Rename Include/internal/ header files:

  * pyatomic.h -> pycore_atomic.h
  * ceval.h -> pycore_ceval.h
  * condvar.h -> pycore_condvar.h
  * context.h -> pycore_context.h
  * pygetopt.h -> pycore_getopt.h
  * gil.h -> pycore_gil.h
  * hamt.h -> pycore_hamt.h
  * hash.h -> pycore_hash.h
  * mem.h -> pycore_mem.h
  * pystate.h -> pycore_state.h
  * warnings.h -> pycore_warnings.h

* PCbuild project, Makefile.pre.in, Modules/Setup: add the
  Include/internal/ directory to the search paths of header files.
* Update includes. For example, replace #include "internal/mem.h"
  with #include "pycore_mem.h".

6 years agobpo-26558: Fix Py_FatalError() with GIL released (GH-10267)
Victor Stinner [Wed, 31 Oct 2018 23:26:41 +0000 (00:26 +0100)]
bpo-26558: Fix Py_FatalError() with GIL released (GH-10267)

Don't call _Py_FatalError_PrintExc() nor flush_std_files() if the
current thread doesn't hold the GIL, or if the current thread
has no Python state thread.

6 years agobpo-35081: Move Py_BUILD_CORE code to internal/mem.h (GH-10249)
Victor Stinner [Wed, 31 Oct 2018 19:19:24 +0000 (20:19 +0100)]
bpo-35081: Move Py_BUILD_CORE code to internal/mem.h (GH-10249)

* Add #include "internal/mem.h" to C files using
  _PyMem_SetDefaultAllocator().
* Include/internal/mem.h now requires Py_BUILD_CORE to be defined.

6 years agobpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH...
Xiang Zhang [Wed, 31 Oct 2018 11:49:16 +0000 (19:49 +0800)]
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)

_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.

6 years agobpo-35110: Fix yet few spaces before dashes. (GH-10255)
Serhiy Storchaka [Wed, 31 Oct 2018 09:14:38 +0000 (11:14 +0200)]
bpo-35110: Fix yet few spaces before dashes. (GH-10255)

6 years agoFix a possible crash in range.__reversed__(). (GH-10252)
Zackery Spytz [Wed, 31 Oct 2018 09:13:16 +0000 (03:13 -0600)]
Fix a possible crash in range.__reversed__(). (GH-10252)

6 years agobpo-33138: Change standard error message for non-pickleable and non-copyable types...
Serhiy Storchaka [Wed, 31 Oct 2018 00:28:07 +0000 (02:28 +0200)]
bpo-33138: Change standard error message for non-pickleable and non-copyable types. (GH-6239)

6 years agobpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231)
Serhiy Storchaka [Wed, 31 Oct 2018 00:26:06 +0000 (02:26 +0200)]
bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231)

6 years agobpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10247)
matthewbelisle-wf [Tue, 30 Oct 2018 20:30:19 +0000 (15:30 -0500)]
bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10247)

6 years agobpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)
Daniel Lovell [Tue, 30 Oct 2018 14:56:07 +0000 (07:56 -0700)]
bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)

The root widget was accessed as a global variable in the Application's method.

6 years agobpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239)
Victor Stinner [Tue, 30 Oct 2018 14:14:25 +0000 (15:14 +0100)]
bpo-35081: Move Include/pyatomic.c to Include/internal/ (GH-10239)

Add pyatomic.h to the VS project (it wasn't referenced).

6 years agobpo-35081: Cleanup pystate.c and pystate.h (GH-10240)
Victor Stinner [Tue, 30 Oct 2018 14:13:17 +0000 (15:13 +0100)]
bpo-35081: Cleanup pystate.c and pystate.h (GH-10240)

* Remove _PyThreadState_Current
* Replace GET_TSTATE() with PyThreadState_GET()
* Replace GET_INTERP_STATE() with _PyInterpreterState_GET_UNSAFE()
* Replace direct access to _PyThreadState_Current with
  PyThreadState_GET()
* Replace _PyThreadState_Current with
  _PyRuntime.gilstate.tstate_current
* Rename SET_TSTATE() to _PyThreadState_SET(), name more
  consistent with _PyThreadState_GET()
* Update outdated comments

6 years agobpo-35059: Convert _Py_Dealloc() to static inline function (GH-10223)
Victor Stinner [Tue, 30 Oct 2018 13:48:26 +0000 (14:48 +0100)]
bpo-35059: Convert _Py_Dealloc() to static inline function (GH-10223)

Convert _Py_Dealloc() macro into a static inline function. Moreover,
it is now also defined as a static inline function if Py_TRACE_REFS
is defined.

6 years agobpo-32030: Make _PySys_AddXOptionWithError() private (GH-10236)
Victor Stinner [Tue, 30 Oct 2018 13:31:42 +0000 (14:31 +0100)]
bpo-32030: Make _PySys_AddXOptionWithError() private (GH-10236)

Make _PySys_AddXOptionWithError() and _PySys_AddWarnOptionWithError()
functions private again. They are no longer needed to initialize Python:
_PySys_EndInit() is now responsible to add these options instead.

Moreover, PySys_AddWarnOptionUnicode() now clears the exception on
failure if possible.

6 years agobpo-34523: Fix config_init_fs_encoding() for ASCII (GH-10232)
Victor Stinner [Tue, 30 Oct 2018 11:58:10 +0000 (12:58 +0100)]
bpo-34523: Fix config_init_fs_encoding() for ASCII (GH-10232)

* bpo-34523, bpo-34403: Fix config_init_fs_encoding(): it now uses
  ASCII if _Py_GetForceASCII() is true.
* Fix a regression of commit b2457efc78b74a1d6d1b77d11a939e886b8a4e2c.
* Fix also a memory leak: get_locale_encoding() already allocates
  memory, no need to duplicate the string.

6 years agobpo-31680: Add curses.ncurses_version. (GH-4217)
Serhiy Storchaka [Tue, 30 Oct 2018 11:22:42 +0000 (13:22 +0200)]
bpo-31680: Add curses.ncurses_version. (GH-4217)

Use curses.ncurses_version for conditionally skipping a test.

6 years agobpo-33237: Improve AttributeError message for partially initialized module. (GH-6398)
Serhiy Storchaka [Tue, 30 Oct 2018 11:19:51 +0000 (13:19 +0200)]
bpo-33237: Improve AttributeError message for partially initialized module. (GH-6398)

6 years agobpo-34876: Change the lineno of the AST for decorated function and class. (GH-9731)
Serhiy Storchaka [Tue, 30 Oct 2018 11:16:02 +0000 (13:16 +0200)]
bpo-34876: Change the lineno of the AST for decorated function and class. (GH-9731)

It was overridden by the lineno of the first decorator. Now it is
the lineno of 'def' or 'class'.

6 years agoDoc: fix asyncio loop.close() description (GH-10229)
Andriy Maletsky [Mon, 29 Oct 2018 21:39:21 +0000 (23:39 +0200)]
Doc: fix asyncio loop.close() description (GH-10229)

Needs backport to 3.7. In 3.6 the description is correct.

6 years agobpo-35031: Fix test_start_tls_server_1 on FreeBSD buildbots (GH-10011)
Pablo Galindo [Mon, 29 Oct 2018 20:47:44 +0000 (16:47 -0400)]
bpo-35031: Fix test_start_tls_server_1 on FreeBSD buildbots (GH-10011)

Some FreeBSD buildbots fail to run this test as the eof was not being received by the server if the size is not big enough. This behaviour only appears if the client is using TLS1.3.

6 years agobpo-34765: install-sh is executable (GH-10225)
Victor Stinner [Mon, 29 Oct 2018 20:43:02 +0000 (21:43 +0100)]
bpo-34765: install-sh is executable (GH-10225)

Fix 'install-sh' file permission: add execution bit ("chmod +x"),
"-rw-rw-r--." becomes "-rwxrwxr-x.".

6 years agobpo-34945: Buffer output in test suite only when creating junit file (GH-10204)
Pablo Galindo [Mon, 29 Oct 2018 20:09:41 +0000 (16:09 -0400)]
bpo-34945: Buffer output in test suite only when creating junit file (GH-10204)

After commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed, the output of the
test suite is always buffered as the test output needs to be included in
the JUnit file in same cases (as when a test fails). This has the
consequence that printing or using debuggers (like pdb) in the test
suite does not result in a good user experience anymore.

This commit modifies the test suite runner so it only captures the test
output when the JUnit file is requested to fix the regression so prints
and debuggers are usable again.

6 years agobpo-35059: Convert Py_XINCREF() to static inline function (GH-10224)
Victor Stinner [Mon, 29 Oct 2018 19:52:41 +0000 (20:52 +0100)]
bpo-35059: Convert Py_XINCREF() to static inline function (GH-10224)

Convert Py_XINCREF() and Py_XDECREF() macros into static inline
functions.

6 years agoInclude memo in the documented signature of copy.deepcopy()
Stephan Hoyer [Mon, 29 Oct 2018 18:30:12 +0000 (11:30 -0700)]
Include memo in the documented signature of copy.deepcopy()

* Include memo in the documented signature of copy.deepcopy()

The memo argument is mentioned lower on the doc page under writing a
`__deepcopy__` method, but is not included in the documented function signature.
This makes it easy to miss, and can lead to incorrect/buggy implementations of
`__deepcopy__` -- which is exatly what just happpend to me!

6 years agobpo-34160: Preserve user specified order of Element attributes in html. (GH-10190)
Serhiy Storchaka [Mon, 29 Oct 2018 17:31:04 +0000 (19:31 +0200)]
bpo-34160: Preserve user specified order of Element attributes in html. (GH-10190)

6 years agobpo-33331: Clean modules in the reversed order in PyImport_Cleanup(). (GH-6565)
Serhiy Storchaka [Mon, 29 Oct 2018 17:30:16 +0000 (19:30 +0200)]
bpo-33331: Clean modules in the reversed order in PyImport_Cleanup(). (GH-6565)

Modules imported last are now cleared first at interpreter shutdown.

A newly imported module is moved to the end of sys.modules, behind
modules on which it depends.

6 years agobpo-35059: Remove Py_STATIC_INLINE() macro (GH-10216)
Victor Stinner [Mon, 29 Oct 2018 13:49:24 +0000 (14:49 +0100)]
bpo-35059: Remove Py_STATIC_INLINE() macro (GH-10216)

"static inline" should be used directly. Forcing the compiler to
inline is not recommended.

6 years agobpo-35059: Convert Py_INCREF() to static inline function (GH-10079)
Victor Stinner [Mon, 29 Oct 2018 12:43:07 +0000 (13:43 +0100)]
bpo-35059: Convert Py_INCREF() to static inline function (GH-10079)

* Convert Py_INCREF() and Py_DECREF() macros into static inline
  functions.
* Remove _Py_CHECK_REFCNT() macro: code moved into Py_DECREF().

6 years agobpo-27741: Better wording for datetime.strptime() (GH-9994)
Gus Goulart [Mon, 29 Oct 2018 11:49:52 +0000 (08:49 -0300)]
bpo-27741: Better wording for datetime.strptime() (GH-9994)

6 years agoFix a possible "double decref" in termios.tcgetattr(). (GH-10194)
Zackery Spytz [Mon, 29 Oct 2018 04:55:20 +0000 (22:55 -0600)]
Fix a possible "double decref" in termios.tcgetattr(). (GH-10194)

6 years agobpo-35097: Add IDLE doc subsection explaining editor windows. (#10206)
Terry Jan Reedy [Mon, 29 Oct 2018 00:42:18 +0000 (20:42 -0400)]
bpo-35097: Add IDLE doc subsection explaining editor windows. (#10206)

Topics include opening, title and status bar, .py* extension, and running.

6 years agobpo-33234: Add exact allocation optimization to lists in What's New (GH-10200)
Pablo Galindo [Sun, 28 Oct 2018 22:03:18 +0000 (22:03 +0000)]
bpo-33234: Add exact allocation optimization to lists in What's New (GH-10200)

In commit 372d705 a new optimization to the list() type was introduced but it was not added
to the optimization section in What's new for Python 3.8.

6 years agobpo-35047, unittest.mock: Better error messages on assert_called_xxx failures (GH...
Petter Strandmark [Sun, 28 Oct 2018 20:37:10 +0000 (21:37 +0100)]
bpo-35047, unittest.mock: Better error messages on assert_called_xxx failures (GH-10090)

unittest.mock now includes mock calls in exception messages if
assert_not_called, assert_called_once, or assert_called_once_with
fails.

6 years agoIssue 35093: Document the IDLE document viewer in the IDLE doc. (#10195)
Terry Jan Reedy [Sun, 28 Oct 2018 20:21:18 +0000 (16:21 -0400)]
Issue 35093: Document the IDLE document viewer in the IDLE doc. (#10195)

Add a paragraph in "Help and preferences", "Help sources" subsection.

6 years agobpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846)
Pablo Galindo [Sun, 28 Oct 2018 20:16:26 +0000 (20:16 +0000)]
bpo-33234 Improve list() pre-sizing for inputs with known lengths (GH-9846)

The list() constructor isn't taking full advantage of known input
lengths or length hints. This commit makes the constructor
pre-size and not over-allocate when the input size is known (the
input collection implements __len__). One on the main advantages is
that this provides 12% difference in memory savings due to the difference
between overallocating and allocating exactly the input size.

For efficiency purposes and to avoid a performance regression for small
generators and collections, the size of the input object is calculated using
__len__ and not __length_hint__, as the later is considerably slower.

6 years agoFix yet one error in checking Tcl version. (GH-10189)
Serhiy Storchaka [Sun, 28 Oct 2018 18:58:04 +0000 (20:58 +0200)]
Fix yet one error in checking Tcl version. (GH-10189)

6 years agobpo-34160: Preserve user specified order of Element attributes (GH-10163)
Raymond Hettinger [Sun, 28 Oct 2018 18:18:22 +0000 (11:18 -0700)]
bpo-34160: Preserve user specified order of Element attributes (GH-10163)

6 years agoFix checking for bugfix Tcl version. (GH-10185)
Serhiy Storchaka [Sun, 28 Oct 2018 17:48:36 +0000 (19:48 +0200)]
Fix checking for bugfix Tcl version. (GH-10185)

6 years agobpo-35090: Fix potential division by zero in allocator wrappers (GH-10174)
Alexey Izbyshev [Sun, 28 Oct 2018 16:45:50 +0000 (19:45 +0300)]
bpo-35090: Fix potential division by zero in allocator wrappers (GH-10174)

* Fix potential division by zero in BZ2_Malloc()
* Avoid division by zero in PyLzma_Malloc()
* Avoid division by zero and integer overflow in PyZlib_Malloc()

Reported by Svace static analyzer.

6 years agobpo-1529353: Explain Shell text squeezing in the IDLE doc. (#10169)
Terry Jan Reedy [Sun, 28 Oct 2018 16:44:44 +0000 (12:44 -0400)]
bpo-1529353: Explain Shell text squeezing in the IDLE doc. (#10169)

6 years agobpo-35089: Don't mention typing.io and typing.re (GH-10173)
Sebastian Rittau [Sun, 28 Oct 2018 16:03:29 +0000 (17:03 +0100)]
bpo-35089: Don't mention typing.io and typing.re (GH-10173)

https://bugs.python.org/issue35089