]> granicus.if.org Git - python/log
python
5 years agobpo-35233: InitConfigTests tests more config vars (GH-10541)
Victor Stinner [Wed, 14 Nov 2018 16:39:45 +0000 (17:39 +0100)]
bpo-35233: InitConfigTests tests more config vars (GH-10541)

test_embed.InitConfigTests tests more configuration variables.

Changes:

* InitConfigTests tests more core configuration variables:

  * base_exec_prefix
  * base_prefix
  * exec_prefix
  * home
  * legacy_windows_fs_encoding
  * legacy_windows_stdio
  * module_search_path_env
  * prefix

* "_testembed init_from_config" tests more variables:

  * argv
  * warnoptions
  * xoptions

* InitConfigTests: add check_global_config(), check_core_config() and
  check_main_config() subfunctions to cleanup the code. Move also
  constants at the class level (ex: COPY_MAIN_CONFIG).
* Fix _PyCoreConfig_AsDict(): don't set stdio_encoding twice
* Use more macros in _PyCoreConfig_AsDict() and
  _PyMainInterpreterConfig_AsDict() to reduce code duplication.
* Other minor cleanups.

5 years agobpo-32613: Update window FAQ (GH-5552)
Julien Palard [Wed, 14 Nov 2018 15:22:27 +0000 (16:22 +0100)]
bpo-32613: Update window FAQ (GH-5552)

5 years agobpo-35230: dict: Remove some macros (GH-10513)
INADA Naoki [Wed, 14 Nov 2018 09:39:27 +0000 (18:39 +0900)]
bpo-35230: dict: Remove some macros (GH-10513)

Remove _Py_REF_DEBUG_COMMA, DK_DEBUG_INCREF, and DK_DEBUG_DECREF.
Convert DK_INCREF and DK_DECREF to static inline functions.

5 years agoGrammar corrections in abc.rst (GH-10525)
Andrés Delfino [Wed, 14 Nov 2018 00:40:44 +0000 (21:40 -0300)]
Grammar corrections in abc.rst (GH-10525)

5 years agoLink to property built-in in abc.rst (GH-10526)
Andrés Delfino [Wed, 14 Nov 2018 00:29:57 +0000 (21:29 -0300)]
Link to property built-in in abc.rst (GH-10526)

5 years agoFix doc typo: Window -> Windows (GH-10508)
l-n-s [Wed, 14 Nov 2018 00:13:12 +0000 (00:13 +0000)]
Fix doc typo: Window -> Windows (GH-10508)

5 years agobpo-35233: Rewrite test_embed.InitConfigTests (GH-10524)
Victor Stinner [Tue, 13 Nov 2018 23:24:28 +0000 (00:24 +0100)]
bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524)

* Fix _PyCoreConfig_SetGlobalConfig(): set also Py_FrozenFlag
* Fix _PyCoreConfig_AsDict(): export also xoptions
* Add _Py_GetGlobalVariablesAsDict() and _testcapi.get_global_config()
* test.pythoninfo: dump also global configuration variables
* _testembed now serializes global, core and main configurations
  using JSON to reuse _Py_GetGlobalVariablesAsDict(),
  _PyCoreConfig_AsDict() and _PyMainInterpreterConfig_AsDict(),
  rather than duplicating code.
* test_embed.InitConfigTests now test much more configuration
  variables

5 years agobpo-35214: Fix OOB memory access in unicode escape parser (GH-10506)
Gregory P. Smith [Tue, 13 Nov 2018 21:16:54 +0000 (13:16 -0800)]
bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506)

Discovered using clang's MemorySanitizer when it ran python3's
test_fstring test_misformed_unicode_character_name.

An msan build will fail by simply executing: ./python -c 'u"\N"'

5 years agobpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10519)
Victor Stinner [Tue, 13 Nov 2018 18:59:26 +0000 (19:59 +0100)]
bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10519)

* Fix _PyMainInterpreterConfig_Copy():
   copy 'install_signal_handlers' attribute
* Add _PyMainInterpreterConfig_AsDict()
* Add unit tests on the main interpreter configuration
  to test_embed.InitConfigTests
* test.pythoninfo: log also main_config

5 years agobpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510)
Victor Stinner [Tue, 13 Nov 2018 14:14:58 +0000 (15:14 +0100)]
bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510)

If tracemalloc is not tracing Python memory allocations,
_PyMem_DumpTraceback() now suggests to enable tracemalloc
to get the traceback where the memory block has been allocated.

5 years agobpo-34784: Fix PyStructSequence_NewType with heap-allocated StructSequence (GH-9665)
Eddie Elizondo [Tue, 13 Nov 2018 12:09:31 +0000 (04:09 -0800)]
bpo-34784: Fix PyStructSequence_NewType with heap-allocated StructSequence (GH-9665)

5 years agobpo-35081: Make some _PyGC macros internal (GH-10507)
Victor Stinner [Tue, 13 Nov 2018 11:52:18 +0000 (12:52 +0100)]
bpo-35081: Make some _PyGC macros internal (GH-10507)

* Move "GC" macros together:

  * PyObject_IS_GC()
  * _Py_AS_GC()
  * _PyObject_GC_IS_TRACKED()
  * _PyObject_GC_MAY_BE_TRACKED()

* Mark other GC macros as internal (#ifdef Py_BUILD_CORE):

  * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p)
  * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p)
  * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g)
  * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o)
  * _PyObject_GC_TRACK(o), _PyObject_GC_UNTRACK(o)
  * _PyGC_PREV_MASK_FINALIZED
  * _PyGC_PREV_MASK_COLLECTING
  * _PyGC_PREV_SHIFT
  * _PyGC_PREV_MASK

* Replace _PyGC_generation0 with _PyRuntime.gc.generation0
* _queuemodule.c: replace _PyObject_GC_UNTRACK()
  with with PyObject_GC_UnTrack()
* Document that  _PyObject_GC_TRACK() _PyObject_GC_UNTRACK() macros
  have been removed from the public C API.

5 years agobpo-35081: Remove Py_BUILD_CORE from datetime.h (GH-10416)
Paul Ganssle [Tue, 13 Nov 2018 08:02:25 +0000 (03:02 -0500)]
bpo-35081: Remove Py_BUILD_CORE from datetime.h (GH-10416)

Datetime macros like PyDate_Check() have two implementations, one using
the C API capsule and one using direct access to the datetime type
symbols defined in _datetimemodule.c. Since the direct access versions
of the macros are only used in _datetimemodule.c, they have been moved
out of "datetime.h" and into _datetimemodule.c.

The _PY_DATETIME_IMPL macro is currently necessary in order to avoid
both duplicate definitions of these macros in _datetimemodule.c and
unnecessary declarations of C API capsule-related macros and varibles in
datetime.h.

Co-Authored-By: Victor Stinner <vstinner@redhat.com>
5 years agobpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)
Gregory P. Smith [Tue, 13 Nov 2018 06:01:22 +0000 (22:01 -0800)]
bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)

Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.
Project based C Preprocessor namespacing at its finest. :P

5 years agoFix a couple documentation typos. (GH-10498)
Windson yang [Tue, 13 Nov 2018 03:56:25 +0000 (11:56 +0800)]
Fix a couple documentation typos. (GH-10498)

reproduciblity -> reproducibility
PyPA are the group -> PyPA is the group

5 years agoDisable getc_unlocked() with MemorySanitizer. (GH-10499)
Gregory P. Smith [Tue, 13 Nov 2018 03:47:13 +0000 (19:47 -0800)]
Disable getc_unlocked() with MemorySanitizer. (GH-10499)

clang's MemorySanitizer understand getc() but does not understand
getc_unlocked().  Workaround: Don't use it on msan builds.

5 years agobpo-29564: warnings suggests to enable tracemalloc (GH-10486)
Victor Stinner [Tue, 13 Nov 2018 01:41:00 +0000 (02:41 +0100)]
bpo-29564: warnings suggests to enable tracemalloc (GH-10486)

The warnings module now suggests to enable tracemalloc if the source
is specified, tracemalloc module is available, but tracemalloc is not
tracing memory allocations.

5 years agobpo-35214: Initial clang MemorySanitizer support (GH-10479)
Gregory P. Smith [Mon, 12 Nov 2018 20:07:14 +0000 (12:07 -0800)]
bpo-35214: Initial clang MemorySanitizer support (GH-10479)

Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.

Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that.  This lets our build succeed under the memory sanitizer.  not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.

5 years agoImprove grammar in Glossary. (GH-10474)
Windson yang [Mon, 12 Nov 2018 17:42:38 +0000 (01:42 +0800)]
Improve grammar in Glossary. (GH-10474)

a asynchronous generator -> an asynchronous generator

5 years agoCorrect grammar mistake in stdtypes.rst (GH-10481)
Andrés Delfino [Mon, 12 Nov 2018 17:24:00 +0000 (14:24 -0300)]
Correct grammar mistake in stdtypes.rst (GH-10481)

5 years agobpo-30064: Refactor sock_* asyncio API (#10419)
Andrew Svetlov [Mon, 12 Nov 2018 17:00:22 +0000 (19:00 +0200)]
bpo-30064: Refactor sock_* asyncio API (#10419)

5 years agoLinkify PEP 8 in unix.rst (GH-10482)
Andrés Delfino [Mon, 12 Nov 2018 16:31:57 +0000 (13:31 -0300)]
Linkify PEP 8 in unix.rst (GH-10482)

5 years agobpo-35081: Rename internal headers (GH-10275)
Victor Stinner [Mon, 12 Nov 2018 15:53:38 +0000 (16:53 +0100)]
bpo-35081: Rename internal headers (GH-10275)

Rename Include/internal/ headers:

* pycore_hash.h -> pycore_pyhash.h
* pycore_lifecycle.h -> pycore_pylifecycle.h
* pycore_mem.h -> pycore_pymem.h
* pycore_state.h -> pycore_pystate.h

Add missing headers to Makefile.pre.in and PCbuild:

* pycore_condvar.h.
* pycore_hamt.h
* pycore_pyhash.h

5 years agobpo-33695 shutil.copytree() + os.scandir() cache (#7874)
Giampaolo Rodola [Mon, 12 Nov 2018 14:18:15 +0000 (06:18 -0800)]
bpo-33695 shutil.copytree() + os.scandir() cache (#7874)

5 years agoMinor grammar improvement to io documentation. (GH-10329)
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) [Mon, 12 Nov 2018 04:06:18 +0000 (09:36 +0530)]
Minor grammar improvement to io documentation. (GH-10329)

Independently of -> Independent of

5 years agoUpdate subprocess.Popen documentation wrt universal_newlines arg (GH-10337)
Jakub Stasiak [Mon, 12 Nov 2018 03:40:42 +0000 (04:40 +0100)]
Update subprocess.Popen documentation wrt universal_newlines arg (GH-10337)

* universal_newlines defaulting to False would suggest, that not
  specifying universal_newlines explicitly and setting text to True
  should cause an error, which is not the case.
* The run function didn't have the universal_newlines parameter
  documented
* The check_output function didn't have its text parameter documented

5 years agobpo-33878: Doc: Fix missing case by simplifying. (GH-7762)
Julien Palard [Sun, 11 Nov 2018 23:59:39 +0000 (00:59 +0100)]
bpo-33878: Doc: Fix missing case by simplifying. (GH-7762)

The documentation was not covering multiple targets enclosed by
parenthesis nor multiple targets enclosed by brackets, adding them all
would be heavy, an else cover them all and is lighter to read.

5 years agobpo-35177: Add dependencies between header files (GH-10361)
Victor Stinner [Sun, 11 Nov 2018 23:56:19 +0000 (00:56 +0100)]
bpo-35177: Add dependencies between header files (GH-10361)

* ast.h now includes Python-ast.h and node.h
* parsetok.h now includes node.h and grammar.h
* symtable.h now includes Python-ast.h
* Modify asdl_c.py to enhance Python-ast.h:

  * Add #ifndef/#define Py_PYTHON_AST_H to be able to include the header
    twice
  * Add "extern { ... }" for C++
  * Undefine "Yield" macro conflicting with winbase.h

* Remove "#undef Yield" from C files, it's now done in Python-ast.h
* Remove now useless includes in C files

5 years agocloses bpo-35204: Disable thread and memory sanitizers for address_in_range(). (GH...
Alexey Izbyshev [Sun, 11 Nov 2018 23:14:51 +0000 (02:14 +0300)]
closes bpo-35204: Disable thread and memory sanitizers for address_in_range(). (GH-10442)

This function may access memory which is mapped but is considered
free by libc allocator. It behaves so by design, therefore we
need to suppress sanitizer reports.

GCC doesn't support MSan, so disable only TSan for it.

5 years agoNeaten the code without any algorithmic change. (GH-10466)
Raymond Hettinger [Sun, 11 Nov 2018 22:35:47 +0000 (14:35 -0800)]
Neaten the code without any algorithmic change. (GH-10466)

Remove unneeded assertion (we already know so is a PySetObject *).

5 years agobpo-33699: Describe try's else clause with the rest of the try clause (GH-7252)
Andrés Delfino [Sun, 11 Nov 2018 19:33:51 +0000 (16:33 -0300)]
bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252)

https://bugs.python.org/issue33699

5 years agodict insertion order is guaranteed since 3.7 (GH-10431)
Andrés Delfino [Sun, 11 Nov 2018 16:56:47 +0000 (13:56 -0300)]
dict insertion order is guaranteed since 3.7 (GH-10431)

5 years agobpo-34864: Document two IDLE on MacOS issues. (GH-10456)
Terry Jan Reedy [Sun, 11 Nov 2018 04:26:31 +0000 (23:26 -0500)]
bpo-34864: Document two IDLE on MacOS issues. (GH-10456)

The System Preferences Dock "prefer tabs always" setting disables some
IDLE features.  Menus are a bit different than as described for Windows
and Linux.

5 years agobpo-35202: Remove unused imports in Lib directory. (GH-10446)
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) [Sat, 10 Nov 2018 07:22:02 +0000 (12:52 +0530)]
bpo-35202: Remove unused imports in Lib directory. (GH-10446)

5 years agobpo-35202: Remove unused imports in idlelib (GH-10438)
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) [Sat, 10 Nov 2018 06:45:31 +0000 (12:15 +0530)]
bpo-35202: Remove unused imports in idlelib (GH-10438)

5 years agobpo-35202: Remove unused imports in Lib directory. (GH-10445)
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) [Sat, 10 Nov 2018 05:45:28 +0000 (11:15 +0530)]
bpo-35202: Remove unused imports in Lib directory. (GH-10445)

5 years agoDoc: Simplify Copyright line in README (GH-10287)
David Kleuker [Sat, 10 Nov 2018 03:45:40 +0000 (04:45 +0100)]
Doc: Simplify Copyright line in README (GH-10287)

This also makes it consistent with other places like:

- https://docs.python.org/dev/copyright.html
- https://www.python.org/ footer
- https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/getcopyright.c#L7

5 years agoCorrect a typo in the Unittest documentation (GH-10397)
Géry Ogam [Fri, 9 Nov 2018 19:34:54 +0000 (20:34 +0100)]
Correct a typo in the Unittest documentation (GH-10397)

Co-Authored-By: maggyero <gery.ogam@gmail.com>
5 years agobpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)
Victor Stinner [Fri, 9 Nov 2018 15:56:48 +0000 (16:56 +0100)]
bpo-35199: Add an internal _PyTuple_ITEMS() macro (GH-10434)

* _PyTuple_ITEMS() gives access to the tuple->ob_item field and cast the
  first argument to PyTupleObject*. This internal macro is only usable if
  Py_BUILD_CORE is defined.
* Replace &PyTuple_GET_ITEM(ob, 0) with _PyTuple_ITEMS(ob).
* Replace PyTuple_GET_ITEM(op, 1) with &_PyTuple_ITEMS(ob)[1].

5 years agobpo-35081: Internal headers require Py_BUILD_CORE (GH-10363)
Victor Stinner [Fri, 9 Nov 2018 12:03:37 +0000 (13:03 +0100)]
bpo-35081: Internal headers require Py_BUILD_CORE (GH-10363)

* All internal header files now require Py_BUILD_CORE or
  Py_BUILD_CORE_BUILTIN to be defined.
* _json.c is now compiled with Py_BUILD_CORE_BUILTIN to access
  pycore_accu.h header.
* Add an example to Modules/Setup to show how to build _json
  as a built-in module; it requires non trivial compiler options.

5 years agoHoist the float conversion out of the inner loop. (GH-10430)
Raymond Hettinger [Fri, 9 Nov 2018 10:39:50 +0000 (02:39 -0800)]
Hoist the float conversion out of the inner loop. (GH-10430)

Currently, the *n* and *total* variables get converted to floats each time they are multiplied by random().  This minor tweak does the conversion just once and gets a small speedup (approx 3%).

5 years agoOptimize set.pop() to advance a pointer instead of indexing. (GH-10429)
Raymond Hettinger [Fri, 9 Nov 2018 10:31:56 +0000 (02:31 -0800)]
Optimize set.pop() to advance a pointer instead of indexing. (GH-10429)

Gives approx 20% speed-up using clang depending on the number of elements in the set (the less dense the set, the more the speed-up).

Uses the same entry++ logic used elsewhere in the setobject.c code.

5 years agoCleanup and improve the regex tokenizer example. (GH-10426)
Raymond Hettinger [Fri, 9 Nov 2018 09:19:33 +0000 (01:19 -0800)]
Cleanup and improve the regex tokenizer example. (GH-10426)

1) Convert weird field name "typ" to the more standard "type".
2) For the NUMBER type, convert the value to an int() or float().
3) Simplify ``group(kind)`` to the shorter and faster ``group()`` call.
4) Simplify logic go a single if-elif chain to make this easier to extend.
5) Reorder the tests to match the order the tokens are specified.
   This isn't necessary for correctness but does make the example
   easier to follow.
6) Move the "column" calculation before the if-elif chain so that
   users have the option of using this value in error messages.

5 years agoFixing wording in comment. (GH-10425)
Raymond Hettinger [Fri, 9 Nov 2018 09:06:02 +0000 (01:06 -0800)]
Fixing wording in comment. (GH-10425)

Since the n==1 case just returns *max*, it cannot be larger
than the magnitude of the vector entry.

5 years agobpo-35194: Fix a wrong constant in cp932 codec (GH-10420)
Alexey Izbyshev [Fri, 9 Nov 2018 07:12:06 +0000 (10:12 +0300)]
bpo-35194: Fix a wrong constant in cp932 codec (GH-10420)

This typo doesn't affect the result because wrong bits are discarded
on implicit conversion to unsigned char, but it trips UBSan
with -fsanitize=implicit-integer-truncation.

https://bugs.python.org/issue35194

5 years agobpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190)
Lisa Roach [Fri, 9 Nov 2018 02:34:33 +0000 (18:34 -0800)]
bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190)

5 years agobpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)
Gregory P. Smith [Fri, 9 Nov 2018 01:55:07 +0000 (17:55 -0800)]
bpo-35193: Fix an off by one error in the RETURN_VALUE case. (GH-10418)

Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.

Do a bounds check within find_op so it can return before going past the end as a safety measure.

https://github.com/python/cpython/commit/7db3c488335168993689ddae5914a28e16188447#diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.

This bug was shipped in all Python 3.6 and 3.7 releases.

The included unittest won't fail unless you do a clang msan build.

5 years agobpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212)
Vincent Michel [Thu, 8 Nov 2018 12:21:47 +0000 (13:21 +0100)]
bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212)

The call to `_untrack_reader` is performed too soon, causing the protocol
to forget about the reader before `connection_lost` can run and feed the
EOF to the reader. See bpo-35065.

5 years agoReplace dead code with an assertion in winreg.c. (GH-10028)
Zackery Spytz [Thu, 8 Nov 2018 09:45:00 +0000 (02:45 -0700)]
Replace dead code with an assertion in winreg.c. (GH-10028)

5 years agobpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Serhiy Storchaka [Thu, 8 Nov 2018 06:48:11 +0000 (08:48 +0200)]
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)

Pydoc now does not duplicate docstrings for aliases of inherited methods.

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.