Commit graph

41821 commits

Author SHA1 Message Date
Miss Islington (bot)
afa1ea5bfd
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:08:24 -07:00
Miss Islington (bot)
0404d35f9d
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:39:43 -07:00
Miss Islington (bot)
52ecb8cac4 pypi.python.org -> pypi.org (GH-7613) (GH-7615)
(cherry picked from commit 9d6d06e806)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 01:07:49 -04:00
Miss Islington (bot)
3e121581d0 bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731) (GH-7607)
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:23:41 -04:00
Miss Islington (bot)
1d4089b5d2 bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7601)
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:03:31 -04:00
Miss Islington (bot)
040d4a7b58 bpo-33748: fix tests altering sys.path and sys.modules (GH-7433) (GH-7603)
(cherry picked from commit 4ab4695388)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:45:51 -04:00
Miss Islington (bot)
08a1b13392
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:11:20 -07:00
Miss Islington (bot)
07aea160ca
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:35:37 -07:00
Miss Islington (bot)
234b53f8b5
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:47:45 -07:00
Miss Islington (bot)
376c272d68
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:05:58 -07:00
Miss Islington (bot)
88437a9b31
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:50:15 -07:00
Miss Islington (bot)
1038669769
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:58 -07:00
Yury Selivanov
8de73d5a69
bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() (GH-7467) (GH-7507) 2018-06-07 21:32:43 -04:00
Victor Stinner
2c8d665ba8
[3.6] bpo-32676, test_asyncio: Fix warning in test_error_in_call_soon() (GH-7462) (GH-7483)
* 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)

* Hide a warning in test_asyncio test_cancel_handshake()

SslProtoHandshakeTests.test_cancel_handshake() of
test_asyncio.test_sslproto: hide a traceback about SSL handshake
failure.
2018-06-07 17:06:50 +02:00
Miss Islington (bot)
97fe1b493d
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 09:09:18 -07:00
Miss Islington (bot)
f74a1244eb
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:51:02 -07:00
Serhiy Storchaka
b8baa33d93
[3.6] bpo-33753: Refactor creating temporary files in test_fileinput. (GH-7377). (GH-7431)
(cherry picked from commit 5f48e2644d)
2018-06-05 19:53:03 +03:00
Miss Islington (bot)
194a5c0722
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:47:42 -07:00
Miss Islington (bot)
ae55d29fe0
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:25:21 -07:00
Miss Islington (bot)
a7de1483c2
bpo-33761: Fix a file leak in test_iterparse in test_xml_etree. (GH-7358)
(cherry picked from commit 13f51d9eec)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-04 10:22:18 -07:00
Miss Islington (bot)
ffe29dbcd9
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:22:10 -07:00
Miss Islington (bot)
db22229687
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:13:43 -07:00
Serhiy Storchaka
2e601c54d9 [3.6] bpo-33759: Fix test.test_xmlrpc.ServerProxyTestCase. (GH-7362) (GH-7375)
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:36:15 -04:00
Miss Islington (bot)
d18b13d36a bpo-33760: Fix file leaks in test_io. (GH-7361) (GH-7372)
(cherry picked from commit e36837cb71)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 23:31:51 -04:00
Miss Islington (bot)
7f1bcda9bc bpo-33750: Reset thread-local context precision in test_round(). (GH-7355) (#7356)
(cherry picked from commit e95dfc5006)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2018-06-03 19:30:12 +02:00
Miss Islington (bot)
da7f8ce21a bpo-33744: Fix test_uu. (GH-7350) (GH-7353)
Separate tests leaked files or were depended on files leaked in other tests.
(cherry picked from commit 027f95c736)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 18:22:54 +03:00
Miss Islington (bot)
dd851d6019
bpo-33679: IDLE: Re-enable color configuration for code context (GH-7199)
The difference from before is that the settings are now on the
Highlights tab instead of the Extensions tab and only change one theme
at a time instead of all themes. The default for light themes is black
on light gray, as before. The default for the IDLE Dark theme is white
on dark gray, which better fits the dark theme.

When one starts IDLE from a console and loads a custom theme without
definitions for 'context', one will see a warning message on the console.
To stop the warning, go to Options => Configure IDLE => Highlights,
select the custom theme if not selected already, select 'Code Context',
and select foreground and background colors.
(cherry picked from commit de6516264e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 19:55:57 -07:00
Miss Islington (bot)
a42fe3c67c
bpo-33642: IDLE: Use variable number of lines in CodeContext. (GH-7106)
Instead of displaying a fixed number of lines, some blank, Code Context
now displays the variable number of actual context lines.  When there
are no context lines, it shows a single blank line to indicate that the
feature is turned on.

The Code Context configuration option is changed from 'numlines'
(default 3) to 'maxlines' (default 15) to avoid possible interference
between user settings for the old and new versions of Code Context.
(cherry picked from commit 29996a1c4e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 17:08:03 -07:00
Victor Stinner
64e538bc70
bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7322)
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:56 +02:00
Victor Stinner
137e80346f
bpo-33718: Update regrtest from master (GH-7325)
* Add support.environment_altered: unused yet
* VSTS: don't run tests with --fail-env-changed
2018-06-01 19:39:37 +02:00
Victor Stinner
f3297433e3
bpo-31238: pydoc ServerThread.stop() now joins itself (GH-3151) (GH-7324)
ServerThread.stop() now joins itself to wait until
DocServer.serve_until_quit() completes and then explicitly sets
its docserver attribute to None to break a reference cycle.

(cherry picked from commit 4cab2cd0c0)
2018-06-01 19:39:16 +02:00
Victor Stinner
1381bfe977
bpo-33540, socketserver: Add _block_on_close for tests (GH-7317)
* Add a private _block_on_close attribute to ForkingMixIn and
  ThreadingMixIn classes of socketserver.
* Use _block_on_close=True in test_socketserver and test_logging
2018-06-01 16:24:43 +02:00
Victor Stinner
5dbb48aaac
[3.6] bpo-31234: Add test.support.wait_threads_exit() (GH-3578) (GH-7315)
* bpo-31234: Add test.support.wait_threads_exit() (GH-3578)

Use _thread.count() to wait until threads exit. The new context
manager prevents the "dangling thread" warning.

(cherry picked from commit ff40ecda73)

* bpo-31234: Try to fix lock_tests warning (#3557)

Try to fix the "Warning -- threading_cleanup() failed to cleanup 1
threads" warning in test.lock_tests: wait a little bit longer to give
time to the threads to complete.

Warning seen on test_thread and test_importlib.

(cherry picked from commit 096ae3373a)
2018-06-01 15:51:02 +02:00
Victor Stinner
95681c7a7d
bpo-31479: Always reset the signal alarm in tests (GH-3588) (GH-7312)
* 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:10 +02:00
Victor Stinner
8f7bd307ce
test.bisect: Update from master, fix typos (#7311) 2018-06-01 14:32:36 +02:00
Victor Stinner
99ba73d118
bpo-31009: Move fd_count() to test.support (#7308)
* Move fd_count() from test.libregrtest.refleak to test.support
* Fix support.fd_count() on Windows: Call CrtSetReportMode() to not
  kill the process on invalid file descriptor if Python is compiled
  in debug mode.
2018-06-01 13:47:24 +02:00
Victor Stinner
b9afe645c4
bpo-33692: Update pythoninfo from master (GH-7301)
* bpo-33717: pythoninfo: add CC --version (GH-7290)
2018-06-01 12:09:59 +02:00
Victor Stinner
c2870b699e
bpo-33532: Fix multiprocessing test_ignore() (GH-7262) (#7266)
Fix test_ignore() of multiprocessing tests like
test_multiprocessing_forkserver: use support.PIPE_MAX_SIZE to make
sure that send_bytes() blocks.

(cherry picked from commit 5d6c7ed5e3)
2018-05-31 07:35:03 +02:00
Victor Stinner
b729af3d9d
regrtest: repeat summary after re-run (GH-7159) (GH-7245)
Using -w, when failing tests are re-run in verbose mode, display
again the tests results at the end.

(cherry picked from commit c6c05d0e69)
2018-05-30 17:41:30 +02:00
Victor Stinner
f7a19c28bd
bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7244)
Check which readline implementation is used based on the readline
docstring.
2018-05-30 16:49:07 +02:00
Miss Islington (bot)
be325e6132 Improve ensurepip's --help (GH-4686) (GH-7239)
* 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 13:56:19 +02:00
Yury Selivanov
3b263e65a8
bpo-32684: Fix gather to propagate cancel of itself with return_exceptions (GH-7224) 2018-05-29 19:20:01 -04:00
Yury Selivanov
6aacc160a8
Fix ci for 3.6 / asyncio / test_stdin_broken_pipe (#7212) 2018-05-29 14:57:38 -04:00
Miss Islington (bot)
5e9e9db9d9 bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) (#7205)
(cherry picked from commit a9cab433bb)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-05-29 11:59:27 -04:00
Yury Selivanov
e151f83dea
bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines (GH-7180)
[3.6 backport of 989b9e0]
2018-05-29 00:55:27 -04:00
Victor Stinner
7593b8a507 bpo-33674: asyncio: Fix SSLProtocol race (GH-7175) (GH-7188)
Fix a race condition in SSLProtocol.connection_made() of
asyncio.sslproto: start immediately the handshake instead of using
call_soon(). Previously, data_received() could be called before the
handshake started, causing the handshake to hang or fail.

(cherry picked from commit be00a5583a)
2018-05-29 00:46:48 -04:00
Miss Islington (bot)
a6d6bd70ac
bpo-33469: RuntimeError after closing loop that used run_in_executor (GH-7171)
(cherry picked from commit fdccfe09f0)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 18:32:17 -07:00
Miss Islington (bot)
7e8819a589 bpo-31647: Fix write_eof() after close() for SelectorSocketTransport (GH-7149) (#7154)
Fixed bug where calling write_eof() on a _SelectorSocketTransport after
it's already closed raises AttributeError.
(cherry picked from commit 23f587e395)

Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
2018-05-28 16:25:03 -04:00
Miss Islington (bot)
6ec325d483
bpo-32374: Ignore Python-level exceptions in test_bad_traverse (GH-7145)
(cherry picked from commit 08c5aca9d1)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-05-28 09:37:10 -07:00
Miss Islington (bot)
ae27dee0f8
bpo-33655: Also ignore test_posix_fallocate failures on BSD platforms (GH-7134)
The failure may be due to the use oF ZFS, a case we already ignore
for Solaris-based systems where ZFS is frequently used.
(cherry picked from commit 09c4a7dee2)

Co-authored-by: Ned Deily <nad@python.org>
2018-05-26 14:57:59 -07:00