Commit Graph

44641 Commits

Author SHA1 Message Date
Miss Islington (bot) b4cd6ba1a0
bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)
The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
(cherry picked from commit 1da4462765)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-05 02:03:23 -07:00
Łukasz Langa cd400a12ba Python 3.8.0b2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl0d2fwACgkQsmmV4xAl
 BWgAYg/9FgqsWvZqNT8Hqoq83KfuqRhVW1nP6PPRXxIC9cmuEiUhpnFoNsfO8YmQ
 MHYKgTsbS/66BYx92B9ZtksgREbIOWKUE+P/HvPNwdQwSWwxD+xZNtryAD095qcS
 aBl3hhFvb5+s855xPrku952E5vT6I/oJtARMyAfR0EFb5p9raKDZpLuxbuyacyip
 uWQuDFMWjTKYGrhSaMGZfZ7/B/avw5XUpUKpLjbQtGogaZh67XG8P5iXWND1xwA5
 0i50WSky6hf/+/ZAoWFjOjE5khsA+A/OXlGfN0O0HuWbphKXWa0eeWSSMN+CCa3t
 SLdEfFmNzFMqZUwwbpRfs8zhPMYmhxPmyG9Ku0X9A75SuV/RHuBZ0J8IJDsqftfp
 dhWJ2oXI2K7i4j7xBcHBbaNPHr7tmHaDPtQRi1mJ0NkufH7KIJcuY+APj7DVU6x+
 2veQUh4OD4GkFZVscBlH3LTfTtK86amdBX2Jbv7r9f2ceRpMN6loYSyGNU7oKp8F
 GnQZ6emhfy5H0tIiO1ULHpHXQEc8F/Z2tyYdKOxetSzGYYxNIRXevARODfEg5vHI
 UWW0kpEa6xHz4TnnD7QVAIRAUnHh4cnfcSY2kGW41Z/4AeGinbC6PxaOtkQSVNds
 z9CaUM4KE0mYDGS4Kl9Zf2fqUQZQONH+nN4aWFYOglAIijcZvDI=
 =WxN7
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl0ec3gQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaNsHD/4oUuazRgyvAtIOr5xqOvuJgqDMS4ALFhBs
 TzJpnENjhp34IoJbuHbWAlTs5rkYtDJUWI2hbN2kXdVzJu+KHRAXhuyHFAypiG+0
 kIbE/Bgq/kTi0tq+AadqGzTfcLFcDwGSCRF1N3gpy/Fcda39DEQtE52fQYlQGDlG
 zFeEV/zp3dQzknONzcgsy86rkfktAkz81aq+jE5dCGdL4WhfRQwpDg3BfidgGQzM
 xVmfw3TCVtypca5xtOJS3k+Riij0r+exdoznKwtiwl0T000ddIKxn69Vi1HdY3uJ
 ZvDui5xpHpt9L9eF3UG37GbgNDYfGdprd1jE0ZZ3F4k6tvMm2ZIwR+Twb66vRENv
 l6Oz0BBsmbB9as7gXCecxhuQ41mWry5dVsw2/rCnDo/P/yCEAINLd3PT1BF+ksSW
 DBfhUfr2XtzDvsVVPTb0gDnVedD/5mT0GGSAfga04sUqIUc8zAK+UULXrrzEvVvk
 H0mjwu3mhqm7neCww5/T4nXjNq1nGmxzrzLGTu+q7DdJWDohIeZmuCt/I6lAS7Zk
 iWQvMxwLb/I+SD0yOObRCGg/jgatINBbZ83CpqsZFiHB4HKHkBrzXfV1NVEpq2dL
 zHCwyIW5x8a+aWqqw5GnEMf5T05L2tH/+b/QjGgPpL37Mj8sHt7pDmDCyGEuoeFU
 SphOXlbMlQ==
 =ddvL
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.0b2' into 3.8

Python 3.8.0b2
2019-07-04 23:45:23 +02:00
Miss Islington (bot) 957656ee1d
bpo-37421: Fix multiprocessing get_temp_dir() finalizer (GH-14572)
Fix multiprocessing.util.get_temp_dir() finalizer: clear also the
'tempdir' configuration of the current process, so next call to
get_temp_dir() will create a new temporary directory, rather than
reusing the removed temporary directory.
(cherry picked from commit 9d40554e0d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-04 04:34:31 -07:00
Łukasz Langa 21dd01dad7
Python 3.8.0b2 2019-07-04 12:50:19 +02:00
Miss Islington (bot) 0aefba7f99
bpo-37421: Fix test_distutils.test_build_ext() (GH-14564)
test_distutils.test_build_ext() is now able to remove the temporary
directory on Windows: don't import the newly built C extension ("xx")
in the current process, but test it in a separated process.
(cherry picked from commit 74c9dd5777)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-03 02:48:14 -07:00
Miss Islington (bot) 79665c698f
bpo-37421: test_concurrent_futures cleans up multiprocessing (GH-14563)
test_concurrent_futures now cleans up multiprocessing to remove
immediately temporary directories created by
multiprocessing.util.get_temp_dir().

The test now uses setUpModule() and tearDownModule().
(cherry picked from commit 684cb47fff)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-03 02:36:13 -07:00
Miss Islington (bot) a2a807f75d
bpo-37421: test_winconsoleio doesn't leak temp file anymore (GH-14562)
test_winconsoleio doesn't leak a temporary file anymore: use
tempfile.TemporaryFile() to remove it when the test completes.
(cherry picked from commit b71d8d6795)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-03 02:31:39 -07:00
Miss Islington (bot) 3cba3d3c55
bpo-37463: match_hostname requires quad-dotted IPv4 (GH-14499)
ssl.match_hostname() no longer accepts IPv4 addresses with additional text
after the address and only quad-dotted notation without trailing
whitespaces. Some inet_aton() implementations ignore whitespace and all data
after whitespace, e.g. '127.0.0.1 whatever'.

Short notations like '127.1' for '127.0.0.1' were already filtered out.

The bug was initially found by Dominik Czarnota and reported by Paul Kehrer.

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

https://bugs.python.org/issue37463
(cherry picked from commit 477b1b2576)

Co-authored-by: Christian Heimes <christian@python.org>
2019-07-02 14:06:18 -07:00
Miss Islington (bot) 632cb36084
bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527)
multiprocessing tests now call explicitly _run_finalizers() to remove
immediately temporary directories created by
multiprocessing.util.get_temp_dir().
(cherry picked from commit 039fb49c18)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-02 04:58:05 -07:00
Miss Islington (bot) 518dc94e42
bpo-37335, test_c_locale_coercion: Remove unnecessary code (GH-14447)
Python initialization now ensures that sys stream encoding
names are always normalized by codecs.lookup(encoding).name.
Simplify test_c_locale_coercion: it doesn't have to normalize
encoding names anymore.
(cherry picked from commit 61bf97e916)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2019-07-02 04:18:40 -07:00
Miss Islington (bot) bd92b94da9
bpo-34602: Avoid failures setting macOS stack resource limit (GH-14546)
Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  Reverting the change to the interpreter stack size at link
time helped for release builds but caused some tests to fail when
built --with-pydebug.  Try the opposite approach: continue to build
the interpreter with an increased stack size on macOS and remove
the failing setrlimit call in regrtest initialization.  This will
definitely avoid the resource.RLIMIT_STACK error and should have
no, or fewer, side effects.
(cherry picked from commit 5bbbc733e6)

Co-authored-by: Ned Deily <nad@python.org>
2019-07-02 00:31:07 -07:00
Miss Islington (bot) 746992c1ae
bpo-37363: Add audit events on startup for the run commands (GH-14524)
(cherry picked from commit e226e83d36)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-07-01 16:22:29 -07:00
Miss Islington (bot) 4c227e6a56
bpo-36763: Use PyConfig_Clear() (GH-14445)
Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().
(cherry picked from commit 67310023f2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-01 11:28:55 -07:00
Victor Stinner 466e18e8c2
Remove unused imports in tests (GH-14518) (GH-14520)
(cherry picked from commit 8f4ef3b019)
2019-07-01 19:01:52 +02:00
Miss Islington (bot) 2683ded568
bpo-37467: Fix PyErr_Display() for bytes filename (GH-14504)
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes
string. For example, for a SyntaxError exception where the filename
attribute is a bytes string.

Cleanup also test_sys:

* Sort imports.
* Rename numruns global var to INTERN_NUMRUNS.
* Add DisplayHookTest and ExceptHookTest test case classes.
* Don't save/restore sys.stdout and sys.displayhook using
  setUp()/tearDown(): do it in each test method.
* Test error case (call hook with no argument) after the success case.
(cherry picked from commit f9b7457bd7)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-01 08:11:15 -07:00
Miss Islington (bot) be5bb52f5f
bpo-10945: Drop support for bdist_wininst on non-Windows systems (GH-14506)
bdist_wininst depends on MBCS codec, unavailable on non-Windows,
and bdist_wininst have not worked since at least Python 3.2, possibly
never on Python 3.

Here we document that bdist_wininst is only supported on Windows,
and we mark it unsupported otherwise to skip tests.

Distributors of Python 3 can now safely drop the bdist_wininst .exe files
without the need to skip bdist_wininst related tests.
(cherry picked from commit 72cd653c4e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2019-07-01 05:54:19 -07:00
Christian Heimes f22c4cf11d
[3.8] bpo-37428: Don't set PHA verify flag on client side (GH-14494)
SSLContext.post_handshake_auth = True no longer sets
SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
option is documented as ignored for clients, OpenSSL implicitly enables cert
chain validation when the flag is set.

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

https://bugs.python.org/issue37428
(cherry picked from commit f0f5930ac8)
2019-07-01 09:25:48 +02:00
Miss Islington (bot) ee72dda961
[3.8] bpo-37440: Enable TLS 1.3 post-handshake auth in http.client (GH-14448) (GH-14495)
Post-handshake authentication is required for conditional client cert authentication with TLS 1.3.


https://bugs.python.org/issue37440
(cherry picked from commit d1bd6e79da)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue37440
2019-07-01 00:07:44 -07:00
Miss Islington (bot) c2684c6d62
bpo-37199: Fix test failures when IPv6 is unavailable or disabled (GH-14480)
(cherry picked from commit c2cda638d6)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-30 08:42:22 -07:00
Miss Islington (bot) bf8cb31803
bpo-35621: Support running subprocesses in asyncio when loop is executed in non-main thread (GH-14344)
(cherry picked from commit 0d671c04c3)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-30 03:22:34 -07:00
Miss Islington (bot) ffcc161c75
bpo-29505: Add more fuzzing for re.compile, re.load and csv.reader (GH-14255)
Add more fuzz testing for re.compile, re.load and csv.reader
(cherry picked from commit 5cbbbd73a6)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2019-06-29 23:13:18 -07:00
Miss Islington (bot) 3e133c401a
bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469)
* Added documentation for textwrap.dedent behavior.
* Remove an obsolete note about pre-2.5 behavior from the docstring.
(cherry picked from commit eb97b9211e)

Co-authored-by: tmblweed <tmblweed@users.noreply.github.com>
2019-06-29 21:40:41 -07:00
Steve Dower 323e743d48
bpo-37369: Fix initialization of sys members when launched via an app container (GH-14467)
sys._base_executable is now always defined on all platforms, and can be overridden through configuration.
Also adds test.support.PythonSymlink to encapsulate platform-specific logic for symlinking sys.executable
2019-06-29 14:28:59 -07:00
Miss Islington (bot) e3761ca91c
bpo-37412: Fix test_os.test_getcwd_long_path() on macOS (GH-14452)
(cherry picked from commit 29f609ed07)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-28 11:07:10 -07:00
Miss Islington (bot) 68c1c398f3 bpo-37412: Fix os.getcwd() for long path on Windows (GH-14424) (GH-14451)
* Fix test for integer overflow.
* Add an unit test.
(cherry picked from commit ec3e20a2d1)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-28 18:23:06 +02:00
Miss Islington (bot) 4fee28aa42
bpo-37390: Add audit event table to documentations (GH-14406)
Also updates some (unreleased) event names to be consistent with the others.
(cherry picked from commit 44f91c388a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-06-27 11:07:16 -07:00
Miss Islington (bot) 6fbed5350c
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)
(cherry picked from commit 45a30af109)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-06-27 09:45:30 -07:00
Miss Islington (bot) 4cbe7a3ce4
Replace deprecation warning with RuntimeError (GH-14397)
(cherry picked from commit 97d15b1ee0)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-27 04:58:34 -07:00
Miss Islington (bot) 7fe81ce47f
bpo-37421: Fix test_shutil: don't leak temporary files (GH-14416)
* Fix typo in supports_file2file_sendfile(); ensure that dst is
  removed
* Fix test_copytree_custom_copy_function(): remove dst tree.
  Use support.rmtree() rather than shutil.rmtree() to remove
  temporary directories: support tries harder.
(cherry picked from commit 4c26abd14f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-26 16:57:49 -07:00
Miss Islington (bot) 82654a0372 bpo-29412: Fix indexError when parsing a header value ending unexpectedly (GH-14387) (GH-14411)
* patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS.
* Raise HeaderParseError instead of continuing when parsing a word.
(cherry picked from commit 7213df7bbf)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-06-26 15:05:36 -07:00
Miss Islington (bot) 5c4ce3e2fa
bpo-37417: Fix error handling in bytearray.extend. (GH-14407)
(cherry picked from commit 2a7d596f27)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-06-26 13:17:00 -07:00
Miss Islington (bot) bdbd5e895d
bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394)
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 12:38:25 -07:00
Miss Islington (bot) 63429c839b
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
The os.getcwdb() function now uses the UTF-8 encoding on Windows,
rather than the ANSI code page: see PEP 529 for the rationale. The
function is no longer deprecated on Windows.

os.getcwd() and os.getcwdb() now detect integer overflow on memory
allocations. On Unix, these functions properly report MemoryError on
memory allocation failure.
(cherry picked from commit 689830ee62)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-26 09:14:30 -07:00
Miss Islington (bot) dd4edbc5ad
bpo-37244: Fix test_multiprocessing.test_resource_tracker() (GH-14288)
Increase robustness of test_resource_tracker(): retry for 60 seconds.
(cherry picked from commit e1a63c4f21)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
2019-06-25 15:49:31 -07:00
Miss Islington (bot) 4adc38e794
bpo-36888, test_multiprocessing: Increase test_parent_process timeout (GH-14286)
(cherry picked from commit 594d9b9f58)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
2019-06-25 14:12:47 -07:00
Abhilash Raj c6e32824cf [3.8] bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError (GH-14119) (GH-14380)
When certain malformed messages have content-type set to 'mulitpart/*' but
still have a single part body, iter_attachments can raise AttributeError. This
patch fixes it by returning a None value instead when the body is single part.
(cherry picked from commit 02257012f6)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>



https://bugs.python.org/issue33972
2019-06-25 11:38:48 -07:00
Miss Islington (bot) 12d174bed9
bpo-37400: Fix test_os.test_chown() (GH-14374)
Use os.getgroups() rather than grp.getgrall() to get groups.
Rename also the test to test_chown_gid().
(cherry picked from commit d7c87d982d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-25 08:26:56 -07:00
Steve Dower 25fbe33b92
bpo-4963: Fix for initialization and non-deterministic behavior issues in mimetypes (GH-14375) 2019-06-25 08:20:43 -07:00
Jeroen Demeyer d917cfe405 [3.8] bpo-37250: put back tp_print for backwards compatibility (GH-14193)
This is a 3.8-only compatibility measure for third-party Cython-based sdists.

https://bugs.python.org/issue37250
2019-06-25 12:58:58 +02:00
Miss Islington (bot) d32594ad27
bpo-24214: Fixed the UTF-8 and UTF-16 incremental decoders. (GH-14304)
* The UTF-8 incremental decoders fails now fast if encounter
  a sequence that can't be handled by the error handler.
* The UTF-16 incremental decoders with the surrogatepass error
  handler decodes now a lone low surrogate with final=False.
(cherry picked from commit 894263ba80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-06-25 02:12:16 -07:00
Miss Islington (bot) 26fe6c3537 bpo-36974: inherit tp_vectorcall_offset unconditionally (GH-13858) (GH-14342)
(cherry picked from commit a8b27e623d)

Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
2019-06-25 10:19:16 +02:00
Miss Islington (bot) 20372d6524
bpo-37393: Fix deprecation warnings in test_ntpath. (GH-14357)
eval() was being called an extra time without a filter for
deprecation warnings.
(cherry picked from commit 9fe42b49c7)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-25 00:12:19 -07:00
Miss Islington (bot) 210358b25c bpo-36546: Mark first argument as position only (GH-14363) (GH-14364) 2019-06-25 05:07:00 +02:00
Miss Islington (bot) 5bf3b89dfb
bpo-37394: Fix pure Python implementation of the queue module (GH-14351)
(cherry picked from commit 3f5b9088b0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-24 19:14:37 -07:00
Miss Islington (bot) b183b963f6
Get rid of exception traceback printing in asyncio tests (GH-14343)
(cherry picked from commit 549f7d45c8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-24 10:21:35 -07:00
Miss Islington (bot) 8763d43a95
bpo-37363: Add audit events for a range of modules (GH-14301)
(cherry picked from commit 60419a7e96)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-06-24 09:09:47 -07:00
Miss Islington (bot) 366dac99c0
bpo-37359: Fix regrtest --cleanup (GH-14336)
(cherry picked from commit 9bbf4d7083)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-24 04:37:55 -07:00
Victor Stinner 2ec4545ebe
bpo-37359: Add --cleanup option to python3 -m test (GH-14332) (GH-14334)
* regrtest: Add --cleanup option to remove "test_python_*" directories
  of previous failed test jobs.
* Add "make cleantest" to run "python3 -m test --cleanup".

(cherry picked from commit 47fbc4e45b)
2019-06-24 12:51:47 +02:00
Miss Islington (bot) ea380f6946
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:06:21 -07:00
Miss Islington (bot) 175b2e9745
bpo-35224: Bump the pyc magic number by 1 instead of by 10 in last modification (GH-14320)
(cherry picked from commit b3ca7972c8)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-23 09:19:25 -07:00
Serhiy Storchaka 914d6b7973
[3.8] bpo-35431: Test math.comb() and math.perm() for OverflowError only on CPython. (GH-14146) (#14226)
Other implementation can raise MemoryError, but it can takes hours.
(cherry picked from commit 1b8a46d597)
2019-06-23 17:50:04 +03:00
Miss Islington (bot) 5c8b4e2b5d
bpo-35224: Bump the pyc magic number after the change in MAP_ADD (GH-14313)
(cherry picked from commit 663131a6e2)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-22 16:04:43 -07:00
Miss Islington (bot) 874ff65e0a
bpo-35224: Reverse evaluation order of key: value in dict comprehensions (GH-14139)
… as proposed in PEP 572; key is now evaluated before value.

https://bugs.python.org/issue35224
(cherry picked from commit c8a35417db)

Co-authored-by: Jörn Heissler <joernheissler@users.noreply.github.com>
2019-06-22 15:34:03 -07:00
Miss Islington (bot) 9b32b44d3e
bpo-37323: Suppress DeprecationWarning raised by @asyncio.coroutine (GH-14293)
When the test is ran with `PYTHONWARNINGS=error` the environment variable is passed to the python interpreter used in `assert_python_ok` where `DeprecationWarning` from  `@asyncio.coroutine` is converted into an error. Ignore the `DeprecationWarning` in `assert_python_ok`.

https://bugs.python.org/issue37323
(cherry picked from commit 186f70905d)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-06-22 03:43:07 -07:00
Miss Islington (bot) 35202c7637
bpo-37364: Use io.open_code() to read .pth files (GH-14299)
https://bugs.python.org/issue37364
(cherry picked from commit 184f3d4f39)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-06-21 15:35:44 -07:00
Miss Islington (bot) 3523e0c47b
bpo-37362: test_gdb now ignores stderr (GH-14287)
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)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-21 14:39:58 -07:00
Steve Dower 6c7947713a
bpo-37316: mmap.mmap() passes the wrong variable to PySys_Audit() (GH-14152)
Also, add a missing call to va_end() in PySys_Audit().
2019-06-21 09:45:13 -07:00
Miss Islington (bot) 46e9f15dc9 Fix typo, 'widger' -> 'widget', in idlelib/tree.py (GH-14263) (#14270)
(cherry picked from commit 8713aa6dfb)

Co-authored-by: İsmail Arılık <arilik.ismail@gmail.com>
2019-06-20 12:50:43 -04:00
Miss Islington (bot) 95ff622028 bpo-37258: Not a bug, but added a unit test and updated documentation. (GH-14229) (GH-14230)
(cherry picked from commit 0150001653)
2019-06-19 14:46:55 +01:00
Serhiy Storchaka f5b89afde1
bpo-37163: Deprecate passing argument obj of dataclasses.replace() by keyword. (GH-13877) 2019-06-19 10:33:27 +03:00
Miss Islington (bot) b626b113ae
bpo-37325: Fix focus traversal for 2 IDLE dialogs (GH-14209)
Tab now moves focus across and down for Help Source and Custom Run.
(cherry picked from commit 54cf2e0780)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-18 14:36:09 -07:00
Miss Islington (bot) 35aa0b0ced
bpo-34903: Document that some strptime formats only require 1 digit (GH-14149)
For datetime.datetime.strptime(), the leading zero for some two-digit formats is optional.

This adds a footnote to the strftime/strptime documentation to reflect this fact, and adds some tests to ensure that it is true.

bpo-34903
(cherry picked from commit 6b9c204ee7)

Co-authored-by: Mike Gleen <mike.gleen@gmail.com>
2019-06-18 12:21:27 -07:00
Miss Islington (bot) f49c85d0cb
bpo-35031: also disable TLS 1.3 for test_start_tls_server_1 on macOS (GH-14188)
(cherry picked from commit a514f782b8)

Co-authored-by: Ned Deily <nad@python.org>
2019-06-18 01:56:51 -07:00
Miss Islington (bot) ae526ee320
bpo-5680: IDLE: Customize running a module (GH-13763)
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
(cherry picked from commit 201bc2d18b)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-17 19:47:55 -07:00
Miss Islington (bot) 69610f86d3
Fix test_embed.test_pre_initialization_sys_options() env vars (GH-14172)
test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.
(cherry picked from commit dbdc991a62)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-17 15:31:43 -07:00
Miss Islington (bot) 02f7f741e8
bpo-37321: Edit IDLE subprocess connection error messages. (GH-14170)
Mainly, add a doc reference to message in pyshell.
(cherry picked from commit 8fac122109)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-17 14:51:08 -07:00
Miss Islington (bot) 4b68a8eb0d bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678) (GH-14168)
Measure required height by quickly maximizing once per screen.
A search for a better method failed.
(cherry picked from commit 5bff3c86ab)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-06-17 16:15:53 -04:00
Miss Islington (bot) 988fff5d0e
bpo-36922: use Py_TPFLAGS_METHOD_DESCRIPTOR in lookup_maybe_method() (GH-13865)
(cherry picked from commit 2e9954d347)

Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
2019-06-17 05:12:42 -07:00
Miss Islington (bot) a5ddbfbf50
bpo-35031, test_asycio: disable TLS 1.3 in test_start_tls_server_1() (GH-14148)
bpo-35031, bpo-35998: Reintroduce workaround on Windows and FreeBSD
in test_start_tls_server_1() of test_asyncio: disable TLS v1.3 on the
client context.
(cherry picked from commit c034b7824f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-17 03:06:41 -07:00
Miss Islington (bot) 693945d45d bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051) (GH-14140)
On Windows, os.dup() no longer creates an inheritable fd when handling a
character file.
(cherry picked from commit 28fca0c422)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-17 10:45:26 +02:00
Miss Islington (bot) ad505918a1
bpo-36688: Adding an implementation of RLock in _dummy_thread (GH-12943)
(cherry picked from commit c5905f39bc)

Co-authored-by: Joost Lek <vlabakje@gmail.com>
2019-06-17 01:34:27 -07:00
Miss Islington (bot) 2acaf496b7
bpo-37220: Fix 2.7 test -R crash on Windows. (GH-13957)
The patch needed for 2.7 should make the test more stable on 3.x also.
(cherry picked from commit 66d47da86a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-16 14:10:49 -07:00
Miss Islington (bot) 58a1a76bae
bpo-35922: Fix RobotFileParser when robots.txt has no relevant crawl delay or request rate (GH-11791)
Co-Authored-By: Tal Einat <taleinat+github@gmail.com>
(cherry picked from commit 8047e0e1c6)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-06-16 00:07:54 -07:00
Miss Islington (bot) f0e5c01182
bpo-28009: Fix uuid SkipUnless logic to be based on platform programs capable of introspection (GH-12777)
uuid could try fallback methods that had no chance of working on a particular
platform, and this could cause spurious test failures, as well as degraded
performance as fallback options were tried and failed.

This fixes both the uuid module and its test's SkipUnless logic to use a
prefiltered list of techniques that may at least potentially work on that platform.

Patch by Michael Felt (aixtools).
(cherry picked from commit 3a1d50e7e5)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2019-06-15 09:10:34 -07:00
Miss Islington (bot) 687af44df8
Fix typo in Lib/concurrent/futures/thread.py (GH-13953)
(cherry picked from commit 552ace7498)

Co-authored-by: ubordignon <48903745+ubordignon@users.noreply.github.com>
2019-06-15 05:02:34 -07:00
Andrew Svetlov b6ff2cd8c5
[3.8] Use threadpool for reading from file in sendfile fallback mode (GH-14076) (GH-14102)
(cherry picked from commit 0237265e82)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-15 14:55:52 +03:00
Miss Islington (bot) bb07321c6a
bpo-37279: Fix asyncio sendfile support when extra data are sent in fallback mode. (GH-14075)
(cherry picked from commit ef2152354f)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-15 04:24:16 -07:00
Miss Islington (bot) e696b15a62
bpo-35537: Rewrite setsid test for os.posix_spawn (GH-11721)
bpo-35537, bpo-35876: Fix also test_start_new_session() of
test_subprocess: use os.getsid() rather than os.getpgid().
(cherry picked from commit 5884043252)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-14 10:49:22 -07:00
Miss Islington (bot) 3b976d19c8
bpo-37261: Document sys.unraisablehook corner cases (GH-14059)
Document reference cycle and resurrected objects issues in
sys.unraisablehook() and threading.excepthook() documentation.

Fix test.support.catch_unraisable_exception(): __exit__() no longer
ignores unraisable exceptions.

Fix test_io test_writer_close_error_on_close(): use a second
catch_unraisable_exception() to catch the BufferedWriter unraisable
exception.
(cherry picked from commit 212646cae6)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-14 09:59:54 -07:00
Miss Islington (bot) b0f6fa8d7d
bpo-19865: ctypes.create_unicode_buffer() supports non-BMP strings on Windows (GH-14081)
(cherry picked from commit 9765efcb39)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-14 09:43:22 -07:00
Miss Islington (bot) 0c2eb6d210
bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() (GH-14080)
(cherry picked from commit f0749da9a5)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-14 09:12:48 -07:00
Miss Islington (bot) 8b66dbb212
bpo-37278: Fix test_asyncio ProactorLoopCtrlC (GH-14074)
Join the thread to prevent leaking a running thread and leaking a
reference.

Cleanup also the test:

* asyncioWindowsProactorEventLoopPolicy became the default policy,
  there is no need to set it manually.
* Only start the thread once the loop is running.
* Use a shorter sleep in the thread (100 ms rather than 1 sec).
* Use close_loop(loop) rather than loop.close().
* Use longer variable names.
(cherry picked from commit 07559450b2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-14 04:53:13 -07:00
Miss Islington (bot) 7cd581a6bf
bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
Fix a regression introduced by af8646c805 that was causing code of the form:

if True and False:
   do_something()

to be optimized incorrectly, eliminating the block.
(cherry picked from commit 05f8318655)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-13 23:13:24 -07:00
Miss Islington (bot) 5282b3b1d2
bpo-37213: Handle negative line deltas correctly in the peephole optimizer (GH-13969)
The peephole optimizer was not optimizing correctly bytecode after negative deltas were introduced. This is due to the fact that some special values (255) were being searched for in both instruction pointer delta and line number deltas.
(cherry picked from commit 3498c642f4)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-13 11:35:40 -07:00
Miss Islington (bot) b4f5b21253
bpo-37261: Fix support.catch_unraisable_exception() (GH-14052)
The __exit__() method of test.support.catch_unraisable_exception
context manager now ignores unraisable exception raised when clearing
self.unraisable attribute.
(cherry picked from commit 6d22cc8e90)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-13 06:25:59 -07:00
Miss Islington (bot) cbda40db7b
bpo-37210: Fix pure Python pickle when _pickle is unavailable (GH-14016)
Allow pure Python implementation of pickle to work
even when the C _pickle module is unavailable.

Fix test_pickle when _pickle is missing: declare PyPicklerHookTests
outside "if has_c_implementation:" block.
(cherry picked from commit 63ab4ba07b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-13 05:28:11 -07:00
Victor Stinner e40a97a721
[3.8] bpo-36402: Fix threading._shutdown() race condition (GH-13948) (GH-14050)
* bpo-36402: Fix threading._shutdown() race condition (GH-13948)

Fix a race condition at Python shutdown when waiting for threads.
Wait until the Python thread state of all non-daemon threads get
deleted (join all non-daemon threads), rather than just wait until
Python threads complete.

* Add threading._shutdown_locks: set of Thread._tstate_lock locks
  of non-daemon threads used by _shutdown() to wait until all Python
  thread states get deleted. See Thread._set_tstate_lock().
* Add also threading._shutdown_locks_lock to protect access to
  threading._shutdown_locks.
* Add test_finalization_shutdown() test.

(cherry picked from commit 468e5fec8a)

* bpo-36402: Fix threading.Thread._stop() (GH-14047)

Remove the _tstate_lock from _shutdown_locks, don't remove None.

(cherry picked from commit 6f75c87375)
2019-06-13 13:44:23 +02:00
Victor Stinner c15a682603
bpo-37223: test_io: silence destructor errors (GH-14031)
* bpo-18748: Fix _pyio.IOBase destructor (closed case) (GH-13952)

_pyio.IOBase destructor now does nothing if getting the closed
attribute fails to better mimick _io.IOBase finalizer.

(cherry picked from commit 4f6f7c5a61)

* bpo-37223: test_io: silence destructor errors (GH-13954)

Implement also MockNonBlockWriterIO.seek() method.

(cherry picked from commit b589cef9c4)

* bpo-37223, test_io: silence last 'Exception ignored in:' (GH-14029)

Use catch_unraisable_exception() to ignore 'Exception ignored in:'
error when the internal BufferedWriter of the BufferedRWPair is
destroyed. The C implementation doesn't give access to the
internal BufferedWriter, so just ignore the warning instead.

(cherry picked from commit 913fa1c824)
2019-06-13 00:23:49 +02:00
Miss Islington (bot) 3955dfff60
Make asyncio stream sendfile fail on error (was hang) (GH-14025)
(cherry picked from commit 0d1942774a)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-12 12:10:44 -07:00
Miss Islington (bot) bb3e8a68b2
bpo-37201: fix test_distutils failures for Windows ARM64 (GH-13902)
(cherry picked from commit daf6262751)

Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
2019-06-12 10:44:29 -07:00
Victor Stinner b2fd32b2f0
bpo-35766: compile(): rename feature_version parameter (GH-13994) (GH-14001)
Rename compile() feature_version parameter to _feature_version and
convert it to a keyword-only parameter.

Update also test_type_comments to pass feature_version as a tuple.

(cherry picked from commit efdf6ca90f)
2019-06-12 16:17:05 +02:00
Miss Islington (bot) 70a4178ec4
bpo-35545: Skip `test_asyncio.test_create_connection_ipv6_scope` on AIX (GH-14011)
because "getaddrinfo()" behaves different on AIX

https://bugs.python.org/issue35545
(cherry picked from commit 32dda263e4)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2019-06-12 05:20:12 -07:00
Miss Islington (bot) 9d37ae0bee
bpo-36918: Fix "Exception ignored in" in test_urllib (GH-13996)
Mock the HTTPConnection.close() method in a few unit tests to avoid
logging "Exception ignored in: ..." messages.
(cherry picked from commit eb976e47e2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-11 19:26:02 -07:00
Miss Islington (bot) 3ba21070c6 bpo-35766: Change format for feature_version to (major, minor) (GH-13992) (GH-13993)
(A single int is still allowed, but undocumented.)

https://bugs.python.org/issue35766
(cherry picked from commit 10b55c1643)

Co-authored-by: Guido van Rossum <guido@python.org>
2019-06-12 02:55:28 +02:00
Abhilash Raj 36eea7af48 [3.8] bpo-36520: Email header folded incorrectly (GH-13608) (GH-13909)
* [bpo-36520](https://bugs.python.org/issue36520): reset the encoded word offset when starting a new
line during an email header folding operation

* 📜🤖 Added by blurb_it.

* [bpo-36520](https://bugs.python.org/issue36520): add an additional test case, and provide descriptive
comments for the test_folding_with_utf8_encoding_* tests

* [bpo-36520](https://bugs.python.org/issue36520): fix whitespace issue

* [bpo-36520](https://bugs.python.org/issue36520): changes per reviewer request -- remove extraneous
backslashes; add whitespace between terminating quotes and
line-continuation backslashes; use "bpo-" instead of
"issue GH-" in comments
(cherry picked from commit f6713e84af)

Co-authored-by: websurfer5 <49998481+websurfer5@users.noreply.github.com>


https://bugs.python.org/issue36520
2019-06-11 16:28:10 -07:00
Miss Islington (bot) 83abd9658b
bpo-36607: Eliminate RuntimeError raised by asyncio.all_tasks() (GH-13971)
If internal tasks weak set is changed by another thread during iteration.

https://bugs.python.org/issue36607
(cherry picked from commit 65aa64fae8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-11 13:32:12 -07:00
Miss Islington (bot) b9ecc0fada
Fix test_posix if RWF_HIPRI is defined but not preadv2. (GH-13980)
If preadv2 is not available, preadv will raise NotImplementedError.
(cherry picked from commit 44867bb937)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-06-11 10:58:57 -07:00
Miss Islington (bot) 1c31d19e35
closes bpo-33758: Skip test_get_type_hints_modules_forwardref. (GH-13977)
This test "works" if things are run in the right order, so it's better to use @skip than @expectedFailure here.
(cherry picked from commit 910b3fcb01)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-06-11 09:37:59 -07:00
Miss Islington (bot) 583ff84351 bpo-37219: Remove erroneous optimization for differencing an empty set (GH-13965) (GH-13967)
(cherry picked from commit 1f11cf9521)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-06-11 01:41:23 -07:00
Miss Islington (bot) 3f7629d93c
bpo-11122: fix hardcoded path checking for rpmbuild in bdist_rpm.py (GH-10594)
(cherry picked from commit 45a14942c9)

Co-authored-by: Marcin Niemira <marcin.niemira@gmail.com>
2019-06-08 14:25:21 -07:00