Commit Graph

102221 Commits

Author SHA1 Message Date
Miss Islington (bot) c743a6ac36 Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598)
(cherry picked from commit 8b9c33ea9c)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-11-19 08:07:34 -05:00
Victor Stinner 0e1312c959
bpo-35233: test_embed: fix filesystem encoding (GH-10597)
Fix InitConfigTests: if utf8_mode is enabled, the expected filesystem
encoding is UTF-8.
2018-11-19 10:05:55 +01:00
Miss Islington (bot) ae02a929dd
bpo-35269: Fix a possible segfault involving a newly-created coroutine (GH-10585)
coro->cr_origin wasn't initialized if compute_cr_origin() failed in
PyCoro_New(), which would cause a crash during the coroutine's
deallocation.

https://bugs.python.org/issue35269
(cherry picked from commit 062a57bf4b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-18 08:58:20 -08:00
Steve Dower e851049e0e
bpo-34725: Adds _Py_SetProgramFullPath so embedders may override sys.executable (GH-9861) 2018-11-17 20:42:08 -08:00
Miss Islington (bot) d1a97b3659
[3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as (GH-10580) (GH-10586)
Source of T_STRING: e42b705188/Python/structmember.cGH-L51

Source of PyUnicode_FromString
https://github.com/python/cpython/blob/master/Include/unicodeobject.hGH-L702


https://bugs.python.org/issue25438
(cherry picked from commit 689d555ec1)


Co-authored-by: Windson yang <wiwindson@outlook.com>


https://bugs.python.org/issue25438
2018-11-17 11:49:58 -08:00
Miss Islington (bot) f415aa1eef
Add --tempdir option for test run (GH-10322)
(cherry picked from commit 38df97a03c)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-11-17 04:31:47 -08:00
Miss Islington (bot) 3a600d224c
bpo-35202: Remove more unused imports in idlelib (GH-10573)
(cherry picked from commit 5a087d5401)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-11-16 22:48:40 -08:00
Miss Islington (bot) 0ee5409aea
Add a missed PyErr_NoMemory() in symtable_new(). (GH-10576)
This missed PyErr_NoMemory() could cause a SystemError when calling
_symtable.symtable().
(cherry picked from commit ad65f15581)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-16 08:31:47 -08:00
Miss Islington (bot) 0461c3b635
bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565)
(cherry picked from commit 4edeaeac4c)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-11-16 05:55:14 -08:00
Miss Islington (bot) be34cb26b9
Fix outdated info in datamodel about dicts (GH-9807)
(cherry picked from commit a48e0eb967)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-11-16 04:20:03 -08:00
Miss Islington (bot) 1b80a373d1
bpo-33816: Remove outdated metaclass example (GH-7566)
(cherry picked from commit c2ccac7b9f)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-16 03:51:20 -08:00
Miss Islington (bot) d2be9a5c13
bpo-35239: _PySys_EndInit() copies module_search_path (GH-10532)
* The _PySys_EndInit() function now copies the
  config->module_search_path list, so config is longer modified when
  sys.path is updated.
* config->warnoptions list and config->xoptions dict are also copied
* test_embed: InitConfigTests now also tests
  main_config['module_search_path']
* Fix _Py_InitializeMainInterpreter(): don't use config->warnoptions
   but sys.warnoptions to decide if the warnings module should
   be imported at startup.
(cherry picked from commit 37cd982df0)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-11-16 03:34:35 -08:00
Miss Islington (bot) 579c417564
bpo-35213: Where appropriate, use 'macOS' in idlelib. (GH-10478)
(cherry picked from commit b65413b497)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-15 11:31:31 -08:00
Miss Islington (bot) b5ea5e57f5
Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)
"single" needs to be decrefed if PyList_Append() fails.
(cherry picked from commit 4c596d54aa)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-11-15 01:25:34 -08:00
Miss Islington (bot) b6b56b49e9
Fix typo in asynchronous generator iterator documentation (GH-10542)
Remove an unnecessary "that":
... will execute that the body ... ->  ... will execute the body ...
(cherry picked from commit 25221b3283)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2018-11-14 22:20:16 -08:00
Victor Stinner 9ee1d42f01
bpo-35233: InitConfigTests tests more config vars (GH-10541) (GH-10546)
test_embed.InitConfigTests tests more configuration variables.

Changes:

* InitConfigTests tests more core configuration variables:

  * base_exec_prefix
  * base_prefix
  * exec_prefix
  * home
  * module_search_path_env
  * prefix

* "_testembed init_from_config" tests more variables:

  * argv
  * warnoptions
  * xoptions

* Py_HasFileSystemDefaultEncoding value is no longer tested since it
  depends on the LC_CTYPE locale and the platform.
* 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).
* Use more macros in _PyCoreConfig_AsDict() and
  _PyMainInterpreterConfig_AsDict() to reduce code duplication.
* Other minor cleanups.

(cherry picked from commit 01de89cb59)
2018-11-14 18:58:01 +01:00
Julien Palard 9053d2f2e0 [3.7] bpo-32613: Update window FAQ (GH-5552). (GH-10544)
(cherry picked from commit 64313478bc)

Co-authored-by: Julien Palard <julien@palard.fr>



https://bugs.python.org/issue32613
2018-11-14 09:17:35 -08:00
Victor Stinner bc09ee8bc9
bpo-35233: Fix test_embed.InitConfigTests on macOS (GH-10539)
On macOS and Windows, Py_HasFileSystemDefaultEncoding is 1 by
default.
2018-11-14 11:36:47 +01:00
Victor Stinner 88cbea4c6f
bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10537)
Fix _PyMainInterpreterConfig_Copy(): copy 'install_signal_handlers'
attribute
2018-11-14 02:45:25 +01:00
Victor Stinner 35c28d562e
[3.7] bpo-35233: Rewrite test_embed.InitConfigTests (GH-10524) (GH-10529)
* Add C functions:

  * _Py_GetGlobalVariablesAsDict()
  * _PyCoreConfig_AsDict()
  * _PyMainInterpreterConfig_AsDict()

* Add new _testcapi methods:

  * get_global_config()
  * get_core_config()
  * get_main_config()

* test.pythoninfo: get global, core and main configuration
* _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
2018-11-14 02:01:52 +01:00
Miss Islington (bot) 52fb9f14b1
Grammar corrections in abc.rst (GH-10525)
(cherry picked from commit 8e0b05e2f4)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-13 17:00:36 -08:00
Miss Islington (bot) e7a5be5cb5
Link to property built-in in abc.rst (GH-10526)
(cherry picked from commit bf1355b424)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-13 16:45:11 -08:00
Miss Islington (bot) 9fbcb1402e
[3.7] bpo-35214: Fix OOB memory access in unicode escape parser (GH-10506) (GH-10522)
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"'
(cherry picked from commit 746b2d35ea)


Co-authored-by: Gregory P. Smith <greg@krypto.org>


https://bugs.python.org/issue35214
2018-11-13 16:39:36 -08:00
Miss Islington (bot) c30830bbb2
Fix doc typo: Window -> Windows (GH-10508)
(cherry picked from commit daeb3c4c58)

Co-authored-by: l-n-s <supervillain@riseup.net>
2018-11-13 16:18:20 -08:00
Victor Stinner d57a3e5d03
bpo-29564:_PyMem_DumpTraceback() suggests enabling tracemalloc (GH-10510) (GH-10517)
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.
2018-11-13 15:50:56 +01:00
Victor Stinner 55b4771d5d
bpo-35229: Deprecate _PyObject_GC_TRACK() (GH-10511)
Deprecate _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() in the
documentation. These macros are removed from Python 3.8 by the commit
1a6be91e6f.
2018-11-13 13:06:11 +01:00
Miss Islington (bot) f6602f9266
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
(cherry picked from commit 3015fb8ce4)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-11-12 22:20:21 -08:00
Miss Islington (bot) 5e4a13b18b
Fix a couple documentation typos. (GH-10498)
reproduciblity -> reproducibility
PyPA are the group -> PyPA is the group
(cherry picked from commit 0dc1e45dfd)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2018-11-12 20:20:31 -08:00
Miss Islington (bot) f0b21e18d8
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.
(cherry picked from commit e6c77d8301)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-11-12 19:59:29 -08:00
Miss Islington (bot) 3f9fe53c98
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.
(cherry picked from commit f6a47f3e31)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-11-12 17:24:39 -08:00
Gregory P. Smith 5f4d05d83f
[3.7] bpo-35214: Initial clang MemorySanitizer support (GH-10479) (GH-10492)
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.

(cherry picked from commit 1584a00815)

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
2018-11-12 13:48:24 -08:00
Miss Islington (bot) f3b0b91674
Improve grammar in Glossary. (GH-10474)
a asynchronous generator -> an asynchronous generator
(cherry picked from commit a9655b7f71)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2018-11-12 09:48:11 -08:00
Miss Islington (bot) 8a54c67701
Correct grammar mistake in stdtypes.rst (GH-10481)
(cherry picked from commit 7610f4fe93)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-12 09:45:05 -08:00
Miss Islington (bot) 5e51f120c0
Linkify PEP 8 in unix.rst (GH-10482)
(cherry picked from commit 9404e7737b)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-12 08:48:56 -08:00
Miss Islington (bot) a744abcb59
Minor grammar improvement to io documentation. (GH-10329)
Independently of -> Independent of
(cherry picked from commit cd449806fa)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-11-11 20:29:33 -08:00
Miss Islington (bot) 7a90504261
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
(cherry picked from commit 7432f0929f)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2018-11-11 19:48:09 -08:00
Miss Islington (bot) aa493b5c18 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.
(cherry picked from commit 082875dcd6)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-11-12 01:24:31 +01:00
Miss Islington (bot) 1ec5781a09
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.
(cherry picked from commit fd3a91cbf9)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-11 15:44:34 -08:00
Miss Islington (bot) 7d7ff672df
bpo-33699: Describe try's else clause with the rest of the try clause (GH-7252)
https://bugs.python.org/issue33699
(cherry picked from commit b086c8afdb)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-11 11:43:52 -08:00
Miss Islington (bot) 317dbb4433
dict insertion order is guaranteed since 3.7 (GH-10431)
(cherry picked from commit 76e8fd7b7e)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-11 09:02:11 -08:00
Miss Islington (bot) b91c27d89d
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.
(cherry picked from commit 50ff02b431)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-10 20:46:12 -08:00
Miss Islington (bot) 2847ccae46
bpo-35202: Remove unused imports in idlelib (GH-10438)
(cherry picked from commit 43a74abb3a)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-11-09 23:06:22 -08:00
Miss Islington (bot) 3da64a0141
Correct a typo in the Unittest documentation (GH-10397)
Co-Authored-By: maggyero <gery.ogam@gmail.com>
(cherry picked from commit 009b2f0204)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2018-11-09 11:43:43 -08:00
Miss Islington (bot) 33fd60d4c3 Cleanup and improve the regex tokenizer example. (GH-10426) (#10427)
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.
(cherry picked from commit b83942c755)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2018-11-09 01:26:55 -08:00
Miss Islington (bot) 22234f1375
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
(cherry picked from commit 7a69cf47a9)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-08 23:35:05 -08:00
Miss Islington (bot) f16ebcd460
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.

7db3c48833GH-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.
(cherry picked from commit 49fa4a9f1e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-11-08 18:13:14 -08:00
Julien Palard 732f745a4a [3.7] Doc: Make all versions sidebars the same for consistency. (GH-10288) (GH-10409) 2018-11-08 00:07:05 -08:00
Miss Islington (bot) 9d3658147b
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Pydoc now does not duplicate docstrings for aliases of inherited methods.
(cherry picked from commit a44d34e179)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-07 23:08:05 -08:00
Miss Islington (bot) 3ba5e253de
Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403)
This reverts commit c64583b6d3 due to multiple buildbot failures when building it.
(cherry picked from commit 6843ffe453)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-11-07 16:13:58 -08:00
Miss Islington (bot) b097f9fe2b
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.
(cherry picked from commit b93925047a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-11-07 14:39:21 -08:00