summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] bpo-38216, bpo-36274: Allow subclasses to separately override ↵Jason R. Coombs2019-10-082-11/+36
| | | | | | | | | | | | | validation and encoding behavior (GH-16476) Backporting this change, I observe a couple of things: 1. The _encode_request call is no longer meaningful because the request construction will implicitly encode the request using the default encoding when the format string is used (request = '%s %s %s'...). In order to keep the code as consistent as possible, I decided to include the call as a pass-through. I'd be just as happy to remove it entirely, but I'll leave that up to the reviewer to decide. It's okay that this functionality is disabled on Python 2 because this functionality was mainly around bpo-36274, which was mainly a concern with the transition to Python 3. 2. Because _encode_request is no longer meaningful, neither is the test for it, so I've removed that test. Therefore, the meaningful part of this test is that for bpo-38216, adding a (underscore-protected) hook to customize/disable validation. (cherry picked from commit 7774d7831e8809795c64ce27f7df52674581d298) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* [2.7] bpo-37664: Update ensurepip bundled wheels, again (GH-16633)Benjamin Peterson2019-10-083-2/+2
| | | | | (cherry picked from commit 10c452b894d95fed06056fe11e8fe8e1a2a60040) Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
* [2.7] bpo-38338, test.pythoninfo: add more ssl infos (GH-16543)Victor Stinner2019-10-021-0/+60
| | | | | | | test.pythoninfo now logs environment variables used by OpenSSL and Python ssl modules, and logs attributes of 3 SSL contexts (SSLContext, default HTTPS context, stdlib context). (cherry picked from commit 1df1c2f8df53d005ff47af81aa02c58752b84e20)
* [2.7] bpo-38243: Escape the server title of DocXMLRPCServer (GH-16447)Dong-hee Na2019-10-012-1/+32
| | | | Escape the server title of DocXMLRPCServer.DocXMLRPCServer when rendering the document page as HTML.
* [2.7] bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. ↵Serhiy Storchaka2019-09-171-7/+12
| | | | | | (GH-16155). (GH-16215) (cherry picked from commit 8debfa50407107ff2329d01081cdc12d359f1d12)
* [2.7] bpo-34155: Dont parse domains containing @ (GH-13079) (GH-16006)Roberto C. Sánchez2019-09-142-1/+24
| | | | | | | | | | | | | This change skips parsing of email addresses where domains include a "@" character, which can be maliciously used since the local part is returned as a complete address. (cherry picked from commit 8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9) Excludes changes to Lib/email/_header_value_parser.py, which did not exist in 2.7. Co-authored-by: jpic <jpic@users.noreply.github.com> https://bugs.python.org/issue34155
* closes bpo-36712: Fix duplicate method in ↵Zackery Spytz2019-09-111-5/+0
| | | | Lib/email/test/test_email_renamed.py. (GH-14800)
* closes bpo-36711: Remove duplicate method in Lib/email/feedparser.py. (GH-14801)Zackery Spytz2019-09-111-20/+0
|
* [2.7] bpo-34410: Fix a crash in the tee iterator when re-enter it. ↵Serhiy Storchaka2019-09-091-0/+41
| | | | | | | (GH-15625) (GH-15740) RuntimeError is now raised in this case. (cherry picked from commit 526a01467b3277f9fcf7f91e66c23321caa1245d)
* closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. ↵Miss Islington (bot)2019-08-281-1/+2
| | | | | | | | | | | | (GH-15560) https://bugs.python.org/issue37965 https://bugs.python.org/issue37965 Automerge-Triggered-By: @benjaminp (cherry picked from commit 55aabee07501e1468082b3237620e4ecd75c5da6) Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* test_multiprocessing removes temporary files (GH-15421)Victor Stinner2019-08-231-0/+2
| | | (cherry picked from commit d0b10a64351069aa9246d40cb8bd207cc9209cee)
* bpo-35518: Skip test that relies on a deceased network service. (GH-15349)Miss Islington (bot)2019-08-211-0/+1
| | | | | | | | | | | | | | | | 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 5b95a1507e349da5adae6d2ab57deac3bdd12f15) Co-authored-by: Greg Price <gnprice@gmail.com>
* closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package ↵Miss Islington (bot)2019-07-241-4/+4
| | | | | | | rather than listdir. (14942) (cherry picked from commit 93e8aa62cfd0a61efed4a61a2ffc2283ae986ef2) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [2.7] bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469) ↵Miss Islington (bot)2019-06-301-0/+2
| | | | | | | | | | | | (GH-14475) * Added documentation for textwrap.dedent behavior. (cherry picked from commit eb97b9211e7c99841d6cae8c63893b3525d5a401) Co-authored-by: tmblweed <tmblweed@users.noreply.github.com> https://bugs.python.org/issue30754
* [2.7] bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394) (GH-14404)Miss Islington (bot)2019-06-261-26/+56
| | | | | | | | | | | 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 5150d327924959639215ed0a78feffc0d88258da) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37124: Fix reference leak in test_msilib (GH-13750) (GH-14340)Victor Stinner2019-06-241-0/+1
| | | (cherry picked from commit c0295dba259accc4b247beb22a0b2cc2f31d9850)
* bpo-37359: Add --cleanup option to python3 -m test (GH-14332) (GH-14333)Victor Stinner2019-06-241-1/+20
| | | | | | | * 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 47fbc4e45b35b3111e2d947a66490a43ac21d363)
* Improve threading.daemon docstring (GH-14278)Miss Islington (bot)2019-06-231-2/+1
| | | | | | 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 bb110cc2ed81447fb48805f31146cf31323a8fc3) Co-authored-by: mbarkhau <mbarkhau@gmail.com>
* bpo-37362: test_gdb now ignores stderr (GH-14287) (GH-14297)Victor Stinner2019-06-211-34/+13
| | | | | | | 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 e56a123fd0acaa295a28b98d2e46d956b97d1263)
* [2.7] Fix 2.7 test -R test_IDLE failure on Windows (GH-13958)Terry Jan Reedy2019-06-161-2/+2
| | | Cherry-picked from 66d47da.
* [2.7] bpo-35647: Fix path check in cookiejar. (GH-11436) (GH-13427)Xtreak2019-06-152-5/+38
|
* [2.7] bpo-35121: prefix dot in domain for proper subdomain validation ↵Xtreak2019-06-152-2/+41
| | | | | | | | (GH-10258) (GH-13426) This is a manual backport of ca7fe5063593958e5efdf90f068582837f07bd14 since 2.7 has `http.cookiejar` in `cookielib` https://bugs.python.org/issue35121
* [2.7] bpo-36742: Fix urlparse.urlsplit() error message for Unicode URL ↵Victor Stinner2019-06-112-2/+12
| | | | | | | | (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.
* [2.7] bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13906)Eric Wieser2019-06-081-0/+15
|
* [2.7] bpo-37177: make IDLE's search dialogs transient (GH-13869)Tal Einat2019-06-072-5/+8
| | | | | This avoids the search dialogs being hidden behind the editor window. (cherry picked from commit 554450fb4e95066e825bdb4a2d544a490daeebdc)
* bpo-36742: Corrects fix to handle decomposition in usernames (GH-13812)Steve Dower2019-06-042-12/+13
|
* [2.7] bpo-12639: msilib.Directory.start_component() fails if *keyfile* is ↵Miss Islington (bot)2019-05-312-1/+9
| | | | | | | | | | 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 c8d5bf6c3fa09b43f6a5ee779d493d251dbcc53c) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-26423: Fix test_descr.test_wrap_lenfunc_bad_cast() on 32-bit Windows ↵Victor Stinner2019-05-281-1/+5
| | | | | (GH-13629) Skip the test if xrange(sys.maxsize) raises an OverflowError.
* bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606) (GH-13625)Victor Stinner2019-05-281-0/+4
| | | | | | Fix possible overflow in wrap_lenfunc() when sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows). (cherry picked from commit 05f16416d99dc9fc76fef11e56f16593e7a5955e)
* bpo-36713: Rename duplicated method in test_unicode. (#13525)Michele Angrisano2019-05-231-1/+1
| | | | | 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
* bpo-35907: Complete test_urllib.test_local_file_open() (GH-13506)Victor Stinner2019-05-221-1/+5
| | | | Test also URLopener().open(), URLopener().retrieve(), and DummyURLopener().retrieve().
* bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-11842)SH2019-05-212-1/+10
| | | CVE-2019-9948: Avoid file reading as disallowing the unnecessary URL scheme in urllib.urlopen().
* bpo-30458: Disallow control chars in http URLs (GH-12755) (GH-13154) (GH-13315)Victor Stinner2019-05-214-2/+98
| | | | | | | | | | | | | | | | | | | | | | | 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 7e200e0763f5b71c199aaf98bd5588f291585619) 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.
* [2.7] Update idlelib NEWS.txt for 2.7 (GH-13436)Terry Jan Reedy2019-05-201-1/+9
|
* closes bpo-36755: Suppress noisy error output in test HTTPS server by ↵Benjamin Peterson2019-05-171-0/+5
| | | | | | | 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.
* [2.7] bpo-36807: When saving a file in IDLE, call flush and fsync (GH-13102) ↵Terry Jan Reedy2019-05-131-0/+2
| | | | (GH-13293)
* [2.7] bpo-35925: Skip SSL tests that fail due to weak external certs or old ↵Gregory P. Smith2019-05-131-0/+33
| | | | | | | | | | | | | | | | | | | | 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
* [2.7] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192) ↵Gregory P. Smith2019-05-092-14/+66
| | | | | | | | | | | | | | | | | (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 6bd81734de0b73f1431880d6a75fb71bcbc65fa1) 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>
* [2.7] bpo-14546: Fix the argument handling in Tools/scripts/lll.py ↵Zackery Spytz2019-05-021-0/+27
| | | | | (GH-13026) (GH-13063) (cherry picked from commit c4e78b116f9a4299f3b3bfbbd18ef49782bb1143)
* Change bisect to bisect_cmd in docstring (GH-13040)Miss Islington (bot)2019-05-021-3/+3
| | | | | (cherry picked from commit 11e4a941e9c6225776a986b05230a1963e83f4fb) Co-authored-by: Xtreak <tir.karthi@gmail.com>
* bpo-36742: Fixes handling of pre-normalization characters in urlsplit() ↵Steve Dower2019-05-012-4/+13
| | | | (GH-13017)
* bpo-35952: Sync test.pythoninfo from master (GH-13010)Victor Stinner2019-04-291-8/+65
|
* bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) ↵Victor Stinner2019-04-252-3/+13
| | | | | | | | | (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).
* bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12751)Victor Stinner2019-04-091-0/+3
| | | | Set CUSTOMIZED_OSX_COMPILER to True to disable _osx_support.customize_compiler().
* bpo-36560: Fix reference leak hunting in regrtest (GH-12744) (GH-12745)Victor Stinner2019-04-091-18/+38
| | | | | | | | | | | | | | | | | 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 5aaac94eeb44697e92b0951385cd557bc27e0f6a)
* bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). ↵Zackery Spytz2019-04-031-0/+6
| | | | | (GH-12660) (GH-12678) (cherry picked from commit 487b73ab39c80157474821ef9083f51e0846bd62)
* bpo-31292: Fixed distutils check --restructuredtext for include directives ↵Miss Islington (bot)2019-03-273-2/+18
| | | | | | | (GH-10605) (cherry picked from commit d5a5a33f12b60129d57f9b423b77d2fcba506834) Co-authored-by: Philipp A <flying-sheep@web.de>
* bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12417)Victor Stinner2019-03-181-13/+82
| | | | | | The test test_customize_compiler() now mocks all sysconfig variables and all environment variables used by customize_compiler(). (cherry picked from commit 72c7b372cf145fded93a9a776acc742a60090f95)
* bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236) (GH-12349)Victor Stinner2019-03-152-4/+29
| | | | | | | | | | 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 86082c22d23285995a32aabb491527c9f5629556)
* [3.7] bpo-36216: Only print test messages when verbose (GH-12291)Steve Dower2019-03-121-1/+2
|