If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
(cherry picked from commit 607501abb4)
There was a race condition in base64 in lazy initialization of multiple globals.
(cherry picked from commit 9655434cca)
Co-authored-by: Brandon Stansbury <brandonrstansbury@gmail.com>
Signed-off-by: Tao He <sighingnow@gmail.com>
(cherry picked from commit 3631d6deab)
Co-authored-by: Tao He <sighingnow@gmail.com>
Co-authored-by: Tao He <sighingnow@gmail.com>
The descriptions of the `codes` and `messages` dictionaries in
`xml.parsers.expat.errors` were swapped, and this commit swaps them
back. For example, `codes` maps string descriptions of errors to numeric
error codes, not the other way around.
(cherry picked from commit 84402eb110)
Co-authored-by: Michael Wayne Goodman <goodman.m.w@gmail.com>
Objects which belong to different Tcl interpreters are now always
different, even if they have the same name.
(cherry picked from commit 1df56bc059)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Tk can internally support bignum even if Tkinter is built without
support of bignum.
(cherry picked from commit 156b7f7052)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
The `pages` argument default value now reflects the implementation.
(cherry picked from commit abba83b4b9)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Every test for widget option starts now with "test_configure_"
to distinguish it from tests for widget commands.
(cherry picked from commit c1ae21c965)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
for multiple inheritance support:
use super().new
pass **kwds to super().new
(cherry picked from commit 786d97a66c)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
It did not work because the signature of code object constructor
was changed. Also, it used old format of bytecode (pre-wordcode).
(cherry picked from commit 954a7427ba)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
When the modern text= spelling of the universal_newlines= parameter was added
for Python 3.7, check_output's special case around input=None was overlooked.
So it behaved differently with universal_newlines=True vs text=True. This
reconciles the behavior to be consistent and adds a test to guarantee it.
Also clarifies the existing check_output documentation.
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
(cherry picked from commit 64abf37344)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
It was causing CI failures. the offending file came from https://github.com/python/cpython/pull/23917
```
python3 tools/rstlint.py ../Misc/NEWS.d/next/
[2] ../Misc/NEWS.d/next/Library/2020-12-23-19-43-06.bpo-42727.WH3ODh.rst:1: default role used
[2] ../Misc/NEWS.d/next/Library/2020-12-23-19-43-06.bpo-42727.WH3ODh.rst:2: default role used
2 problems with severity 2 found.
Makefile:204: recipe for target 'check' failed
```
(cherry picked from commit 8badadec53)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
On Fedora 31 gdb is using python 3.7.9, calling `proxyval` on an instance with a dictionary fails because of the `dict.iteritems` usage. This PR changes the code to be compatible with py2 and py3.
This changed seemed small enough to not need an issue and news blurb, if one is required please let me know.
Automerge-Triggered-By: GH:benjaminp
(cherry picked from commit b57ada98da)
Co-authored-by: Augusto Hack <hack.augusto@gmail.com>
Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.
(cherry picked from commit 6dd3da3cf4)
Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).
The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did..
(cherry picked from commit dcc997cd28)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural. For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this:
try:
self.getInputValue()
return True
except (InputErrors, SomethingElse):
return False
As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple. However, the reference documentation was never updated to match this new restriction. Make it clear that the definition is no longer recursive.
Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c95f8bc270)
Co-authored-by: Colin Watson <cjwatson@debian.org>
Co-authored-by: Colin Watson <cjwatson@debian.org>
Now all platforms use a value for the "EXT_SUFFIX" build variable derived
from SOABI (for instance in FreeBSD, "EXT_SUFFIX" is now ".cpython-310d.so"
instead of ".so"). Previously only Linux, Mac and VxWorks were using a value
for "EXT_SUFFIX" that included "SOABI".
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit a44ce6c9f7)
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Matti Picus <matti.picus@gmail.com>
* Explain when the conversion is not possible with detect_types enabled
(cherry picked from commit 09a36cdfb7)
Co-authored-by: sblondon <sblondon@users.noreply.github.com>
Co-authored-by: sblondon <sblondon@users.noreply.github.com>
* Tkinter functions and constructors which need a default root window
raise now RuntimeError with descriptive message instead of obscure
AttributeError or NameError if it is not created yet or cannot
be created automatically.
* Add tests for all functions which use default root window.
* Fix import in the pynche script.
(cherry picked from commit 3d569fd6dc)