Commit Graph

27484 Commits

Author SHA1 Message Date
Benjamin Peterson d8b103b8b3
closes bpo-34540: Convert shutil._call_external_zip to use subprocess rather than distutils.spawn. (GH-8985) 2018-08-29 21:59:21 -07:00
Tal Einat 491740f116
[2.7] bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (GH-8864)
(cherry picked from commit 91cb298f81)

Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
2018-08-26 11:44:53 +03:00
Christian Heimes 2ec530cd55
[2.7] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787) (GH-8791)
Read from data socket to avoid "[SSL] shutdown while in init" exception
during shutdown of the dummy server.

Signed-off-by: Christian Heimes <christian@python.org>

<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
https://bugs.python.org/issue34391
<!-- /issue-number -->.
(cherry picked from commit 1590c39336)

Co-authored-by: Christian Heimes <christian@python.org>
2018-08-16 21:38:44 +02:00
Christian Heimes 1f34aece28
[2.7] bpo-34399: 2048 bits RSA keys and DH params (GH-8762) (GH-8765)
Downstream vendors have started to deprecate weak keys. Update all RSA keys
and DH params to use at least 2048 bits.

Finite field DH param file use RFC 7919 values, generated with

    certtool --get-dh-params --sec-param=high

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-08-14 16:53:04 +02:00
Serhiy Storchaka d1c5e278a1
[2.7] bpo-34272: Move argument parsing tests from test_capi to test_getargs2. (GH-8567). (GH-8691)
(cherry picked from commit 8f7bb100d0)
2018-08-06 18:06:14 +03:00
Zackery Spytz 7e4ff9796c [2.7] bpo-34236: Remove mistakenly backported Test6012 in test_capi.py. (GH-8681)
This was backported by mistake in ef19fd2.
2018-08-06 16:47:48 +03:00
Miss Islington (bot) 396afbf771
Fix docstring of Profiler class (GH-8651)
(cherry picked from commit 2ebd3813af)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-08-03 02:43:18 -07:00
Terry Jan Reedy 24a54da945
[2.7] bpo-34275: Make IDLE calltips always visible on Mac. (GH-8639) (GH-8644)
Some MacOS-tk combinations need .update_idletasks().
The call is both unneeded and innocuous on Linux and Windows.
Patch by Kevin Walzer.

(cherry picked from commit 9beaef6225)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-08-02 23:40:20 -04:00
Victor Stinner 3243f8c1fb
bpo-29565: Corrected ctypes passing of large structs by value on Windows AMD64 (GH-168) (GH-8625)
Fixed bpo-29565: Corrected ctypes passing of large structs by value.

Added code and test to check that when a structure passed by value
is large enough to need to be passed by reference, a copy of the
original structure is passed. The callee updates the passed-in value,
and the test verifies that the caller's copy is unchanged. A similar
change was also added to the test added for bpo-20160 (that test was
passing, but the changes should guard against regressions).

(cherry picked from commit a86339b83f)
2018-08-02 16:47:26 +02:00
Tal Einat 894940b109
[2.7] bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
Added missing .grab_release() calls to all places where we call .grab_set().

(cherry picked from commit 10ea9409ce)
2018-08-02 10:21:49 +03:00
Xtreak 2bea771609 bpo-34229: Check start and stop of slice object to be long when they are not int in PySlice_GetIndices (GH-8480) 2018-07-26 19:20:34 +03:00
Serhiy Storchaka fbcb6fae62
bpo-34189: Remove a file backported by accident. (GH-8419) 2018-07-23 22:32:09 +03:00
Miss Islington (bot) 7868426c1f
bpo-33336, imaplib: Legalize MOVE command (GH-6569)
imaplib now allows MOVE command in IMAP4.uid() (RFC 6851:
IMAP MOVE Extension) and potentially as a name of supported
method of IMAP4 object.
(cherry picked from commit caa331d492)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2018-07-23 07:07:03 -07:00
Serhiy Storchaka 46cb5fd706
[2.7] bpo-34189: Add simple tests for new Tk widget options. (GH-8396). (GH-8400)
(cherry picked from commit e271ca78e3)
(cherry picked from commit c75c1e0e8a)
2018-07-22 22:15:16 +03:00
Zackery Spytz 3252205077 bpo-25943: Fix potential heap corruption in bsddb's _db_associateCallback() (GH-8337)
There was a missing check for integer overflow, several function calls
were not checked for failure, and allocated memory was not freed if an
error occurred.
2018-07-21 11:27:44 +03:00
Serhiy Storchaka fc153d1279
[2.7] bpo-34068: iobase_close could call PyObject_SetAttrString with an exception set (GH-8282). (GH-8312) (GH-8314)
(cherry picked from commit 28f07364f0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>.
(cherry picked from commit cc13016658)
2018-07-17 18:15:46 +03:00
Serhiy Storchaka ef19fd200d
[2.7] bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192). (GH-8255)
(cherry picked from commit 504373c59b)

Also backport tests for skipitem() and handling errors.
2018-07-11 19:49:17 +03:00
Tal Einat 6f036bb67d
[2.7] bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091) (#8225)
Actually just one fix on the 2.7 branch.

Contributed by Bradley Laney.

(cherry picked from commit 6b490b5db4)
2018-07-10 13:28:09 +03:00
Serhiy Storchaka 789f95ac97
[2.7] Fixed several assertTrue() that were intended to be assertEqual(). (GH-8191) (GH-8202)
Fixed also testing the "always" warning filter.
(cherry picked from commit b796e7dcdc)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-07-09 20:00:53 +03:00
Serhiy Storchaka b1e6e5615a
bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684). (GH-8193) (GH-8196)
(cherry picked from commit 2a9b8babf0).
(cherry picked from commit 7c43b80150)
2018-07-09 14:39:06 +03:00
Pablo Galindo 8902a1d14e
[2.7] bpo-34019: Fix wrong arguments for Opera Browser (GH-8047) (#8126)
The Opera Browser was using a outdated command line invocation that resulted in an incorrect URL being opened in the browser when requested using the webbrowser module.

* Correct the arguments passed to the Opera Browser when opening a new URL..
(cherry picked from commit 3cf1f154ed)

Co-authored-by: Bumsik Kim <k.bumsik@gmail.com>
2018-07-07 00:54:09 +01:00
Ammar Askar 7829bba45d [2.7] bpo-33899: Make tokenize module mirror end-of-file is end-of-line behavior (GH-7891) (#8133)
Most of the change involves fixing up the test suite, which previously made
the assumption that there wouldn't be a new line if the input didn't end in
one.

Contributed by Ammar Askar.

(cherry picked from commit c4ef4896ea)
2018-07-06 13:23:13 +03:00
Serhiy Storchaka 9720f60f2a
[2.7] bpo-33720: Improve tests for the stack overflow in marshal.loads(). (GH-7336). (GH-8107)
(cherry picked from commit fc05e68d8f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-05 12:20:19 +03:00
Victor Stinner 53fafafa34
bpo-33735: Fix test_multiprocessing random failure (GH-8059) (GH-8061)
When hunting memory leaks using -R 3:3, test_imap_unordered() of
test_multiprocessing leaks randomly a few memory blocks. It is a
false alarm: when testing using -R 3:20 for example, no leak is
detected.

Modify test_imap_unordered() to be closer to test_imap():

* Only test 10 numbers instead of 1000: it's a pool of 4 processes, so
  10 is enough to test at least one number per process
* Use chunksize=100 instead of chunksize=53 to mimick test_imap()

(cherry picked from commit 23401fb960)
2018-07-03 13:43:24 +02:00
Serhiy Storchaka 9b84cc8771
[2.7] bpo-33974: Fix passing special characters to ttk widgets. (GH-7986) (GH-8021)
Fix passing lists and tuples of strings containing special characters
'"', '\\', '{', '}' and '\n' as options to tkinter.ttk widgets.
(cherry picked from commit 5bb5bbfca8)
2018-06-30 13:34:56 +03:00
Zackery Spytz 0464de0f9a [2.7] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918). (GH-8013)
(cherry picked from commit 23db935bcf)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-29 23:07:13 +03:00
Ned Deily f79386f669
bpo-29514: Make magic number test work for candidates (GH-7946) 2018-06-26 23:55:36 -04:00
Victor Stinner 5430c14aba
[2.7] bpo-33873: Backport regrtest from master (GH-7936)
* bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)

* Enhance also format_duration(): work on integers and rounds towards
  +infinity (math.ceil).
* Write unit tests on format_duration()

(cherry picked from commit 4ffe9c2b25)

* bpo-33873: regrtest: Add warning on -R 1:3 (GH-7736)

regrtest: Add warning when using less than 3 warmup runs like -R 1:3.

(cherry picked from commit cac4fef886)

* bpo-33873: Fix bug in `runtest.py` and add checks for invalid `-R` parameters (GH-7735)

Fix bug in `Lib/test/libregrtest/runtest.py` that makes running tests an extra time than the specified number of runs.

Add check for invalid --huntrleaks/-R parameters.

(cherry picked from commit 58ed7307ea)
2018-06-26 23:57:12 +02:00
Victor Stinner f2918881b7
bpo-33901: Fix test_gdbm for gdbm 1.15 (GH-7798) (GH-7818)
Fix test_gdbm.test_reorganize() on macOS with gdbm 1.15: add a
larger value to make sure that the file size changes.

(cherry picked from commit 13c79c677f)
2018-06-20 10:57:38 +02:00
Miss Islington (bot) b2dd5f1b66 bpo-33717: set terse to True when calling platform.platform in test.pythoninfo (GH-7797) (GH-7803)
(cherry picked from commit 71ca738f4c)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-06-20 02:02:17 +08:00
Terry Jan Reedy c488558faa
[2.7] bpo-33856: Add "help" to the welcome message of IDLE (GH-7755) (GH-7758)
Make it the same as when one runs 'python'..
(cherry picked from commit 9d49f85064)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-06-16 18:15:18 -04:00
Victor Stinner e36f94f204
bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7726)
* bpo-32962: python-gdb catchs ValueError on read_var() (GH-7692)

python-gdb now catchs ValueError on read_var(): when Python has no
debug symbols for example.

(cherry picked from commit 019d33b7a4)

* bpo-32962: python-gdb catchs UnicodeDecodeError (GH-7693)

python-gdb now catchs UnicodeDecodeError exceptions when calling
string().

(cherry picked from commit d22fc0bc7d)

bpo-29367: python-gdb.py now supports also method-wrapper
(wrapperobject) objects.

(cherry picked from commit 611083331d)
2018-06-15 23:59:56 +02:00
Xiang Zhang 1889c4cbd6
bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 (GH-1958) (GH-7704)
Hangul composition check boundaries are wrong for the second character
([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3)
instead of [0x11A7, 0x11C3])..
(cherry picked from commit d134809cd3)

Co-authored-by: Wonsup Yoon <pusnow@me.com>
2018-06-15 21:26:55 +08:00
Zachary Ware f6645ef027
bpo-28222: Don't fail if pygments is not available (GH-7564)
We can't just skip the test if docutils is available,
but pygments is not because the purpose of the test
was testing a bug in _check_rst_data().

(cherry-picked from b5bb404cca)
2018-06-09 13:50:23 -05:00
Victor Stinner b4f8bc56c1
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521) (GH-7562)
If tests are re-run, use "xxx then yyy" result format (ex: "FAILURE
then SUCCESS") to show that some failing tests have been re-run.

Add also test_regrtest.test_rerun_fail() test.

(cherry picked from commit c45fc7673e)
2018-06-09 18:59:19 +02:00
Miss Islington (bot) 4e6bd247aa
bpo-11874: fix assertion failure in argparse metavar handling (GH-1826)
- bugfix and test for fragile metavar handling in argparse (see
  bpo-24089, bpo-14046, bpo-25058, bpo-11874)
- also fixes some incorrect tests that did not make 1-element tuples correctly
(cherry picked from commit 66f02aa32f)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-06-08 18:28:02 -07:00
Serhiy Storchaka 23999158f9
[2.7] bpo-33751: Fix test_file. (GH-7378) (GH-7445)
testModeStrings and testTruncateOnWindows were depended on
a file leaked in other tests.

Also improve cleaning up after tests.
(cherry picked from commit c2745d2d05)
2018-06-08 20:24:19 +03:00
Victor Stinner 02b4d67a38
bpo-31731: test_io hangs with --huntrleaks: exclude it (GH-7459)
test_io hangs with --huntrleaks: exclude the test in regrtest.
2018-06-06 23:33:31 +02:00
Victor Stinner 67b7158d53
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421) (GH-7456)
Substract one because listdir() opens internally a file
descriptor to list the content of the /proc/self/fd/ directory.

Add test_support.test_fd_count().

Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure
that the report mode is always restored on failure.

(cherry picked from commit 492d6424a7)
2018-06-06 19:04:50 +02:00
Serhiy Storchaka 3014d6eb7f
[2.7] bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381) (GH-7432)
Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976057)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-05 19:51:37 +03:00
Victor Stinner bc3df70b26
bpo-18174: Fix fd_count() on FreeBSD (GH-7420)
Python 2.7 doesn't have FileNotFoundError exception: use OSError and
errno.ENOENT.
2018-06-05 13:30:48 +02:00
Victor Stinner 64856ad8b7
bpo-18174: regrtest -R 3:3 now also detects FD leak (#7409)
"python -m test --huntrleaks ..." now also checks for leak of file
descriptors.

Co-Authored-By: Richard Oudkerk <shibturn@gmail.com>
2018-06-05 12:36:31 +02:00
Victor Stinner 270581905c
bpo-18174: Fix file descriptor leaks in tests (GH-7408)
* test_tempfile.test_no_leak_fd() mocks os.close() but it doesn't
  call the original os.close() method and so leaks an open file
  descriptor. Fix the test by calling the original os.close()
  function.
* test_posix.test_fdopen_directory(): close the directory file
  descriptor when the test completes.
2018-06-05 00:36:42 +02:00
Victor Stinner 146351860a
[2.7] bpo-31234: Join threads explicitly in tests (#7406)
* Add support.wait_threads_exit(): context manager looping at exit
  until the number of threads decreases to its original number.
* Add some missing thread.join()
* test_asyncore.test_send(): call explicitly t.join() because the cleanup
  function is only called outside the test method, whereas the method
  has a @test_support.reap_threads decorator
* test_hashlib: replace threading.Event with thread.join()
* test_thread:

  * Use wait_threads_exit() context manager
  * Replace test_support with support
  * test_forkinthread(): check child process exit status in the
    main thread to better handle error.
2018-06-04 23:53:52 +02:00
Victor Stinner fadcd4458d
test_tools: catch stderr (GH-7404)
Hide "recursedown('@test_9296_tmp')" message.
2018-06-04 22:26:21 +02:00
Victor Stinner a30d587eb5
[2.7] bpo-33718: Update regrtest from master (GH-7402)
Backport manually regrtest enhancements from master:

* No longer clear filters, like --match, to re-run failed tests in
  verbose mode (-w option).
* Tests result: always indicate if tests have been interrupted.
* Enhance tests summary
* After failing tests are re-run, display again the summary.
* Add environment_altered to test.support, but it's currently unused
* regrtest: count also ENV_CHANGED as failures
* regrtest: Enhance format_duration()
* Replace test_support with support
2018-06-04 22:25:54 +02:00
Serhiy Storchaka 93ba6da27e [2.7] bpo-33759: Fix test.test_xmlrpc.ServerProxyTestCase. (GH-7362) (GH-7374)
It depended on a global variable set by other tests..
(cherry picked from commit 7cfd8c6a1b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 23:39:00 -04:00
Serhiy Storchaka b02ceb57d2 [2.7] bpo-33760: Fix file leaks in test_io. (GH-7361). (GH-7373)
(cherry picked from commit e36837cb71)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 23:37:57 -04:00
Serhiy Storchaka 9b5c9488c7
[2.7] bpo-33744: Fix test_uu. (GH-7350) (GH-7354)
Separate tests leaked files or were depended on files leaked in other tests.
(cherry picked from commit 027f95c736)
2018-06-03 19:31:53 +03:00
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
Serhiy Storchaka 0bcba372bc
bpo-32482: Improve syntax and grammar tests. (#5085) 2018-01-04 10:36:14 +02:00