Commit Graph

80521 Commits

Author SHA1 Message Date
Serhiy Storchaka 4a3c4babd9
[2.7] Gitignore gmon.out (GH-5796) (GH-6328)
gmon.out is generated when profiling turned on

Full Configuration:
./configure --prefix=$PWD/install --enable-profiling  --enable-big-digits=30
--with-pydebug --with-assertions  --with-valgrind.
(cherry picked from commit 95ad3822a2)

Co-authored-by: Neeraj Badlani <neerajbadlani@gmail.com>
2018-04-01 02:44:01 +03:00
Serhiy Storchaka e80a232f2c
[2.7] bpo-33096: Fix ttk.Treeview.insert. (GH-6228) (GH-6326)
Allow ttk.Treeview.insert to insert iid that has a false boolean value.
Note iid=0 and iid=False would be same.
(cherry picked from commit 3ab44c0783)

Co-authored-by: Garvit Khatri <garvitdelhi@gmail.com>
2018-04-01 02:42:58 +03:00
Serhiy Storchaka 924035a5e5
[2.7] Fix error message in sqlite connection thread check. (GH-6028). (GH-6325)
(cherry picked from commit 030345c0bf)

Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
2018-04-01 01:04:22 +03:00
scoder c498cd8bf8 bpo-31544: Fix a reference leak to 'self' after the previous target error handling fixes. (GH-6318)
This change generally splits the xmlparser creation code into an unsafe part with "rollback" error handling and a safe "object initialisation done" part with normal decref cleanup.
2018-03-31 15:23:30 +03:00
Miss Islington (bot) 7f48a426fc bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1. (GH-6284)
(cherry picked from commit c0518cde7a)

Co-authored-by: Ned Deily <nad@python.org>
2018-03-28 04:55:30 -04:00
Miss Islington (bot) a2665075cc
Fix description about SimpleXMLRPCServer constructor parameter bind_and_activate. (GH-776)
Passing True as the `bind_and_activate` *do* immediately opening and binding to their socket.
(cherry picked from commit e6223579c8)

Co-authored-by: cocoatomo <cocoatomo77@gmail.com>
2018-03-26 05:11:15 -07:00
Miss Islington (bot) e3e8bdc5d3
Fix typo and edit for clarity in the docstrings of sys.float_info. (GH-2251)
(cherry picked from commit 0301c9bdd1)

Co-authored-by: Stefano Taschini <taschini@users.noreply.github.com>
2018-03-26 03:58:47 -07:00
Christian Heimes edd541897b
[2.7] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6215)
LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
LibreSSL < 2.7.

Documentation updates and fixes for failing tests will be provided in
another patch set.

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 4ca0739c9d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-24 19:34:15 +01:00
scoder 0694b6a651 bpo-31544: Avoid calling "PyObject_GetAttrString()" (and potentially executing user code) with a live exception set. (GH-3992) 2018-03-24 07:56:41 +02:00
Miss Islington (bot) 1ce4e5bee6 Upgrade pip to v9.0.3 and setuptools to v39.0.1 (GH-6184)
(cherry picked from commit d93b5161af)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-22 00:14:22 -04:00
Miss Islington (bot) 7ee093614b
Fix typos in mmap() error messages (GH-6173)
(cherry picked from commit 9308dea3e1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-03-20 23:55:44 -07:00
Miss Islington (bot) 4e907d8faf Update pip to 9.0.2 and setuptools to 38.6.1 (GH-6133) (GH-6135)
(cherry picked from commit 7f81bb2add)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-17 11:54:45 -04:00
xdegaye baca85fcc7 [2.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-6111)
(cherry picked from commit e32bbaf376)
2018-03-13 23:06:14 +02:00
Miss Islington (bot) 3854f5885e [2.7] bpo-33026: Fix jumping out of "with" block by setting f_lineno. (GH-6026). (GH-6074) (GH-6076)
(cherry picked from commit 26c9f565d0)
(cherry picked from commit 04aadf23ea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-11 10:55:59 +02:00
Xiang Zhang 34bb88dc5b
Clear possible exception before calling PyTuple_Pack in IMPORT_NAME (GH-6033) 2018-03-09 10:21:58 +08:00
Jamie Davis 55d5bfba94 [2.7] closes bpo-32997: Fix REDOS in fpformat (GH-5984)
The regex to decode a number in fpformat is susceptible to catastrophic backtracking. This is a potential DOS vector if a server is using fpformat on untrusted number strings.

Replace it with an equivalent non-vulnerable regex. The match behavior of the new regex is slightly different. It captures the whole integer part of the number in one group, Leading zeros are stripped off later.
2018-03-05 21:59:02 -08:00
Benjamin Peterson e052d40cea
[2.7] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 0e6c8ee235)
2018-03-03 22:18:17 -08:00
Brett Cannon 20003f9162
bpo-32963: Fix the tutorial to state source has a default encoding of ASCII (GH-5961) 2018-03-02 14:10:21 -08:00
Alexey Izbyshev aa40f92240 [2.7] bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801). (#5947)
(cherry picked from commit 3e197c7a67)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-01 18:27:34 +08:00
bennorth c20c97f612 bpo-18533: Avoid RuntimeError from repr() of recursive dictview (#4823) (#5357)
(cherry picked from commit d7773d92bd)
2018-02-27 00:35:03 +02:00
Miss Islington (bot) ecaa372f74
bpo-32500: Correct the documentation for PySequence_Size() and PySequence_Length() (GH-5767)
Dropped the part that says: "For objects that do not provide sequence protocol".
(cherry picked from commit 7a1e1786f9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-25 13:22:43 -08:00
Cheryl Sabella b7c1a94f94 [2.7] bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
By default `print` adds spaces between its arguments.

(cherry picked from commit 84c4b0cc67)
2018-02-25 12:50:26 -08:00
Miss Islington (bot) 76349471ad
bpo-31454: Include information about "import X as Y" in Modules tutorial (GH-4041)
(cherry picked from commit fbee88244e)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2018-02-25 11:38:24 -08:00
Miss Islington (bot) 07c13eee79
Delete a broken threading.local example (GH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true.
(cherry picked from commit 5fb632e831)

Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
2018-02-25 07:34:46 -08:00
Christian Heimes df1732a473
[2.7] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5882)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 29eab55309)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 14:28:55 +01:00
Christian Heimes 439956a149
Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)
Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 13:08:05 +01:00
Christian Heimes 4bb9b9aea0
[2.7] bpo-32647: Link ctypes extension with libdl. (GH-5550) (#5877)
The ctypes module used to depend on indirect linking for dlopen. The shared
extension is now explicitly linked against libdl on platforms with dl.

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 5bb9692575)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 12:31:17 +01:00
Christian Heimes 3d87f4cf9c
[2.7] bpo-30622: Improve NPN support detection (GH-5859) (#5863)
The ssl module now detects missing NPN support in LibreSSL.

Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org>
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 6cdb7954b0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 10:21:03 +01:00
Miss Islington (bot) a5c9112300 [2.7] bpo-32185: Don't send IP in SNI TLS extension (GH-5865) (#5871)
The SSL module no longer sends IP addresses in SNI TLS extension on
platforms with OpenSSL 1.0.2+ or inet_pton.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e9370a4738)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 10:16:37 +01:00
Christian Heimes 6e8f395001
bpo-25404: SSLContext.load_dh_params() non-ASCII path (GH-3459)
SSLContext.load_dh_params() now supports non-ASCII path.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 09:48:02 +01:00
Christian Heimes 8d4d17399f
bpo-31518: Change TLS protocol for Debian (#3661)
Debian Unstable has disabled TLS 1.0 and 1.1 for SSLv23_METHOD(). Change
TLS/SSL protocol of some tests to PROTOCOL_TLS or PROTOCOL_TLSv1_2 to
make them pass on Debian.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 00:45:53 +01:00
Miss Islington (bot) 8a7f1f4b0f
bpo-32923: Unittest doc: replace `whilst` with `while` (GH-5833)
`whilst` and `while` are both english words, `whilst` is not as commonly used.
This can be confusing to readers whose primary language is not english.
(cherry picked from commit 98f42aac23)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
2018-02-23 10:16:56 -08:00
Anselm Kruis 61bd4d2e63 [2.7] bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066) (GH-5825)
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac00b)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
2018-02-23 08:27:28 -08:00
Miss Islington (bot) b852d8c1f0 [2.7] bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (GH-5240) (GH-5781)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918b)


Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-21 08:37:18 +02:00
Benjamin Peterson 6c7edba166
[2.7] closes bpo-32008: don't use PROTOCOL_TLSv1 in example (GH-5789) (#5792)
It's bad form to pin to an old version of TLS. ssl.SSLContext has the right
protocol default, so let's not pass anyway..
(cherry picked from commit e9edee0b65)
2018-02-20 22:17:10 -08:00
Raymond Hettinger 5dc275a2c0
Fix typo in docs (GH-5763) 2018-02-19 15:39:20 -08:00
Éric Araujo eeb33651bf [2.7] bpo-21060 Improve error message for "setup.py upload" without dist files (GH-5726).
(cherry picked from commit 08a6926b25)

Co-authored-by: Éric Araujo <merwok@netwok.org>
2018-02-18 19:56:06 -08:00
Zachary Ware 21f53e7249
[2.7] Clean up Travis config (GH-5727)
(cherry picked from commit 7eb3f8226e)
2018-02-18 15:45:48 -06:00
Miss Islington (bot) fd9d1c901d
DOC: fix documentation for copyright and credits (GH-5706)
Adapt documentation for `copyright` and `credits` to reality.  Previously, the documentation implied that all each of `copyright`,
`credits`, and `license`, would print a message to call the object in order to see the full text.  In reality, only `license` exhibits this
behaviour, and `copyright` and `credit` print their full text either when printed, displayed, or called.
(cherry picked from commit 243d6d7126)

Co-authored-by: Gerrit Holl <gerrit.holl@gmail.com>
2018-02-16 20:11:48 -08:00
Miss Islington (bot) 836b642148
Update comment in posixmodule.c (GH-5681)
A closing parentheses was missing.

Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com>
(cherry picked from commit 7745ec4e35)

Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
2018-02-14 12:43:17 -08:00
Miss Islington (bot) 877112567a
Fix installation instructions for *nix (GH-5605)
Remove pkg_add -r python from FreeBSD installation section.
Moved to OpenBSD.
(cherry picked from commit 3384d38d51)

Co-authored-by: Eitan Adler <grimreaper@users.noreply.github.com>
2018-02-13 19:55:09 -08:00
Benjamin Peterson 23f0a5eabc
[2.7] remove mercurial dot files (GH-5558).
(cherry picked from commit 2b86f4cb2c)
2018-02-13 19:17:10 -08:00
Serhiy Storchaka 17cec70a38
bpo-30109: Fix reindent.py for non-ASCII files. (#5637)
It now processes files as binary streams.

This also fixes "make reindent".
2018-02-12 20:16:42 +02:00
Miss Islington (bot) 4029064716
Fix typo in Include/objimpl.h, the word "has" was missing (GH-5568) (GH-5571)
It now reads: ...be aware that Python has no control over...
(cherry picked from commit 517da1e58f)

Co-authored-by: Alexey <forestbiiird@gmail.com>
2018-02-12 00:06:48 -08:00
Miss Islington (bot) 2cf880498a Fix AppVeyor doc short-circuit (GH-5635)
(cherry picked from commit 6ea20fc719)
2018-02-11 16:29:11 -06:00
Zachary Ware 239e13b3b8
[2.7] Add short-circuit for doc changes to AppVeyor (GH-5629)
(cherry picked from commit 28607e0dd9)
2018-02-11 13:57:11 -06:00
Miss Islington (bot) ea6e6444bd bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609) (GH-5613)
The new link is given in a red box on the old page.
(cherry picked from commit 8d1f2f4038)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2018-02-10 19:42:42 -05:00
Serhiy Storchaka e7197936c9
[2.7] bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5604)
Co-authored-by: Jake Davis <jcdavis@awedge.net>.
(cherry picked from commit 2411292ba8)
2018-02-10 00:02:04 +02:00
Stéphane Wirtel 672fd7d816 bpo-32784: Wrong argument name for csv.DictReader in documentation (GH-5575)
Use `f` as the name of the first parameter of `csv.DictReader` and
`csv.DictWriter` classes.
2018-02-07 08:05:35 -08:00
INADA Naoki 2942b909d9
bpo-32616: Disable computed gotos by default for clang < 5 (GH-5574) 2018-02-07 19:09:36 +09:00