Commit Graph

102192 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 363839caf9
bpo-35015: Doc: Fix internationalisation of the availability directive. (GH-10360)
(cherry picked from commit beed84ca5e)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-11-07 13:48:47 -08:00
Miss Islington (bot) 881e273c79 bpo-32409: Fix regression in activate.bat on international Windows (GH-10295) (GH-10377)
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.
(cherry picked from commit c64583b6d3)

Co-authored-by: samstagern <30337691+samstagern@users.noreply.github.com>
2018-11-07 19:26:15 +00:00
Miss Islington (bot) e40e205498
Add link to PEP 525 in Expressions. (GH-10333)
(cherry picked from commit bfe1839aa9)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:32:05 -08:00
Miss Islington (bot) 38bdaa47cf
glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102)
(cherry picked from commit ae31e3fbf4)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:30:18 -08:00
Miss Islington (bot) b949f74f4b
Add a reference to the name mangling description in the tutorial to the index. (GH-10138)
(cherry picked from commit c5eec4426d)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 10:29:58 -08:00
Miss Islington (bot) 2911d4eb21
Add future_stmt to simple_stmt production list. (GH-8239)
(cherry picked from commit cdb96f45b6)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 09:55:14 -08:00
Miss Islington (bot) 766d8f560d
Correct grammar mistakes in string.rst. (GH-9752)
(cherry picked from commit d64991031e)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 09:54:55 -08:00
Miss Islington (bot) f455dd53af
Mark len call as a code snippet in stdtypes.rst. (GH-9804)
(cherry picked from commit ca03f3b93e)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 09:54:41 -08:00
Miss Islington (bot) 76023169f0
Mark -c and -O as command line options in reStructuredText. (GH-10103)
(cherry picked from commit ea6a28c9f7)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-11-07 09:53:20 -08:00
Miss Islington (bot) 2b2a8c130c
bpo-33000: Document that IDLE's shell has no line limit. (GH-10373)
A program that runs indefinitely can overfill memory.
(cherry picked from commit 76cd0c30d6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-06 21:06:54 -08:00
Miss Islington (bot) 34fcee9ed8
bpo-23220: Explain how IDLE's Shell displays output (GH-10356)
Add a new subsection to the doc.
(cherry picked from commit 75d9d59ab3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-06 10:27:20 -08:00
Miss Islington (bot) ca592bcf56
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.
(cherry picked from commit f1b9ad3d38)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-05 20:47:11 -08:00
Miss Islington (bot) 4a46295a95
bpo-35099: Update idlelib/help.html (GH-10353)
(This should have been done with the first PR for this issue.)
(cherry picked from commit f1d3efc2fb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-05 19:36:12 -08:00
Miss Islington (bot) a437c285fa
bpo-35099: Improve the doc about IDLE running user code. (GH-10350)
The section is renamed from "IDLE -- console differences".  It mostly
covers the implications of using custom sys.stdxxx objects.
(cherry picked from commit 5e79090324)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-11-05 18:35:18 -08:00
Miss Islington (bot) 558dc8adbe
bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)
https://bugs.python.org/issue35119
(cherry picked from commit 0bee3c36d4)

Co-authored-by: Denis Osipov <osipov_d@list.ru>
2018-11-05 17:59:15 -08:00
Miss Islington (bot) 91a19c923c
[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.
(cherry picked from commit 16c8a53490)

Co-authored-by: E Kawashima <e-kwsm@users.noreply.github.com>
2018-11-05 14:46:42 -08:00
Serhiy Storchaka 6ad277b259
[3.7] bpo-35167: Specify program for json.tool command line options. (GH-10332) (GH-10338)
(cherry picked from commit 083a7a172b)
2018-11-05 18:44:08 +02:00
Miss Islington (bot) 7beb8c54ed
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.
(cherry picked from commit 34fd4c2019)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-05 06:52:58 -08:00
Miss Islington (bot) 96fb350bfd bpo-21263: Skip test_gdb when python has been compiled with LLVM clang (GH-10318) (GH-10325)
(cherry picked from commit 59668aa8b7)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2018-11-04 16:40:02 -05:00
Miss Islington (bot) 133fd6527d
Fix a typo about a comma. (GH-10306)
(cherry picked from commit fe62d877e3)

Co-authored-by: İsmail Arılık <arilik.ismail@gmail.com>
2018-11-03 10:41:38 -07:00
Alexey Izbyshev a9122d183b [3.7] bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) (GH-10301)
Use `__GNUC__` instead of non-existing `__GNUC_MAJOR__`.

(cherry picked from commit e2ed5adcb5)


https://bugs.python.org/issue35147
2018-11-02 18:30:11 -07:00
BNMetrics 08026b103e [3.7]bpo-29341: Backport b942707 3.7 (#10298)
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..
(cherry picked from commit b942707fc2)

Co-authored-by: BNMetrics <luna@bnmetrics.com>
2018-11-02 13:56:25 -04:00
Miss Islington (bot) 04c96669b1
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.
(cherry picked from commit 318ab63c01)

Co-authored-by: Max Bélanger <aeromax@gmail.com>
2018-11-01 20:09:04 -07:00
Miss Islington (bot) b9c48a73bc
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!
(cherry picked from commit 0200928e8d)

Co-authored-by: Stephan Hoyer <shoyer@gmail.com>
2018-11-01 14:35:17 -07:00
Miss Islington (bot) d69f015ba5
Doc: fix asyncio loop.close() description (GH-10229)
Needs backport to 3.7. In 3.6 the description is correct.
(cherry picked from commit b83d917faf)

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>
2018-11-01 14:34:42 -07:00
Miss Islington (bot) 7d35553138
bpo-35075: Fix broken url in the pprint documentation (GH-10201)
https://bugs.python.org/issue35075
(cherry picked from commit bf46a09dec)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-11-01 14:33:52 -07:00
Serhiy Storchaka 5e0537cf7e
[3.7] bpo-35128: Fix spacing issues in warning.warn() messages. (GH-10268). (GH-10280)
(cherry picked from commit 4b5e62dbb2)

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2018-11-01 14:19:23 +02:00
Miss Islington (bot) 192c54713b
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.
(cherry picked from commit 3a228ab17c)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-10-31 16:45:42 -07:00
Miss Islington (bot) 71b6c1af72
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.
(cherry picked from commit b08746bfdf)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-10-31 05:36:20 -07:00