Commit Graph

27553 Commits

Author SHA1 Message Date
Victor Stinner 3b26f734c0
test_multiprocessing removes temporary files (GH-15421)
(cherry picked from commit d0b10a6435)
2019-08-23 13:59:40 +01:00
Miss Islington (bot) 198a0d622a
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)
If this service had thoroughly vanished, we could just ignore the
test until someone gets around to either recreating such a service
or redesigning the test to somehow work locally.  The
`support.transient_internet` mechanism catches the failure to
resolve the domain name, and skips the test.

But in fact the domain snakebite.net does still exist, as do its
nameservers -- and they can be quite slow to reply.  As a result
this test can easily take 20-30s before it gets auto-skipped.

So, skip the test explicitly up front.
(cherry picked from commit 5b95a1507e)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-08-20 21:12:18 -07:00
Miss Islington (bot) 53639dd55a
closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather than listdir. (14942)
(cherry picked from commit 93e8aa62cf)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-07-24 16:59:31 -07:00
Miss Islington (bot) bc60c47169
[2.7] bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469) (GH-14475)
* Added documentation for textwrap.dedent behavior.
(cherry picked from commit eb97b9211e)


Co-authored-by: tmblweed <tmblweed@users.noreply.github.com>


https://bugs.python.org/issue30754
2019-06-29 21:41:55 -07:00
Miss Islington (bot) dfa9499ccb [2.7] bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394) (GH-14404)
Fix test_wsgiref.testEnviron() to no longer depend on the environment
variables (don't fail if "X" variable is set).

testEnviron() now overrides os.environ to get a deterministic
environment. Test full TestHandler.environ content: not only a few
selected variables.
(cherry picked from commit 5150d32792)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-26 22:54:27 +02:00
Victor Stinner 6cbff564f0
bpo-37124: Fix reference leak in test_msilib (GH-13750) (GH-14340)
(cherry picked from commit c0295dba25)
2019-06-24 16:09:49 +02:00
Victor Stinner 9d55bf440c
bpo-37359: Add --cleanup option to python3 -m test (GH-14332) (GH-14333)
* regrtest: Add --cleanup option to remove "test_python_*" directories
  of previous failed test jobs.
* Add "make cleantest" to run "python -m test --cleanup".

(cherry picked from commit 47fbc4e45b)
2019-06-24 13:21:18 +02:00
Miss Islington (bot) 0346448396
Improve threading.daemon docstring (GH-14278)
Rephrase and clarify that "the entire Python program exits when only daemon threads are left". This matches the documentation at https://docs.python.org/3/library/threading.htmlGH-thread-objects.
(cherry picked from commit bb110cc2ed)

Co-authored-by: mbarkhau <mbarkhau@gmail.com>
2019-06-23 12:08:28 -07:00
Victor Stinner adcdb1e4f5
bpo-37362: test_gdb now ignores stderr (GH-14287) (GH-14297)
test_gdb no longer fails if it gets an "unexpected" message on
stderr: it now ignores stderr. The purpose of test_gdb is to test
that python-gdb.py commands work as expected, not to test gdb.

(cherry picked from commit e56a123fd0)
2019-06-21 23:58:53 +02:00
Terry Jan Reedy 722733e940
[2.7] Fix 2.7 test -R test_IDLE failure on Windows (GH-13958)
Cherry-picked from 66d47da.
2019-06-16 16:36:23 -04:00
Xtreak ee15aa2b85 [2.7] bpo-35647: Fix path check in cookiejar. (GH-11436) (GH-13427) 2019-06-15 19:29:29 +03:00
Xtreak 979daae300 [2.7] bpo-35121: prefix dot in domain for proper subdomain validation (GH-10258) (GH-13426)
This is a manual backport of ca7fe50635 since 2.7 has `http.cookiejar` in `cookielib`


https://bugs.python.org/issue35121
2019-06-15 08:29:43 -07:00
Victor Stinner 2b578479b9
[2.7] bpo-36742: Fix urlparse.urlsplit() error message for Unicode URL (GH-13937)
If urlparse.urlsplit() detects an invalid netloc according to NFKC
normalization, the error message type is now str rather than unicode,
and use repr() to format the URL, to prevent <exception str() failed>
when display the error message.
2019-06-11 12:45:35 +02:00
Eric Wieser 48f190f79c [2.7] bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13906) 2019-06-08 11:19:24 +02:00
Tal Einat 1b57ab5c64
[2.7] bpo-37177: make IDLE's search dialogs transient (GH-13869)
This avoids the search dialogs being hidden behind the editor window.

(cherry picked from commit 554450fb4e)
2019-06-07 09:53:05 +03:00
Steve Dower f61599b050
bpo-36742: Corrects fix to handle decomposition in usernames (GH-13812) 2019-06-04 09:40:16 -07:00
Miss Islington (bot) bfc1f60560 [2.7] bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)
* bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)

msilib.Directory.start_component() was passing an extra argument to CAB.gen_id().
(cherry picked from commit c8d5bf6c3f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-31 15:39:39 -07:00
Victor Stinner aaed2c332a
bpo-26423: Fix test_descr.test_wrap_lenfunc_bad_cast() on 32-bit Windows (GH-13629)
Skip the test if xrange(sys.maxsize) raises an OverflowError.
2019-05-28 18:15:30 +02:00
Victor Stinner 80dfe99016
bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606) (GH-13625)
Fix possible overflow in wrap_lenfunc() when
sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).

(cherry picked from commit 05f16416d9)
2019-05-28 17:23:07 +02:00
Michele Angrisano 25d8404c35 bpo-36713: Rename duplicated method in test_unicode. (#13525)
modified:   Lib/ctypes/test/test_unicode.py
 	modified:   Misc/ACKS
 	new file:   Misc/NEWS.d/next/Library/2019-05-23-15-57-36.bpo-36713.sjPhnf.rst
2019-05-23 16:42:50 +02:00
Victor Stinner 942c31dffb
bpo-35907: Complete test_urllib.test_local_file_open() (GH-13506)
Test also URLopener().open(), URLopener().retrieve(), and
DummyURLopener().retrieve().
2019-05-22 23:28:03 +02:00
SH b15bde8058 bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-11842)
CVE-2019-9948: Avoid file reading as disallowing the unnecessary URL scheme in urllib.urlopen().
2019-05-21 23:12:23 +02:00
Victor Stinner bb8071a4ca
bpo-30458: Disallow control chars in http URLs (GH-12755) (GH-13154) (GH-13315)
Disallow control chars in http URLs in urllib2.urlopen.  This
addresses a potential security problem for applications that do not
sanity check their URLs where http request headers could be injected.

Disable https related urllib tests on a build without ssl (GH-13032)
These tests require an SSL enabled build. Skip these tests when
python is built without SSL to fix test failures.

Use httplib.InvalidURL instead of ValueError as the new error case's
exception. (GH-13044)

Backport Co-Authored-By: Miro Hrončok <miro@hroncok.cz>

(cherry picked from commit 7e200e0763)

Notes on backport to Python 2.7:

* test_urllib tests urllib.urlopen() which quotes the URL and so is
  not vulerable to HTTP Header Injection.
* Add tests to test_urllib2 on urllib2.urlopen().
* Reject non-ASCII characters: range 0x80-0xff.
2019-05-21 15:12:33 +02:00
Terry Jan Reedy c841a30879
[2.7] Update idlelib NEWS.txt for 2.7 (GH-13436) 2019-05-19 22:35:21 -04:00
Benjamin Peterson 951af2d7f1
closes bpo-36755: Suppress noisy error output in test HTTPS server by default. (GH-13370)
TLS 1.3 has a more efficient handshake protocol. The client can reject the server's credentials and close the connection before the server has even finished writing out all of its initial data. Depending on whether the server finishes writing the rest of its handshake before the it sees the connection is reset, the server will read an empty line or see a ECONNRESET OSError. Nothing is really wrong here with the server or client, so just suppress the error output in the OSError case to fix the test.

This fix isn't required in Python 3 because clients that reject the server's certificate will shut down the TLS layer before closing the TCP connection.
2019-05-17 11:29:38 -07:00
Terry Jan Reedy 353f8d2282
[2.7] bpo-36807: When saving a file in IDLE, call flush and fsync (GH-13102) (GH-13293) 2019-05-13 18:29:15 -04:00
Gregory P. Smith 7346a16ed5
[2.7] bpo-35925: Skip SSL tests that fail due to weak external certs or old TLS (GH-13124) (GH-13253)
Modern Linux distros such as Debian Buster have default OpenSSL system
configurations that reject connections to servers with weak certificates
by default. This causes our test suite run with external networking
resources enabled to skip these tests when they encounter such a
failure.

Fixing the network servers is a separate issue.
(cherry picked from commit 2cc0223)

Changes to test_ssl.py required as 2.7 has legacy protocol tests.

The test_httplib.py change is omitted from this backport as
self-signed.pythontest.net's certificate was updated and the
test_nntplib.py change is not applicable on 2.7.

Authored-by: Gregory P. Smith greg@krypto.org
2019-05-13 13:16:34 -07:00
Gregory P. Smith 7b5dca8345
[2.7] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192) (GH-13199)
* [2.7] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192)

We updated the server, our testsuite must match.

https://bugs.python.org/issue36816

✈️ CLE -> DEN ✈️ #pycon2019 #beyonce
(cherry picked from commit 6bd81734de)

The 2.7 tree also needed a certificate in the capath directory updated.
The filename for that was determined by `openssl x509 -in $cert.pem -subject_hash`.

Authored-by: Gregory P. Smith <greg@krypto.org>
2019-05-08 18:53:15 -06:00
Zackery Spytz 7c2c01f02a [2.7] bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026) (GH-13063)
(cherry picked from commit c4e78b116f)
2019-05-02 15:29:21 -04:00
Miss Islington (bot) 74852b9794
Change bisect to bisect_cmd in docstring (GH-13040)
(cherry picked from commit 11e4a941e9)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-05-01 20:01:41 -07:00
Steve Dower 98a4dcefbb
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017) 2019-05-01 15:00:27 +00:00
Victor Stinner be6cbfb767
bpo-35952: Sync test.pythoninfo from master (GH-13010) 2019-04-29 15:20:38 +02:00
Victor Stinner f4edd39017
bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12949)
bpo-28552, bpo-7774: Fix distutils.sysconfig if sys.executable is
None or an empty string: use os.getcwd() to initialize project_base.

Fix also the distutils build command: don't use sys.executable if
it's evaluated as false (None or empty string).
2019-04-25 13:16:02 +02:00
Victor Stinner 22de4ce498
bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12751)
Set CUSTOMIZED_OSX_COMPILER to True to disable
_osx_support.customize_compiler().
2019-04-09 19:54:10 +02:00
Victor Stinner 9c14061a2c
bpo-36560: Fix reference leak hunting in regrtest (GH-12744) (GH-12745)
Fix reference leak hunting in regrtest: compute also deltas (of
reference count and file descriptor count) during warmup, to ensure
that everything is initialized before starting to hunt reference
leaks.

Other changes:

* Replace gc.collect() with support.gc_collect() in clear_caches()
* dash_R() is now more quiet with --quiet option (don't display
  progress).
* Precompute the full range for "for it in range(repcount):" to
  ensure that the iteration doesn't allocate anything new.
* dash_R() now is responsible to call warm_caches().

(cherry picked from commit 5aaac94eeb)
2019-04-09 18:01:17 +02:00
Zackery Spytz fd83a823a6 bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). (GH-12660) (GH-12678)
(cherry picked from commit 487b73ab39)
2019-04-03 21:59:51 +03:00
Miss Islington (bot) 600aca47f0
bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)
(cherry picked from commit d5a5a33f12)

Co-authored-by: Philipp A <flying-sheep@web.de>
2019-03-27 15:23:19 -07:00
Victor Stinner 8c380e99e9
bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12417)
The test test_customize_compiler() now mocks all sysconfig variables
and all environment variables used by customize_compiler().

(cherry picked from commit 72c7b372cf)
2019-03-18 18:34:06 +01:00
Victor Stinner 37f6971777
bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236) (GH-12349)
Fix CFLAGS in customize_compiler() of distutils.sysconfig: when the
CFLAGS environment variable is defined, don't override CFLAGS variable with
the OPT variable anymore.

Initial patch written by David Malcolm.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
(cherry picked from commit 86082c22d2)
2019-03-15 16:03:44 +01:00
Steve Dower 507bd8cde6
[3.7] bpo-36216: Only print test messages when verbose (GH-12291) 2019-03-12 13:51:58 -07:00
Victor Stinner 701af605df
bpo-36234: test_os: check TypeError for invalid uid type (GH-12235)
Patch written by David Malcolm.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
2019-03-11 13:59:43 +01:00
Miss Islington (bot) 55438d7139
bpo-35807: Upgrade ensurepip bundled pip and setuptools (GH-12189)
* Update pip to 19.0.3
* Update setuptools to 40.8.0
(cherry picked from commit 01e0f439f5)

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2019-03-08 13:45:01 -08:00
Terry Jan Reedy 498468d9c3
[2.7] IDLE: Fix typo in keybindingDialog.py (GH-2322) (GH-12231)
Cherry picked by hand from a0e911b
2019-03-07 22:16:07 -05:00
Steve Dower e37ef41289
bpo-36216: Add check for characters in netloc that normalize to separators (GH-12201) 2019-03-07 09:08:45 -08:00
Stéphane Wirtel 84772e0ab4 [2.7] bpo-36019: Use pythontest.net in urllib network tests (GH-11941) (GH-12177)
Use test_support.TEST_HTTP_URL (pythontest.net) instead of http://www.example.com/.
2019-03-05 15:18:58 +01:00
Ned Deily 453100f60e
bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Original patch by Kevin Walzer. (GH-12034) 2019-03-01 18:12:45 -05:00
Ned Deily b5213f4def
[2.7] bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH-12015) 2019-02-24 03:33:19 -05:00
Ned Deily 72ff2f7554
bpo-26386: Re-enable missing widget testcases in test_ttk_guionly. (GH-12014) 2019-02-24 03:04:19 -05:00
Tzu-ping Chung d5409eb6c2 [2.7] bpo-1104: msilib.SummaryInfo.GetProperty() truncates the string by one character (GH-4517) (GH-11749)
Add one char to MsiSummaryInfoGetProperty() output
Based on the patch in [bpo-1104](https://bugs.python.org/issue1104) by Anthony Tuininga (atuining) and Mark McMahon (markm)
(cherry picked from commit 2de576e16d)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>





https://bugs.python.org/issue1104
2019-02-18 19:06:10 -08:00
stratakis 2149a9ad7a [2.7] bpo-32947: Fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-8761) (GH-11876)
Backport of TLS 1.3 related fixes from 3.7.

Misc fixes and workarounds for compatibility with OpenSSL 1.1.1 from git
master and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2.

OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 2a4ee8aa01)
2019-02-15 18:27:44 +01:00