<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/clinic, branch 3.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/clinic?h=3.8</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/clinic?h=3.8'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2023-01-20T22:20:09Z</updated>
<entry>
<title>[3.8] Correct CVE-2020-10735 documentation (GH-100306) (#100698)</title>
<updated>2023-01-20T22:20:09Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2023-01-20T22:20:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=594ba1901cd0ad49e353bc10a031be439856ccbf'/>
<id>urn:sha1:594ba1901cd0ad49e353bc10a031be439856ccbf</id>
<content type='text'>
(cherry picked from commit 1cf3d78c92eb07dc09d15cc2e773b0b1b9436825)
(cherry picked from commit 88fe8d701af3316c8869ea18ea1c7acec6f68c04)

Co-authored-by: Jeremy Paige &lt;ucodery@gmail.com&gt;
Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
</entry>
<entry>
<title>[3.8] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96503)</title>
<updated>2022-09-05T20:26:09Z</updated>
<author>
<name>Gregory P. Smith</name>
<email>greg@krypto.org</email>
</author>
<published>2022-09-05T20:26:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b5e331fdb38684808ffc540d53e8595bdc408b89'/>
<id>urn:sha1:b5e331fdb38684808ffc540d53e8595bdc408b89</id>
<content type='text'>
* Correctly pre-check for int-to-str conversion

Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =)

The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact.

The justification for the current check. The C code check is:
```c
max_str_digits / (3 * PyLong_SHIFT) &lt;= (size_a - 11) / 10
```

In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is:
$$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$

From this it follows that
$$\frac{M}{3L} &lt; \frac{s-1}{10}$$
hence that
$$\frac{L(s-1)}{M} &gt; \frac{10}{3} &gt; \log_2(10).$$
So
$$2^{L(s-1)} &gt; 10^M.$$
But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check.

&lt;!-- gh-issue-number: gh-95778 --&gt;
* Issue: gh-95778
&lt;!-- /gh-issue-number --&gt;

Co-authored-by: Gregory P. Smith [Google LLC] &lt;greg@krypto.org&gt;
Co-authored-by: Christian Heimes &lt;christian@python.org&gt;
Co-authored-by: Mark Dickinson &lt;dickinsm@gmail.com&gt;</content>
</entry>
<entry>
<title>bpo-38237: Shorter docstring (GH-16322) (GH-16323)</title>
<updated>2019-09-21T20:32:07Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-09-21T20:32:07Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=24231ca75c721c8167a7394deb300727ccdcba51'/>
<id>urn:sha1:24231ca75c721c8167a7394deb300727ccdcba51</id>
<content type='text'>
(cherry picked from commit b104ecbbafc14f9ca0c8371963c45dca893f6b75)

Co-authored-by: Raymond Hettinger &lt;rhettinger@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>bpo-38237: Let pow() support keyword arguments (GH-16302) (GH-16320)</title>
<updated>2019-09-21T08:22:29Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2019-09-21T08:22:29Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=37bc93552375cb1bc616927b5c1905bae3c0e99d'/>
<id>urn:sha1:37bc93552375cb1bc616927b5c1905bae3c0e99d</id>
<content type='text'>
Backported with release manager approval</content>
</entry>
<entry>
<title>[3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141)</title>
<updated>2019-09-14T10:31:50Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-09-14T10:31:50Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d322abbb83eb751045246a70f39d040d13a6108b'/>
<id>urn:sha1:d322abbb83eb751045246a70f39d040d13a6108b</id>
<content type='text'>
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values
(like in the optional third parameter of getattr). "None" should be used if None is accepted
as argument and passing None has the same effect as not passing the argument at all.
(cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497)

Co-authored-by: Serhiy Storchaka &lt;storchaka@gmail.com&gt;</content>
</entry>
<entry>
<title>[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)</title>
<updated>2019-08-29T15:29:59Z</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-08-29T15:29:59Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=96631dcb11c2786f470d4586bf23ecca14361506'/>
<id>urn:sha1:96631dcb11c2786f470d4586bf23ecca14361506</id>
<content type='text'>
(cherry picked from commit 4901fe274bc82b95dc89bcb3de8802a3dfedab32)

Co-authored-by: Rémi Lapeyre &lt;remi.lapeyre@henki.fr&gt;</content>
</entry>
<entry>
<title>[3.8] bpo-37942: Improve argument clinic float converter (GH-15470) (GH-15480)</title>
<updated>2019-08-25T02:45:12Z</updated>
<author>
<name>Raymond Hettinger</name>
<email>rhettinger@users.noreply.github.com</email>
</author>
<published>2019-08-25T02:45:12Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=21161d73d979012ec3b7247261178b3aa1555486'/>
<id>urn:sha1:21161d73d979012ec3b7247261178b3aa1555486</id>
<content type='text'>
(cherry picked from commit aef9ad82f7f667cd001a7112d3bc636e918626f7)</content>
</entry>
<entry>
<title>bpo-35766: compile(): rename feature_version parameter (GH-13994) (GH-14001)</title>
<updated>2019-06-12T14:17:05Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-06-12T14:17:05Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b2fd32b2f041402bb9fc8607f01566c055aafed9'/>
<id>urn:sha1:b2fd32b2f041402bb9fc8607f01566c055aafed9</id>
<content type='text'>
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 efdf6ca90f7702824e7aeee1ceca949e7c20288a)</content>
</entry>
<entry>
<title>bpo-36933: Remove sys.set_coroutine_wrapper (marked for removal in 3.8) (GH-13577)</title>
<updated>2019-05-28T07:10:59Z</updated>
<author>
<name>Matthias Bussonnier</name>
<email>bussonniermatthias@gmail.com</email>
</author>
<published>2019-05-28T07:10:59Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=3880f263d2994fb1eba25835dddccb0cf696fdf0'/>
<id>urn:sha1:3880f263d2994fb1eba25835dddccb0cf696fdf0</id>
<content type='text'>
It has been documented as deprecated and to be removed in 3.8; 

From a comment on another thread – which I can't find ; leave get_coro_wrapper() for now, but always return `None`.


https://bugs.python.org/issue36933</content>
</entry>
<entry>
<title>bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)</title>
<updated>2019-05-27T06:57:14Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-05-27T06:57:14Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=71c52e3048dd07567f0c690eab4e5d57be66f534'/>
<id>urn:sha1:71c52e3048dd07567f0c690eab4e5d57be66f534</id>
<content type='text'>
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs.
* Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call()
  and gc delete_garbage().</content>
</entry>
</feed>
