Some FreeBSD buildbots fail to run this test as the eof was not being received by the server if the size is not big enough. This behaviour only appears if the client is using TLS1.3.
(cherry picked from commit f6a47f3e31)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Adds configure flags for msan and ubsan builds to make it easier to enable.
These also encode the detail that address sanitizer and memory sanitizer
should disable pymalloc.
Define MEMORY_SANITIZER when appropriate at build time and adds workarounds
to existing code to mark things as initialized where the sanitizer is otherwise unable to
determine that. This lets our build succeed under the memory sanitizer. not all tests
pass without sanitizer failures yet but we're in pretty good shape after this.
(cherry picked from commit 1584a00815)
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
* universal_newlines defaulting to False would suggest, that not
specifying universal_newlines explicitly and setting text to True
should cause an error, which is not the case.
* The run function didn't have the universal_newlines parameter
documented
* The check_output function didn't have its text parameter documented
(cherry picked from commit 7432f0929f)
Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
The documentation was not covering multiple targets enclosed by
parenthesis nor multiple targets enclosed by brackets, adding them all
would be heavy, an else cover them all and is lighter to read.
(cherry picked from commit 082875dcd6)
Co-authored-by: Julien Palard <julien@palard.fr>
This function may access memory which is mapped but is considered
free by libc allocator. It behaves so by design, therefore we
need to suppress sanitizer reports.
GCC doesn't support MSan, so disable only TSan for it.
(cherry picked from commit fd3a91cbf9)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
The System Preferences Dock "prefer tabs always" setting disables some
IDLE features. Menus are a bit different than as described for Windows
and Linux.
(cherry picked from commit 50ff02b431)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
1) Convert weird field name "typ" to the more standard "type".
2) For the NUMBER type, convert the value to an int() or float().
3) Simplify ``group(kind)`` to the shorter and faster ``group()`` call.
4) Simplify logic go a single if-elif chain to make this easier to extend.
5) Reorder the tests to match the order the tokens are specified.
This isn't necessary for correctness but does make the example
easier to follow.
6) Move the "column" calculation before the if-elif chain so that
users have the option of using this value in error messages.
(cherry picked from commit b83942c755)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This typo doesn't affect the result because wrong bits are discarded
on implicit conversion to unsigned char, but it trips UBSan
with -fsanitize=implicit-integer-truncation.
https://bugs.python.org/issue35194
(cherry picked from commit 7a69cf47a9)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Fix an off by one error in the peephole optimizer when checking for unreachable code beyond a return.
Do a bounds check within find_op so it can return before going past the end as a safety measure.
7db3c48833GH-diff-a33329ae6ae0bb295d742f0caf93c137
introduced this off by one error while fixing another one nearby.
This bug was shipped in all Python 3.6 and 3.7 releases.
The included unittest won't fail unless you do a clang msan build.
(cherry picked from commit 49fa4a9f1e)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Pydoc now does not duplicate docstrings for aliases of inherited methods.
(cherry picked from commit a44d34e179)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This reverts commit c64583b6d3 due to multiple buildbot failures when building it.
(cherry picked from commit 6843ffe453)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
The constructor of subprocess.CalledProcessError in the check_output function had an extra None in it.
(cherry picked from commit b93925047a)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.
We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.
(cherry picked from commit c64583b6d3)
Co-authored-by: samstagern <30337691+samstagern@users.noreply.github.com>
The test depended on '/usr/share/zoneinfo/posixrules' or equivalent
because it set TZ without explicit DST transition rules. At least
on OpenSUSE Tumbleweed that file is linked to '/etc/localtime',
making the test fail with certain local timezones,
such as 'Europe/Moscow' which doesn't have DST transitions since 2011.
(cherry picked from commit f1b9ad3d38)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
(This should have been done with the first PR for this issue.)
(cherry picked from commit f1d3efc2fb)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
The section is renamed from "IDLE -- console differences". It mostly
covers the implications of using custom sys.stdxxx objects.
(cherry picked from commit 5e79090324)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
§31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5.
(cherry picked from commit 16c8a53490)
Co-authored-by: E Kawashima <e-kwsm@users.noreply.github.com>
Two kind of mistakes:
1. Missed space. After concatenating there is no space between words.
2. Missed comma. Causes unintentional concatenating in a list of strings.
(cherry picked from commit 34fd4c2019)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted..
(cherry picked from commit b942707fc2)
Co-authored-by: BNMetrics <luna@bnmetrics.com>
* Include memo in the documented signature of copy.deepcopy()
The memo argument is mentioned lower on the doc page under writing a
`__deepcopy__` method, but is not included in the documented function signature.
This makes it easy to miss, and can lead to incorrect/buggy implementations of
`__deepcopy__` -- which is exatly what just happpend to me!
(cherry picked from commit 0200928e8d)
Co-authored-by: Stephan Hoyer <shoyer@gmail.com>
Needs backport to 3.7. In 3.6 the description is correct.
(cherry picked from commit b83d917faf)
Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>
Don't call _Py_FatalError_PrintExc() nor flush_std_files() if the
current thread doesn't hold the GIL, or if the current thread
has no Python state thread.
(cherry picked from commit 3a228ab17c)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf)
Co-authored-by: Xiang Zhang <angwerzx@126.com>