Commit Graph

27385 Commits

Author SHA1 Message Date
Victor Stinner 1d4be0a65f
bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7323)
Use also support.SOCK_MAX_SIZE, not only support.PIPE_MAX_SIZE, to
get the size for a blocking send into a multiprocessing pipe.

Replace also test_support with support.
2018-06-01 19:39:10 +02:00
Victor Stinner 3604b2390a
bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7314)
* bpo-31479: Always reset the signal alarm in tests

Use "try: ... finally: signal.signal(0)" pattern to make sure that
tests don't "leak" a pending fatal signal alarm.

* Move two more alarm() calls into the try block

Fix also typo: replace signal.signal(0) with signal.alarm(0)

* Move another signal.alarm() into the try block

(cherry picked from commit 9abee722d4)
2018-06-01 15:23:02 +02:00
Victor Stinner 0f642620a8
bpo-33692: Update pythoninfo from master (GH-7304)
* bpo-33717: pythoninfo: add CC --version (GH-7290)
2018-06-01 12:29:46 +02:00
T. Wouters 8b98d2a739
Add a crasher to Lib/test for issue #26153. This crasher doesn't crash (#6518)
Python 3.6, although I've seen the same crash in 3.6 (when involving
extension types and more complicated threading setups).
2018-05-31 12:22:11 +02:00
Victor Stinner 82c456fa37
bpo-33532: Fix multiprocessing test_ignore() (GH-7265)
Fix test_multiprocessing.test_ignore(): use support.PIPE_MAX_SIZE
to make sure that send_bytes() blocks.
2018-05-31 07:35:34 +02:00
Serhiy Storchaka d5e7556e52
bpo-33645: Fix an "unknown parsing error" in the parser. (GH-7119)
It is reproduced when parse the "<>" operator and run
Python with both options -3 and -We.
2018-05-31 07:35:39 +03:00
Victor Stinner 9994eff17f
bpo-33692: pythoninfo detect libedit on Python 2.7 (#7246)
Check which readline implementation is used based on the readline
docstring.
2018-05-30 23:36:04 +02:00
Victor Stinner 823c295efa
bpo-29512: Rename Lib/test/bisect.py to bisect_cmd.py (#7229)
Rename Lib/test/bisect.py to Lib/test/bisect_cmd.py. The old name was
in conflict with Lib/bisect.py, causing test failures, depending how
tests were run.

For example, "python2.7 Lib/test/test_httpservers.py" imported
indirectly Lib/test/bisect.py instead of Lib/bisect.py
on "import bisect".
2018-05-30 17:24:40 +02:00
Petr Viktorin f3d269a366
[2.7] Improve ensurepip's --help (GH-4686) (GH-7240)
* Add a space to ensurepip's --altinstall option
* Add periods to the arguments of ensurepip that didn't have it

This makes --help for all optional arguments consistent and also makes it
consistent with pip --help..
(cherry picked from commit e9537ad6a1)

Co-authored-by: Wieland Hoffmann <mineo@users.noreply.github.com>
2018-05-30 12:36:17 +02:00
Victor Stinner 1da37adc28
test.regrtest: flush stdout to display progress (#7120)
Call sys.stdout.flush() after displaying "running: ...".
2018-05-28 13:30:42 +02:00
Pablo Galindo 19f6bd06af bpo-33354: Fix test_ssl when a filename cannot be encoded (GH-6613)
Skip test_load_dh_params() of test_ssl when Python filesystem encoding
cannot encode the provided path.
2018-05-25 00:20:44 +02:00
Serhiy Storchaka ea9a0994cd
[2.7] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) (GH-7015)
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match..
(cherry picked from commit c66c342cb4)

Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
2018-05-21 01:50:33 +03:00
Serhiy Storchaka 861d38443d
[2.7] bpo-32861: robotparser fix incomplete __str__ methods. (GH-5711) (GH-6795) (GH-6817)
The robotparser's __str__ representation now includes wildcard
entries.
(cherry picked from commit c3fa1f2b93)

Co-authored-by: Michael Lazar <lazar.michael22@gmail.com>.
2018-05-15 01:09:47 +03:00
Bo Bayles afe5f633e4 bpo-33038: Fix gzip.GzipFile for file objects with a non-string name attribute. (GH-6095) 2018-05-09 13:14:40 +03:00
Serhiy Storchaka 903f189b6e
bpo-33096: Removed unintentionally backported from Python 3 Tkinter files. (GH-6724)
This partially reverts commit e80a232f2c.
2018-05-08 10:09:08 +03:00
Andrés Delfino c40eeeb5e6 [2.7] bpo-33422: Fix quotation marks getting deleted when looking up byte/string literals on pydoc. (GH-6701) (GH-6712)
Also update the list of string prefixes.
(cherry picked from commit b2043bbe60)
2018-05-07 08:44:03 +03:00
Serhiy Storchaka a55ac801f7
[2.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. (GH-6708). (GH-6717)
(cherry picked from commit cedc9b7420)
2018-05-06 10:51:49 +03:00
Cheryl Sabella 3a04598f63 bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701) (GH-6620)
(cherry picked from commit 74382a3f17)
2018-05-05 16:10:48 +03:00
Serhiy Storchaka 07ad02f62c
[2.7] bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442). (GH-6650)
(cherry picked from commit 7d68bfa826)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2018-04-30 11:34:47 +03:00
Benjamin Peterson 3219bbf6a1
fix running the curses.has_key module (closes bpo-33359) (GH-6608)
This was broken by poor automated translation back in 6e3dbbdf39.
2018-04-25 22:57:34 -07:00
Miss Islington (bot) 4caba7a940
bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)
Upgrade ensurepip to bundle pip 10.0.1
(cherry picked from commit 0399cf9b5e)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2018-04-20 13:48:43 -07:00
Andrés Delfino 7a45eb9efb bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) (GH-6542)
(cherry picked from commit 4b685bf719)

Update only the documentation about image formats.
2018-04-20 09:15:01 +03:00
Serhiy Storchaka d988c0b6bd
[2.7] bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519) (GH-6532)
Converting with line_info=False and col_info=True crashed before.
(cherry picked from commit e5362eaa75)
2018-04-19 09:16:43 +03:00
Miss Islington (bot) afc768d698 bpo-33295: Skip test using missing external site (GH-6504) (GH-6510)
`test_urllib2net.OtherNetworkTests.test_sites_no_connection_close`
used `http://www.imdb.com/` but it is moved to https so the test is
not valid anymore.  Skip test for the moment to allow CI to proceed.
(cherry picked from commit 36d56ea826)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-17 11:35:32 -04:00
Cheryl Sabella 325191bd6b [2.7] bpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195) (GH-6339)
(cherry picked from commit da1734c58d)
2018-04-01 22:29:01 -07: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
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) 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
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
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) 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 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
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
É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
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
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
Benjamin Peterson 0a18422b31
allow the test suite to pass if the strop module doesn't exist (GH-5566)
strop is highly legacy and can be safely compiled out in most installations. Let's not fail the test suite for its absence.
2018-02-06 09:29:21 -08:00
Serhiy Storchaka b7a2c17be8
[2.7] bpo-32137: The repr of deeply nested dict now raises a RuntimeError (GH-4570) (#5493)
instead of crashing due to a stack overflow.

This perhaps will fix similar problems in other extension types.
(cherry picked from commit 1fb72d2ad2)
2018-02-02 16:29:02 +02:00
Victor Stinner b60f43a0e6
bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (GH-2148) (GH-5429)
_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.

(cherry picked from commit 8f6eeaf21c)
2018-01-29 16:54:29 +01:00
Bo Bayles f5a793522d bpo-32304: Fix distutils upload for tar files ending with b'\r' (GH-5264) (GH-5331)
Patch by Bo Bayles.
2018-01-29 09:31:32 -05:00
Victor Stinner 6996f284d4
bpo-32667: Fix tests when $PATH contains a file (#5324)
test_subprocess.test_leaking_fds_on_error() failed when the PATH
environment variable contains a path to an existing file. Fix the
test: ignore also ENOTDIR, not only ENOENT and EACCES.
2018-01-25 22:41:38 +01:00
Gregory P. Smith b1a52b1167
Use assertItemsEqual instead of assertEqual. (#5224)
This test doesn't care about order, the underlying filesystem APIs do not
guarantee directory listings on subsequent calls will be in the same order.
2018-01-17 15:15:46 -08:00
Miss Islington (bot) 016f59a716 pythoninfo: add time.time and datetime.datetime.now (GH-5214) (#5220)
(cherry picked from commit 7d91c02504)
2018-01-17 17:58:16 +01:00
Anthony Sottile 27f32e938f bpo-32539: Fix OSError for os.listdir() for extended-length paths on Windows (#5169)
See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath

Paths that begin with `\\?\` are "extended-length paths".
2018-01-15 23:39:04 +02:00