* Add a note to the PyModule_AddObject docs.
* Correct example usages of PyModule_AddObject.
* Whitespace.
* Clean up wording.
* 📜🤖 Added by blurb_it.
* First code review.
* Add < 0 in the tests with PyModule_AddObject
(cherry picked from commit 224b8aaa7e)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Does no longer work since Sphinx moved the trim_doctest_flag option in
the configuration.
(cherry picked from commit 2c910c1e73)
Co-authored-by: Julien Palard <julien@palard.fr>
Prefer client or TLSv1_2 in examples
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 894d0f7d55)
Co-authored-by: Christian Heimes <christian@python.org>
Use fdwalk() on platforms that support it to implement os.closerange().
(cherry picked from commit e20134f889)
Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable
* 📜🤖 Added by blurb_it.
* Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst
added name of the contributor
* bpo-37972: made all dunder methods chainable for _Call
* bpo-37972: delegate only attributes of tuple instead to __getattr__
(cherry picked from commit 72c359912d)
Co-authored-by: blhsing <github@ydooby.com>
This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
(cherry picked from commit 954900a3f9)
Co-authored-by: bggardner <brent@ebrent.net>
* bpo-13927: time.ctime and time.asctime return string explantion
* Add note explaining that time.ctime and time.asctime returns a space padded date value in case it contains a single digit date
* Reformat linebreaks
(cherry picked from commit 2d32bf1ef2)
Co-authored-by: Harmandeep Singh <harmandeep.singh1@delhivery.com>
The instance destructor for a type is responsible for preparing
an instance for deallocation by decrementing the reference counts
of its referents.
If an instance belongs to a heap type, the type object of an instance
has its reference count decremented while for static types, which
are permanently allocated, the type object is unaffected by the
instance destructor.
Previously, the default instance destructor searched the class
hierarchy for an inherited instance destructor and, if present,
would invoke it.
Then, if the instance type is a heap type, it would decrement the
reference count of that heap type. However, this could result in the
premature destruction of a type because the inherited instance
destructor should have already decremented the reference count
of the type object.
This change avoids the premature destruction of the type object
by suppressing the decrement of its reference count when an
inherited, non-default instance destructor has been invoked.
Finally, an assertion on the Py_SIZE of a type was deleted. Heap
types have a non zero size, making this into an incorrect assertion.
https://github.com/python/cpython/pull/15323.
(cherry picked from commit ff023ed36e)
Fixup: https://github.com/python/cpython/pull/16004.
(cherry picked from commit 5e9caeec76)
Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
The >=, checking whether a module index was in already in the module-by-index list, needed to be strict.
Also, fold nested ifs into one and fix some bad spacing.
(cherry picked from commit 39de95b746)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-36260: Add pitfalls to zipfile module documentation
We saw vulnerability warning description (including zip bomb) in Doc/library/xml.rst file.
This gave us the idea of documentation improvement.
So, we moved a little bit forward :P
And the doc patch can be found (pr).
* fix trailing whitespace
* 📜🤖 Added by blurb_it.
* Reformat text for consistency.
(cherry picked from commit 3ba51d587f)
Co-authored-by: JunWei Song <sungboss2004@gmail.com>
Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning:
```
$ python3 -m venv test
$ source test/bin/activate
(test) $ deactivate
-bash: $1: unbound variable
```
(cherry picked from commit 5209e586b7)
Co-authored-by: Daniel Abrahamsson <hamsson@gmail.com>
Since they have been removed from cgi it's useful to remind people where they
can be found instead.
(cherry picked from commit 1abf54336f)
Co-authored-by: Simon Willison <swillison@gmail.com>
* bpo-36919: make test_issue2301 implementation-independent
(cherry picked from commit b6643dcfc2)
Co-authored-by: Pavel Koneski <pavel.koneski@gmail.com>
* bpo-34519: Add additional aliases for HP Roman 8
HP Roman 8 is known under mode aliases than listed in aliases.py.
Patch by Michael Osipov.
(cherry picked from commit a828514cc3)
Co-authored-by: Michael Osipov <michael.osipov@siemens.com>