<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Modules, branch v3.9.6</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>bpo-41621: Document defaultdict's default_factory parameter (GH-21945)</title>
<updated>2021-06-22T14:42:41+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-06-22T14:42:41+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=a65df3f9fc9a51f3e8d710492aafe07b13f0be0f'/>
<id>a65df3f9fc9a51f3e8d710492aafe07b13f0be0f</id>
<content type='text'>
It defaults to None and is positional only.
(cherry picked from commit d1ae57027fc39ff60dcfc1b63881400e5ca3ce56)

Co-authored-by: Dennis Sweeney &lt;36520290+sweeneyde@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It defaults to None and is positional only.
(cherry picked from commit d1ae57027fc39ff60dcfc1b63881400e5ca3ce56)

Co-authored-by: Dennis Sweeney &lt;36520290+sweeneyde@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) (GH-26825)</title>
<updated>2021-06-21T12:22:56+00:00</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2021-06-21T12:22:56+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=83ad40efc3e299d1e94692d958111a63c2fd6775'/>
<id>83ad40efc3e299d1e94692d958111a63c2fd6775</id>
<content type='text'>
_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.

(cherry picked from commit 45a78f906d2d5fe5381d78466b11763fc56d57ba)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.

(cherry picked from commit 45a78f906d2d5fe5381d78466b11763fc56d57ba)</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-44363: Get test_capi passing with address sanitizer (GH-26639)</title>
<updated>2021-06-10T12:01:22+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-06-10T12:01:22+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=865269458fde83f58f056d02a777e4328c763880'/>
<id>865269458fde83f58f056d02a777e4328c763880</id>
<content type='text'>
(cherry picked from commit 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b)

Co-authored-by: Mark Shannon &lt;mark@hotpy.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b)

Co-authored-by: Mark Shannon &lt;mark@hotpy.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486) (GH-26496)</title>
<updated>2021-06-02T23:50:55+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-06-02T23:50:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=85b587a38dcf5d0ef1e275510001e22425d65977'/>
<id>85b587a38dcf5d0ef1e275510001e22425d65977</id>
<content type='text'>
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
(cherry picked from commit bdb56902a3bfe12b10f85a941d5dd0eae739f1a8)

Co-authored-by: stratakis &lt;cstratak@redhat.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
(cherry picked from commit bdb56902a3bfe12b10f85a941d5dd0eae739f1a8)

Co-authored-by: stratakis &lt;cstratak@redhat.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464)</title>
<updated>2021-05-31T11:33:31+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-05-31T11:33:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=46b16d0bdbb1722daed10389e27226a2370f1635'/>
<id>46b16d0bdbb1722daed10389e27226a2370f1635</id>
<content type='text'>
* _testcapi.heapgctype: implement a traverse function since the type
  is defined with Py_TPFLAGS_HAVE_GC.
* _decimal: PyDecSignalDictMixin_Type is no longer defined with
  Py_TPFLAGS_HAVE_GC since it has no traverse function.
(cherry picked from commit 142e5c5445c019542246d93fe2f9e195d3131686)

Co-authored-by: Victor Stinner &lt;vstinner@python.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* _testcapi.heapgctype: implement a traverse function since the type
  is defined with Py_TPFLAGS_HAVE_GC.
* _decimal: PyDecSignalDictMixin_Type is no longer defined with
  Py_TPFLAGS_HAVE_GC since it has no traverse function.
(cherry picked from commit 142e5c5445c019542246d93fe2f9e195d3131686)

Co-authored-by: Victor Stinner &lt;vstinner@python.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fix compiler warning for misleading guarding in the tkinter (GH-26244) (GH-26252)</title>
<updated>2021-05-19T18:27:19+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-05-19T18:27:19+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=021169f7685bcc733f8c23985c5140d483021f60'/>
<id>021169f7685bcc733f8c23985c5140d483021f60</id>
<content type='text'>
The newest gcc emmits this warning:

```
/Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |         ^~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON
      |     ^~~~~~~~~~~~
/Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  243 |     (*(PyThreadState**)Tcl_GetThreadData(&amp;state_key, sizeof(PyThreadState*)))
      |     ^
/Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |                                                         ^~~~~~~~~~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON

```

that's because the macro packs together two statements at the same level
as the "if". The warning is misleading but is very noisy so it makes
sense to fix it.
(cherry picked from commit 95d04710c5fb0df5393b5add2c5c2de2412673eb)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The newest gcc emmits this warning:

```
/Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |         ^~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON
      |     ^~~~~~~~~~~~
/Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  243 |     (*(PyThreadState**)Tcl_GetThreadData(&amp;state_key, sizeof(PyThreadState*)))
      |     ^
/Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |                                                         ^~~~~~~~~~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON

```

that's because the macro packs together two statements at the same level
as the "if". The warning is misleading but is very noisy so it makes
sense to fix it.
(cherry picked from commit 95d04710c5fb0df5393b5add2c5c2de2412673eb)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Fix compiler warning in the xml module (GH-26245) (GH-26248)</title>
<updated>2021-05-19T18:21:07+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-05-19T18:21:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=509e1c9d35ab3cb9814aaeb5324258298ce481e9'/>
<id>509e1c9d35ab3cb9814aaeb5324258298ce481e9</id>
<content type='text'>
The newest version of gcc complains about passing un-initialized arrays
as constant pointers:

```
/Modules/expat/xmltok_ns.c: In function ‘findEncodingNS’:
/Modules/expat/xmltok.h:272:10: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
  272 |   (((enc)-&gt;utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &amp;ptr, end, &amp;p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
/Modules/expat/xmltok.h:272:10: note: by argument 5 of type ‘const char *’ to ‘enum XML_Convert_Result(const ENCODING *, const char **, const char *, char **, const char *)’ {aka ‘enum XML_Convert_Result(const struct encoding *, const char **, const char *, char **, const char *)’}
  272 |   (((enc)-&gt;utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &amp;ptr, end, &amp;p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
In file included from /Modules/expat/xmltok.c:1657:
/Modules/expat/xmltok_ns.c:92:8: note: ‘buf’ declared here
   92 |   char buf[ENCODING_MAX];

```
(cherry picked from commit be93f81e58ba3742589259ef84325a95b547e424)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The newest version of gcc complains about passing un-initialized arrays
as constant pointers:

```
/Modules/expat/xmltok_ns.c: In function ‘findEncodingNS’:
/Modules/expat/xmltok.h:272:10: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
  272 |   (((enc)-&gt;utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &amp;ptr, end, &amp;p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
/Modules/expat/xmltok.h:272:10: note: by argument 5 of type ‘const char *’ to ‘enum XML_Convert_Result(const ENCODING *, const char **, const char *, char **, const char *)’ {aka ‘enum XML_Convert_Result(const struct encoding *, const char **, const char *, char **, const char *)’}
  272 |   (((enc)-&gt;utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &amp;ptr, end, &amp;p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
In file included from /Modules/expat/xmltok.c:1657:
/Modules/expat/xmltok_ns.c:92:8: note: ‘buf’ declared here
   92 |   char buf[ENCODING_MAX];

```
(cherry picked from commit be93f81e58ba3742589259ef84325a95b547e424)

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;

Co-authored-by: Pablo Galindo &lt;Pablogsal@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[3.9] bpo-44145: Release the GIL around HMAC_Update. (GH-26157) (GH-26188)</title>
<updated>2021-05-17T08:07:49+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-05-17T08:07:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=2057ce87498fc30bcd358286175fe5ea34eac9da'/>
<id>2057ce87498fc30bcd358286175fe5ea34eac9da</id>
<content type='text'>
It was always meant to be released for parallelization.
This now matches the other similar code in the module.

Thanks michaelforney for noticing!
(cherry picked from commit c10392e7ddb3eafbd11e9ffe335c07648426715f)


Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;

Automerge-Triggered-By: GH:gpshead</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was always meant to be released for parallelization.
This now matches the other similar code in the module.

Thanks michaelforney for noticing!
(cherry picked from commit c10392e7ddb3eafbd11e9ffe335c07648426715f)


Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;

Automerge-Triggered-By: GH:gpshead</pre>
</div>
</content>
</entry>
<entry>
<title>[3.9] bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927) (GH-25928)</title>
<updated>2021-05-06T06:55:35+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2021-05-06T06:55:35+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=ce47addfb6f176fad053431b537b77a5f170765e'/>
<id>ce47addfb6f176fad053431b537b77a5f170765e</id>
<content type='text'>
Contributed-By: Matthias Klose

Automerge-Triggered-By: GH:tiran
(cherry picked from commit da5c808fb50d34bc2e180d9481706072f33025da)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Contributed-By: Matthias Klose

Automerge-Triggered-By: GH:tiran
(cherry picked from commit da5c808fb50d34bc2e180d9481706072f33025da)

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;

Co-authored-by: Gregory P. Smith &lt;greg@krypto.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[3.9] bpo-42083: Allow NULL doc in PyStructSequence_NewType (#25896)</title>
<updated>2021-05-04T14:07:13+00:00</updated>
<author>
<name>Petr Viktorin</name>
<email>encukou@gmail.com</email>
</author>
<published>2021-05-04T14:07:13+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=ec18362f6a7fdc02f9f982872fc1006bca31627d'/>
<id>ec18362f6a7fdc02f9f982872fc1006bca31627d</id>
<content type='text'>
(cherry picked from commit 2f5baa17504feb9a7613bac32fdceed4894434de)

Co-authored-by: Ken Jin &lt;28750310+Fidget-Spinner@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry picked from commit 2f5baa17504feb9a7613bac32fdceed4894434de)

Co-authored-by: Ken Jin &lt;28750310+Fidget-Spinner@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
</feed>
