Commit Graph

43066 Commits

Author SHA1 Message Date
Miss Islington (bot) 5085687645
bpo-33855: Minimally test all IDLE modules. (GH-7689)
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es).  Add a test file for all non-startup IDLE modules.  Edit existing files and update coverage.  This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files.
(cherry picked from commit ee5ef309c7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-15 15:38:35 -07:00
Victor Stinner ba67b4f7cb
Revert "bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)" (#7724)
This reverts commit 9b7c74ca32.
2018-06-15 23:37:33 +02:00
Victor Stinner ca4cb8492c
[3.7] bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7710)
* 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-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)

When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.

(cherry picked from commit 9b7c74ca32)
2018-06-15 19:11:45 +02:00
Miss Islington (bot) 0e2b76ea4e
bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 (GH-1958)
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 05:21:55 -07:00
Miss Islington (bot) a50b825c18
bpo-33851: Fix ast.get_docstring() for a node that lacks a docstring. (GH-7682)
(cherry picked from commit 08f127a3ca)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-15 01:25:13 -07:00
Miss Islington (bot) 7b82281c80 bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7664)
When attempting to base64-decode a payload of invalid length (1 mod 4),
properly recognize and handle it.  The given data will be returned as-is,
i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
(cherry picked from commit c3f55be7dd)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-12 16:46:11 +03:00
Ned Deily dfad352267 3.7.0rc1 2018-06-12 00:46:50 -04:00
Miss Islington (bot) 8379b70be2 bpo-33582: Remove duplicate space in inspect.formatargspec() deprecation warning (GH-7655) (GH-7657)
(cherry picked from commit 41254ebd5e)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-12 00:25:31 -04:00
Miss Islington (bot) 42198571c5 bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) (GH-7651)
(cherry picked from commit 4531ec74c4)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 20:58:06 -04:00
Miss Islington (bot) a5db479ac4 bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530) (GH-7649)
The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were
misleading and partly wrong. It fails to explain that OpenSSL behaves
differently in client and server mode. Also OpenSSL does validate the
cert chain everytime. With SSL_VERIFY_NONE a validation error is not
fatal in client mode and does not request a client cert in server mode.
Also discourage people from using CERT_OPTIONAL in client mode.
(cherry picked from commit ef24b6c54d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-06-11 19:20:24 -04:00
Miss Islington (bot) 6530577e29 bpo-33656: Mention color in idlelib/NEWS.txt entry. (GH-7646) (GH-7647)
(cherry picked from commit 4b704f29f5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 17:08:19 -04:00
Miss Islington (bot) 60b8274fec
bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)
(cherry picked from commit 46c5cd0f6e)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-06-11 13:44:16 -07:00
Miss Islington (bot) d26277a73b
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
Change suggested by Eryk Sun in a comment on PR 7137 after it was merged.
(cherry picked from commit fd88f319a4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 13:06:36 -07:00
Miss Islington (bot) 144a8670f2
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
On Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should
make text and lines sharper. It should otherwise have no effect.

Using a magnifier, I determined that the improvement comes from horizontal and
lines being better lined up with the monitor pixels. I checked that this call causes
no problem on any Windows buildbot, including the Win7 buildbots. Unlike most
IDLE patches, this one can be easily reverted by users by removing a few lines,
at the top of idlelib/pyshell.py.
(cherry picked from commit 800415e3df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 11:35:13 -07:00
Miss Islington (bot) a9846e0c70 pypi.python.org -> pypi.org (GH-7613) (GH-7614)
(cherry picked from commit 9d6d06e806)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 01:05:22 -04:00
Miss Islington (bot) ec4343c3b4 bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731) (GH-7606)
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting.  This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
(cherry picked from commit 2487f30d55)

Co-authored-by: Steve Weber <steverweber@gmail.com>
2018-06-10 21:21:35 -04:00
Miss Islington (bot) 037e912552 bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7600)
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.
(cherry picked from commit 877b23202b)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2018-06-10 18:02:24 -04:00
Miss Islington (bot) 298eb07faa bpo-33748: fix tests altering sys.path and sys.modules (GH-7433) (#7604)
(cherry picked from commit 4ab4695388)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:45:19 -04:00
Miss Islington (bot) 053d6c5ce2 bpo-33770: improve base64 exception message for encoded inputs of invalid length (GH-7416) (GH-7602)
(cherry picked from commit 1b85c71a21)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:37:14 -04:00
Miss Islington (bot) 2adfeef185
bpo-33610: Update IDLE Code Context doc entry (GH-7597)
Users can now click on context lines.
(cherry picked from commit af4b0130d4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-10 13:07:24 -07:00
Miss Islington (bot) 463d1890bb
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521)
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)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-09 09:33:24 -07:00
Miss Islington (bot) 8016c2bd69 Datetime test coverage (GH-7544) (GH-7551)
* Added a test case for strftime("%z").

The added test checks a case with UTC offest expressed in an integer
number of seconds.

* Added a test comparing naive and aware datetimes.

Check that a greater than  comparison of a naive  datetime instance with
an aware one raises a TypeError.

* Test datetime in fold or in gap comparison both ways.
(cherry picked from commit 4c3e39f61c)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2018-06-08 23:11:23 -04:00
Miss Islington (bot) 21f4c780a1
bpo-30805: Avoid race condition with debug logging (GH-7545)
Supersedes https://github.com/python/cpython/pull/2490
(cherry picked from commit 12f482e0ae)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-08 15:42:07 -07:00
Miss Islington (bot) f44203d782
bpo-33802: Do not interpolate in ConfigParser while reading defaults (GH-7524)
This solves a regression in logging config due to changes in BPO-23835.
(cherry picked from commit 214f18e49f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-06-08 07:01:56 -07:00
Miss Islington (bot) 842985f6c7
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 04:33:50 -07:00
Miss Islington (bot) 17beebcc8b
bpo-33694: Fix typo in helper function name (GH-7522)
_feed_data_to_bufferred_proto() renamed to
_feed_data_to_buffered_proto() ("bufferred" => "buffered").

Typo spotted by Nathaniel J. Smith.
(cherry picked from commit ff6c077292)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-08 01:48:50 -07:00
Miss Islington (bot) 76bef61b41
Update idlelib/NEWS.txt to 2018 Jun 8 am. (GH-7517)
(cherry picked from commit b1f690294d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-07 23:47:12 -07:00
Miss Islington (bot) a4868473e7
bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
(cherry picked from commit 041272b657)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-07 22:50:36 -07:00
Miss Islington (bot) 0738443a5b
bpo-33792: Add selector and proactor windows policies (GH-7487)
(cherry picked from commit 8f4042964d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-07 18:31:50 -07:00
Miss Islington (bot) 8fa398d5ce bpo-33694: Fix race condition in asyncio proactor (GH-7498) (GH-7499)
The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.

No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.

Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.

Move _feed_data_to_bufferred_proto() to protocols.py.

Remove set_protocol() method which became useless.
(cherry picked from commit 79790bc35f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-08 00:49:34 +02:00
Miss Islington (bot) 0aee3bea19
bpo-33796: Ignore ClassVar for dataclasses.replace(). (GH-7488)
(cherry picked from commit e7adf2ba41)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-06-07 13:15:23 -07:00
Miss Islington (bot) e4b2bdfdcf Improve the subprocess restore_signals=True test. (GH-7414) (GH-7437)
It wasn't testing functionality.  Now it is (on Linux anyways).
(cherry picked from commit 5f3d04fa4e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-06-07 10:31:41 -07:00
Victor Stinner 3c417610ad
[3.7] bpo-33789: Backport test_asyncio fixes from master (GH-7478)
* bpo-33789: test_asyncio: Fix ResourceWarning (GH-7460)

* Close sockets and streams to fix ResourceWarning warnings
* Catch also OSError to hide a traceback on an expected handshake
  error

(cherry picked from commit 0eba7c3913)

* bpo-33789, test_asyncio: Hide PendingDeprecationWarning (GH-7461)

Hide PendingDeprecationWarning in test__register_task_3().

(cherry picked from commit 7ed61e9431)

* bpo-32676, test_asyncio: Fix warning in test_error_in_call_soon() (GH-7462)

Fix "<CoroWrapper ...> was never yielded from" warning in
PyTask_PyFuture_Tests.test_error_in_call_soon() of
test_asyncio.test_tasks.

Close manually the coroutine on error.

(cherry picked from commit 9f04f0df6f)
2018-06-07 16:19:00 +02:00
Miss Islington (bot) 4705ea38c9 update to Unicode 11.0.0 (closes bpo-33778) (GH-7439) (GH-7470)
Also, standardize indentation of generated tables.
(cherry picked from commit 7c69c1c0fb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-06-07 03:36:22 -04:00
Miss Islington (bot) d2a2af0df4
bpo-30436: Add missing space in importlib.util.find_spec() error message (GH-7385)
(cherry picked from commit fffeb6f3d6)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-06 23:21:43 -07:00
Miss Islington (bot) cebd4b009a bpo-28240: timeit: Update repeat() doc (GH-7419) (GH-7457)
Document that the default value of repeat changed from 3 to 5 in
Python 3.7.
(cherry picked from commit 3ef769fcd3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-06 19:05:46 +02:00
Miss Islington (bot) 016aff77cb
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)
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)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-06 08:57:20 -07:00
Miss Islington (bot) e135032ffa bpo-33755: Fix importlib.resources isolation tests (GH-7412) (#7434)
(cherry picked from commit ac1ee1bada)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-06-05 12:11:40 -07:00
Miss Islington (bot) 1d419faccd
bpo-33751: Fix test_file. (GH-7378)
testModeStrings and testTruncateOnWindows were depended on
a file leaked in other tests.

Also improve cleaning up after tests.
(cherry picked from commit c2745d2d05)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-05 10:50:53 -07:00
Miss Islington (bot) 79c7e57c46 bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403) (GH-7428)
In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
(cherry picked from commit 415bc46a78)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-05 10:18:20 -04:00
Miss Islington (bot) ffd72acc50
bpo-33752: Fix a file leak in test_dbm. (GH-7376)
With addCleanup() f.close() was executed after tearDown().
(cherry picked from commit 6592d7fe11)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-05 06:50:56 -07:00
Miss Islington (bot) 631fe1fa42
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)
Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976057)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-05 06:21:04 -07:00
Miss Islington (bot) fff25cc369
bpo-33753: Refactor creating temporary files in test_fileinput. (GH-7377)
(cherry picked from commit 5f48e2644d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-05 03:13:28 -07:00
Miss Islington (bot) 103058e19b
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
(cherry picked from commit 2a4a62ba4a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-06-04 13:41:49 -07:00
Miss Islington (bot) d2c6ecc234
bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
Fix test_warnings.test_module_globals() when python3 is run with
-Werror.
(cherry picked from commit e292b75e3e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-04 10:23:41 -07:00
Miss Islington (bot) b7eb1024d0
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
(cherry picked from commit b609e687a0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:33:23 -07:00
Miss Islington (bot) 87936d03cb bpo-33734: asyncio/ssl: a bunch of bugfixes (GH-7321) (GH-7396)
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)

* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
(cherry picked from commit 9602643120)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-04 12:05:46 -04:00
Miss Islington (bot) cfc12ec68c
bpo-33664: Scroll IDLE editor text by lines (GH-7351)
Previously, the mouse wheel and scrollbar slider moved text by a fixed
number of pixels, resulting in partial lines at the top of the editor
box. The change also applies to the shell and grep output windows,
but not to read-only text views.
(cherry picked from commit d49dbd9acc)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:05:24 -07:00
Miss Islington (bot) 7453caedbb bpo-33759: Fix test.test_xmlrpc.ServerProxyTestCase. (GH-7362) (GH-7371)
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:16:48 -04:00
Miss Islington (bot) 4d11fe7cad bpo-33760: Fix file leaks in test_io. (GH-7361) (GH-7370)
(cherry picked from commit e36837cb71)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 23:15:10 -04:00