[issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7

2021-09-29 Thread Yiyang Zhan

Yiyang Zhan  added the comment:

Thank you for reviewing the pull request 

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0231b6da45b610d33ee4e99bf190e31488d6ab26 by Victor Stinner in 
branch 'main':
bpo-41710: Fix building pytime.c on Windows (GH-28644)
https://github.com/python/cpython/commit/0231b6da45b610d33ee4e99bf190e31488d6ab26


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread neonene


neonene  added the comment:

_PyEval_EvalFrameDefault() may also need to be divided.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1596321] KeyError at exit after 'import threading' in other thread

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37080] Cannot compile Python3.7.3 on Alt-F (ARM)

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Use GCC option -fPIC for shared objects, please

Did you try that? I guess that the configure.ac block about CCSHARED="-fPIC" 
doesn't handle your operating system.

Try to modify manually Makefile to use "CCSHARED=-fPIC", make clean, and try 
make again.

I suggest starting without --enable-optimizations until you solve the build 
errors.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27012
pull_request: https://github.com/python/cpython/pull/28644

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread Ma Lin


Ma Lin  added the comment:

I think this is a bug of MSVC2019, not a really regression of CPython. So 
changing the code of CPython is just a workaround, maybe the right direction is 
to prompt MSVC to fix the bug, otherwise there will be more trouble when 3.11 
is released a year later.

Seeing MSVC's reply, it seems they didn't realize that it was a bug, but 
suggested to adjust the training samples and use `__forceinline`. They don't 
know `__forceinline` hangs the build process since 28d28e0.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36521] Consider removing docstrings from co_consts in code objects

2021-09-29 Thread Inada Naoki


Inada Naoki  added the comment:

> I'm not in favor of (c) co_doc either any more (for the reasons you state). I 
> would go for (b), a CO_DOCSTRING flag plus co_consts[0]. I expect that 
> co_consts sharing to be a very minor benefit, but you could easily count this 
> with another small change to the count script.

OK. Let's reject (c).
I expect that CO_DOCSTRING benefit is much more minor than co_consts sharing. I 
will compare (b) with (d).

> Nested function creation could perhaps become a fraction faster if we didn't 
> copy the docstring into the function object, leaving it func_doc NULL, making 
> func.__doc__ a property that falls back on co_consts[0] if the flag is set.

Copying the docstring is way faster than creating annotations. So I don't think 
nested function creation time is main issue.

> I expect lazy docstrings to be in the distant future (I experimented quite a 
> bit with different marshal formats to support this and it wasn't easy at all) 
> but I don't want to exclude it.

Since code object is immutable/hashable, removing docstring from code object 
makes this idea easy.

For example, we can store long docstrings in some db (e.g. sqlite, dbm) in the 
__pycache__ directory and store its id to func.__doc__. When func.__doc__ is 
accessed, it can load the docstring from db.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27011
pull_request: https://github.com/python/cpython/pull/28643

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2021-09-29 Thread Dong-hee Na


Change by Dong-hee Na :


--
versions: +Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2021-09-29 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d62d925823b005c33b432e527562b573a3a89635 by Victor Stinner in 
branch 'main':
bpo-41710: Add pytime_add() and pytime_mul() (GH-28642)
https://github.com/python/cpython/commit/d62d925823b005c33b432e527562b573a3a89635


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2021-09-29 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27010
pull_request: https://github.com/python/cpython/pull/28642

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41226] Supporting `strides` in `memoryview.cast`

2021-09-29 Thread jakirkham


Change by jakirkham :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40718] Support out-of-band pickling for builtin types

2021-09-29 Thread jakirkham


Change by jakirkham :


--
components: +Library (Lib)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 09796f2f142fdb1214f34a3ca917959ecb32a88b by Victor Stinner in 
branch 'main':
bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)
https://github.com/python/cpython/commit/09796f2f142fdb1214f34a3ca917959ecb32a88b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Matt Wozniski


Matt Wozniski  added the comment:

The leftmost argument of the ternary is an int for every example that Victor 
and I found in the stdlib, so no casting would be required in any of these 
cases.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Matt Wozniski


Matt Wozniski  added the comment:

I spotted three other uses in the stdlib:

Modules/_io/_iomodule.c

raw = PyObject_CallFunction(RawIO_class, "OsOO",
path_or_fd, rawmode,
closefd ? Py_True : Py_False,
opener);

wrapper = PyObject_CallFunction((PyObject *)_Type,
"OsssO",
buffer,
encoding, errors, newline,
line_buffering ? Py_True : Py_False);

Modules/_sqlite/connection.c

if (PySys_Audit("sqlite3.enable_load_extension",
"OO", self, onoff ? Py_True : Py_False) < 0) {
return NULL;
}

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single"

2021-09-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8d3e7eff0936926554db6162c992af5829dc8160 by Victor Stinner in 
branch 'main':
bpo-43753: _operator.is_() uses Py_Is() (GH-28641)
https://github.com/python/cpython/commit/8d3e7eff0936926554db6162c992af5829dc8160


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Matt Wozniski


Matt Wozniski  added the comment:

> but there is a catch -- the arguments should be a C int

Or a type that promotes to int. If you pass a C short or char, or a C++ bool, 
it is implicitly promoted to int.

> so you will need to write "expr ? 1 : 0"

Or alternatively "!!expr"

> which is not much better than "expr ? Py_True : Py_False"

I had to write that recently after reading through the Py_BuildValue docs twice 
to make sure I wasn't missing a format code I could use. It's a strange 
omission, especially because 'p' exists for PyArg_Parse. I'd very much like to 
see this change.

--
nosy: +godlygeek

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Could you backport this fix to at least 3.9 and 3.10 branches?

Done.

> This is fix for regression which was previously backported to 2.7 and 3.6 
> branches.

I'm not sure what you mean.

In Python 2.7 and Python 3.6,  was already included by 
Include/Python.h:

#ifdef HAVE_CRYPT_H
#include 
#endif

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 80285ecc8deaa2b0e7351bf4be863d1a0ad3c188 by Miss Islington (bot) 
in branch '3.10':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule 
(GH-27394) (GH-28636)
https://github.com/python/cpython/commit/80285ecc8deaa2b0e7351bf4be863d1a0ad3c188


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43753] [C API] Add Py_Is(x, y) and Py_IsNone(x) functions

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27009
pull_request: https://github.com/python/cpython/pull/28641

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> My concern is that such feature can provoke bugs. The risk can exceed the 
> minor benefit.

But isn't that risk the same for other formatting parameters?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

You can see how is implemented on am64 for example here:

https://blog.nelhage.com/2010/10/amd64-and-va_arg/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45291] Some instructions in the "Using Python on Unix platforms" document do no work on CentOS 7

2021-09-29 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks! 

The documentation was not up to date for OpenSSL 3.0.0. The default for 
--libdir was changed late in the development cycle.

--
nosy: +christian.heimes
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> What happens if you pass a double, it is stored as a double on the C stack, 
> and then Py_BuildValue() will read junk data?

AFAIK, it is complicated. On old computer primitive compilers just pushed 
arguments one by one on the stack (in platform-depending order). When you push 
64-bytes double and read 32-bit int, you get a junk not only for this read, but 
for reads of all following or preceding arguments.

Modern compilers on modern platforms can use registers to pass variable 
arguments. I do not know details, but doubles and ints are passed using 
different registers, so the difference can be even larger.

My concern is that such feature can provoke bugs. The risk can exceed the minor 
benefit.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2021-09-29 Thread Dmitry Marakasov


New submission from Dmitry Marakasov :

Here's a curious problem. issubclass() check of a type against an ABC-derived 
class raises TypeError claiming that type is not a class, however 
inspect.isclass() says it's a class, and issubclass() check against a simple 
class works fine:

```
from abc import ABC

class C1:
pass

issubclass(dict[str, str], C1)  # False

class C2(ABC):
pass

issubclass(dict[str, str], C2)  # TypeError: issubclass() arg 1 must be a class
```

I've ran into this problem while using `inspect` module to look for subclasses 
of a specific ABC in a module which may also contain type aliases, and after 
converting a type alias from `Dict[str, str]` to modern `dict[str, str]` I've 
got an unexpected crash in this code:

if inspect.isclass(member) and issubclass(member, superclass):

Not sure which is the culprit, ABC or how dict[]-style type aliases are 
implemented.

--
components: Library (Lib)
messages: 402914
nosy: AMDmi3
priority: normal
severity: normal
status: open
title: Unexpected TypeError with type alias+issubclass+ABC
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37080] Cannot compile Python3.7.3 on Alt-F (ARM)

2021-09-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Jarl, I don't know if we support compiling on such devices, even though the OS 
is linux.  I suggest that you ask on python-list, where someone might have the 
experience to help you.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single"

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur with Terry, ending a file with  *is* a syntax 
error.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single"

2021-09-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg402911

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single"

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread miss-islington


miss-islington  added the comment:


New changeset 9626ac8b7421aa5fc04a30359521d24f40105141 by Miss Islington (bot) 
in branch '3.9':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule 
(GH-27394)
https://github.com/python/cpython/commit/9626ac8b7421aa5fc04a30359521d24f40105141


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single"

2021-09-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I believe that this should be closed as not-a-bug.  Ending a file with 
 *is* a syntax error.  Previous, it was assumed that the 
problem, in retrospect, was the 'extra' indent.  But one can equally say that 
the problem is the 'missing' statement after the otherwise legitimate indent.  
Even a newline is enough to make the code legal.  The current message no longer 
guess whether there is too much or too little code.

--
nosy: +pablogsal, terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The va_start macro just sets up a pointer to the first function parameter, 
e.g.:-

 void func (int a, ...)
 { 
   // va_start
   char *p = (char *)  + sizeof a;
 }

which makes p point to the second parameter. The va_arg macro does this:-

 void func (int a, ...)
 { 
   // va_start
   char *p = (char *)  + sizeof a;

   // va_arg
   int i1 = *((int *)p);
   p += sizeof (int);

   // va_arg
   int i2 = *((int *)p);
   p += sizeof (int);

   // va_arg
   long i2 = *((long *)p);
   p += sizeof (long);
 }

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25653] ctypes+callbacks+fork+selinux = crash

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

Another recent crash involving libffi, closure, fork and SELinux: 
https://bugzilla.redhat.com/show_bug.cgi?id=1977410 This bug comes from libffi, 
not from Python (but it can be easily reproducing using ctypes which uses 
libffi).

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45320] Remove deprecated inspect functions

2021-09-29 Thread Hugo van Kemenade


Hugo van Kemenade  added the comment:

Of the 188 repos I managed to clone of 200 top PyPI packages, looks like these 
9 are still calling them:

botocore
client_python
cython
google-api-python-client
grpc
ipython
pycodestyle
pyrsistent
wrapt

Details at https://github.com/python/cpython/pull/28618#issuecomment-930524790

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45262] crash if asyncio is used before and after re-initialization if using python embedded in an application

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

> "Assertion failed: Py_IS_TYPE(rl, _Type), file 
> D:\a\1\s\Modules_asynciomodule.c, line 261"

The _asyncio extension uses static types and doesn't implement the multiphase 
initialization API. It doesn't work well with your "deinitialize/initialize the 
interpreter" use case.

The _asyncio extension should use heap types and the multiphase init API.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

> but there is a catch -- the arguments should be a C int. If it is not, you 
> can break a stack.

I never understood how "..." arguments work under the hood. What happens if you 
pass a double, it is stored as a double on the C stack, and then 
Py_BuildValue() will read junk data?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45229] Always use unittest for collecting tests in regrtests

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27008
pull_request: https://github.com/python/cpython/pull/28639

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45229] Always use unittest for collecting tests in regrtests

2021-09-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d441437ee71ae174c008c23308b749b91020ba77 by Serhiy Storchaka in 
branch 'main':
bpo-45229: Make datetime tests discoverable (GH-28615)
https://github.com/python/cpython/commit/d441437ee71ae174c008c23308b749b91020ba77


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27007
pull_request: https://github.com/python/cpython/pull/28638

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> There was no much need of this feature. In rare cases when we needed to build 
> a bool in Py_BuildValue (I have found only 2 cases in the stdlib, and one of 
> them is added by me) we use the following idiom:

Is true that this is not very common, but I have find this in several occasions 
writing extension code and given the small impact and maintenance cost and the 
symmetry with PyArg_Parse I figured that could be useful

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45229] Always use unittest for collecting tests in regrtests

2021-09-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +27006
pull_request: https://github.com/python/cpython/pull/28637

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27005
pull_request: https://github.com/python/cpython/pull/28636

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Either create a new draft PR, or put it in the same PR 28634.


I prefer to reach an agreement first here before I add more things to the PR

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

I would be interested to see how the "p" format could be used in existing code. 
I found a few places would benefit of it. Either create a new draft PR, or put 
it in the same PR 28634.

Modules/_itertoolsmodule.c:

return Py_BuildValue("O(N)(OO)", Py_TYPE(lz), it, lz->saved, Py_True);

return Py_BuildValue("O(O)(OO)", Py_TYPE(lz), lz->it, lz->saved,
 lz->firstpass ? Py_True : Py_False);

Modules/_ssl.c:

ok = RAND_bytes((unsigned char*)PyBytes_AS_STRING(bytes), len);
if (ok == 0 || ok == 1)
return Py_BuildValue("NO", bytes, ok == 1 ? Py_True : Py_False);

return Py_BuildValue(
"{sksssisi"
"sO"
"}",
"id", cipher_id,
"name", cipher_name,
"protocol", cipher_protocol,
"description", buf,
"strength_bits", strength_bits,
"alg_bits", alg_bits
,"aead", aead ? Py_True : Py_False,
"symmetric", skcipher,
"digest", digest,
"kea", kx,
"auth", auth
   );


Modules/main.c:

runargs = PyTuple_Pack(2, module, set_argv0 ? Py_True : Py_False);

Objects/fileobject.c:

stream = _PyObject_CallMethodId(io, _open, "isisssO", fd, mode,
 buffering, encoding, errors,
 newline, closefd ? Py_True : Py_False);

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There was no much need of this feature. In rare cases when we needed to build a 
bool in Py_BuildValue (I have found only 2 cases in the stdlib, and one of them 
is added by me) we use the following idiom:

   Py_BuildValue("...O...", ..., expr ? Py_True : Py_False, ...)

You can have a temptation to write it as

   Py_BuildValue("...p...", ..., expr, ...)

but there is a catch -- the arguments should be a C int. If it is not, you can 
break a stack. Explicit cast to int ("(int)expr") is not always correct, so you 
will need to write "expr ? 1 : 0" which is not much better than "expr ? Py_True 
: Py_False".

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45020] Freeze all modules imported during startup.

2021-09-29 Thread Eric Snow


Eric Snow  added the comment:


New changeset 45ca1c04139300ec0289a32f78c7ac922a4f7b07 by Eric Snow in branch 
'main':
bpo-45020: Do not freeze /__init__.py twice. (gh-28635)
https://github.com/python/cpython/commit/45ca1c04139300ec0289a32f78c7ac922a4f7b07


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45020] Freeze all modules imported during startup.

2021-09-29 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +27004
pull_request: https://github.com/python/cpython/pull/28635

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +27003
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28634

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45324] The frozen importer should capture info in find_spec().

2021-09-29 Thread Eric Snow


Change by Eric Snow :


--
keywords: +patch
pull_requests: +27002
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28633

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45325] Allow "p" in Py_BuildValue

2021-09-29 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

We should allow Py_BuildValue to take a "p" argument that takes a C int and 
produces a Python Bool so it would be symmetric with the p format code for 
PyArg_Parse that takes a Python object and returns a C int containing 
PyObject_IsTrue(obj).

--
messages: 402897
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Allow "p" in Py_BuildValue

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45324] The frozen importer should capture info in find_spec().

2021-09-29 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45324] The frozen importer should capture info in find_spec().

2021-09-29 Thread Eric Snow


Eric Snow  added the comment:

Taking care of this will also be necessary (probably) as we work on adding 
__file__ to frozen stdlib modules.  (See bpo-21736.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45324] The frozen importer should capture info in find_spec().

2021-09-29 Thread Eric Snow


New submission from Eric Snow :

Currently FrozenImporter (in Lib/importlib/_bootstrap.py) does minimal work in 
its find_spec() method.  It only checks whether or not the module is frozen.  
However, in doing so it has gathered all the info we need to load the module.  
We end up repeating that work in exec_module().

Rather than duplicating that effort, we should preserve the info in 
spec.loader_state.  This has the added benefit of aligning more closely with 
the division between finder and loader.  Once we get to the loader, there 
shouldn't be a need to check if the module is frozen nor otherwise interact 
with the internal frozen module state (i.e. PyImport_FrozenModules).

--
assignee: eric.snow
components: Interpreter Core
messages: 402895
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: The frozen importer should capture info in find_spec().
type: behavior
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread Sam James


Change by Sam James :


--
nosy: +thesamesam

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44751] crypt.h should be in _cryptmodule.c, not in public header

2021-09-29 Thread Arfrever Frehtes Taifersar Arahesis


Arfrever Frehtes Taifersar Arahesis  added the comment:

Could you backport this fix to at least 3.9 and 3.10 branches?
This is fix for regression which was previously backported to 2.7 and 3.6 
branches.

--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread neonene


neonene  added the comment:

@pablogsal
I'm OK with more effective fixes in 3.10.1 and later.

Thanks all, thanks kj and malin for many help.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36521] Consider removing docstrings from co_consts in code objects

2021-09-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Not so fast.

I'm not in favor of (c) co_doc either any more (for the reasons you state). I 
would go for (b), a CO_DOCSTRING flag plus co_consts[0]. I expect that 
co_consts sharing to be a very minor benefit, but you could easily count this 
with another small change to the count script.

Moving the docstring to the surrounding object would not make much of a 
difference time- or speed-wise but I think it's the wrong thing to do since it 
dissociates the docstring from the function.

Nested function creation could perhaps become a fraction faster if we didn't 
copy the docstring into the function object, leaving it func_doc NULL, making 
func.__doc__ a property that falls back on co_consts[0] if the flag is set.

I expect lazy docstrings to be in the distant future (I experimented quite a 
bit with different marshal formats to support this and it wasn't easy at all) 
but I don't want to exclude it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread neonene


neonene  added the comment:

I submitted 2 drafts in a hurry. Sorry for short explanations.
I'll add more reports.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36207] robotsparser deny all with some rules

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
Removed message: https://bugs.python.org/msg402889

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread neonene


Change by neonene :


--
pull_requests: +27001
pull_request: https://github.com/python/cpython/pull/28631

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread neonene


Change by neonene :


--
pull_requests: +27000
pull_request: https://github.com/python/cpython/pull/28630

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41710] acquire(timeout) of threading.Lock and threading.Condition is affected by jumps in system time: Python should use sem_clockwait(CLOCK_MONOTONIC)

2021-09-29 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +26999
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28629

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45320] Remove deprecated inspect functions

2021-09-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Slightly related, inspect.getfullargspec was also deprecated and later 
undeprecated. Please find the discussion post this message

https://bugs.python.org/issue36751#msg341128

https://bugs.python.org/issue37010

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36207] robotsparser deny all with some rules

2021-09-29 Thread Nico


Nico  added the comment:

Had same problem today for my website (https://www.bonus4casino.fr/), following 
for a fix

--
nosy: +nico.bonefato

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28206] signal.Signals not documented

2021-09-29 Thread Hinrich Mahler


Change by Hinrich Mahler :


--
keywords: +patch
pull_requests: +26998
pull_request: https://github.com/python/cpython/pull/28628

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45323] unexpected behavior on first match case _

2021-09-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

It is a bit tricky to find the documentation for the magic single underscore, 
but it is here:

https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45323] unexpected behavior on first match case _

2021-09-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

If you are working in the interactive interpreter, you may be running into a 
conflict with the "magic" variable `_` which the interactive interpreter 
creates to hold the result of the last evaluated statement.

So when you evaluate `x`, and that returns the string "robert", it also gets 
assigned to `_`. But you can't easily delete `_` because it lives in the 
builtin namespace, not the global namespace.

This happens with anything, not just match statements:


>>> x = "spam eggs"
>>> x
'spam eggs'
>>> _
'spam eggs'
>>> del _  # Not a global, can't delete it!
Traceback (most recent call last):
  File "", line 1, in 
NameError: name '_' is not defined


So I think the weird behaviour with _ that you have stumbled over is a red 
herring.

However, it does seem to me that *perhaps* the assignment to x shouldn't be 
occurring at all. So that may be a bug in the match statement?

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45249] Update doctect SyntaxErrors for location range

2021-09-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> IMO, we should note in What's New that only for Windows, 3.10.0 has a slight 
> slowdown.

I disagree. This is a regression/bug and we don't advertise "known bugs" in the 
what's new, the same for any other bugfix that has been delayed until 3.10.1

>  Some use cases are slower (by >10%!)

Can you still reproduce this with PR 28475?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45322] [X86_64]test_concurrent_futures fail

2021-09-29 Thread STINNER Victor


STINNER Victor  added the comment:

> File 
> "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", 
> line 224 in _feed

Python 3.7 no longer accept bugfixes: I close the issue.

You can open a new issue if you can reproduce the issue on Python 3.9 or newer:
https://devguide.python.org/#status-of-python-branches

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45323] unexpected behavior on first match case _

2021-09-29 Thread Joël Bourgault

New submission from Joël Bourgault :

While testing the `match...case` construction, I get the following behavior 
with Docker image Python 3.10 rc2-slim:

```python
>>> match "robert":
... case x if len(x) > 10:
... print("long nom")
... case [0, y]:
... print("point à x nul")
... case _:
... print("nothing interesting")
...
nothing interesting
>>> x  # assigned, since matched, even if 'guarded-out'
'robert'
>>> y  # not assigned, because not matched
Traceback (most recent call last):
...
NameError: name 'y' is not defined
>>> _  # normally not assigned, but we get a value?? 
'robert'
>>> del _  # but the variable does not even exist!?!?!? 
Traceback (most recent call last):
...
NameError: name '_' is not defined

```

Moreover, if we continue working in the same session by assigning `_` 
explicitly and playing with `case _`, we don't get any weird behavior anymore, 
and `_` behaves as a normal variable.

So it seems to me that there is some weird corner case here, that should be 
adressed.

--
messages: 402884
nosy: ojob
priority: normal
severity: normal
status: open
title: unexpected behavior on first match case _
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36819] Crash during encoding using UTF-16/32 and custom error handler

2021-09-29 Thread Walter Dörwald

Walter Dörwald  added the comment:

The original specification (PEP 293) required that an error handler called for 
encoding *must* return a replacement string (not bytes). This returned string 
must then be encoded again. Only if this fails an exception must be raised.

Returning bytes from the encoding error handler is an extension specified by 
PEP 383:

> The error handler interface is extended to allow the encode error handler to 
> return byte strings immediately, in addition to returning Unicode strings 
> which then get encoded again (also see the discussion below).

So for 3. in Serhiy's problem list

> 3. Incorrect exception can be raised if the error handler returns invalid 
> string/bytes: a non-ASCII string or a bytes object consisting of not a whole 
> number of units.

I get:

 ~/ ❯ python
Python 3.9.7 (default, Sep  3 2021, 12:37:55)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def bad(exc):
...  return ('\udbc0', exc.start)
...
>>> import codecs
>>> codecs.register_error('bad', bad)
>>> '\udbc0'.encode('utf-16', 'bad')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError

I would have expected an exception message that basically looks like the one 
I'd get, if I had used the strict error handler.

But otherwise returning a replacement that is unencodable is allowed and should 
raise an exception (which happens here, but with a missing exception message). 
(Returning something unencodable might make sense when the error handler is 
able to create replacement characters for some unencodable input, but not for 
other, but of course the error handler can always raise an exception directly).

Returning invalid bytes is not an issue, they simply get written to the output. 
That's exactly the use case of PEP 383: The bytes couldn't be decoded in the 
specified encoding, so they are "invalid", but the surrogateescape error 
handler encodes them back to the same "invalid" bytes. So the error handler is 
allowed to output bytes that can't be decoded again with the same encoding.

Returning a restart position outside the valid range of the length of the 
original string should raise an IndexError according to PEP 293:

> If the callback does not raise an exception (either the one passed in, or a 
> different one), it must return a tuple: `(replacement, newpos)`
> `replacement` is a unicode object that the encoder will encode and emit 
> instead of the unencodable `object[start:end]` part, `newpos` specifies
> a new position within object, where (after encoding the replacement) the 
> encoder will continue encoding.
> Negative values for `newpos` are treated as being relative to end of object. 
> If `newpos` is out of bounds the encoder will raise an `IndexError`.

Of course we could retroactively reinterpret "out of bounds" as outside of 
`range(exc.start + 1, len(object))`, instead of outside `range(0, 
len(object))`. An error handler that never advances is broken anyway. But we 
can't detect "never".

However it would probably be OK to reject pathological error handlers (i.e. 
those that don't advance (i.e. return at least `exc.start + 1` as the restart 
position)). But I'm not sure how that's different from an error handler that 
skips ahead much farther (i.e. returns something like 
`(exc.start+len(object))//2` or `max(exc.start+1, len(object)-10)`): The 
returned restart position leads to a certain expectation of how many bytes the 
encoder might have to output until everything is encoded and must adjust 
accordingly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2021-09-29 Thread Christian Heimes


Christian Heimes  added the comment:

Larry, could you please take a look?

Your commit is causing a regression for C subclasses of heap types when the 
parent class has an "__annotations__" descriptor. The child class no longer 
uses the descriptor of the parent class.

--
nosy: +larry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45322] [X86_64]test_concurrent_futures fail

2021-09-29 Thread Christian Heimes


Change by Christian Heimes :


--
nosy:  -christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45322] [X86_64]test_concurrent_futures fail

2021-09-29 Thread Christian Heimes


Christian Heimes  added the comment:

Please stop adding Victor and me to the noisy list. That's rather rude. A core 
dev or triager will pick up the ticket eventually and notify the relevant 
experts.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 90004fca1cc3c6e3c9b2c3faae5cb1b7d7711648 by Miss Islington (bot) 
in branch '3.8':
[3.8] bpo-44394: Ensure libexpat is linked against libm (GH-28617) (GH-28620)
https://github.com/python/cpython/commit/90004fca1cc3c6e3c9b2c3faae5cb1b7d7711648


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45322] [X86_64]test_concurrent_futures fail

2021-09-29 Thread tongxiaoge


New submission from tongxiaoge :

The error log is as follows:
[ 1848s] 0:19:24 load avg: 22.28 [411/412/1] test_concurrent_futures failed (19 
min 19 sec) -- running: test_capi (19 min 22 sec)
[ 1848s]
[ 1848s] Traceback:
[ 1848s]  Thread 0x7fb68ffab700 (most recent call first):
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 296 in wait
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 
224 in _feed
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 885 in run
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 942 in _bootstrap_inner
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 905 in _bootstrap
[ 1848s]
[ 1848s] Thread 0x7fb6907ac700 (most recent call first):
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/selectors.py", 
line 415 in select
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/connection.py", 
line 921 in wait
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/concurrent/futures/process.py", 
line 361 in _queue_management_worker
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 885 in run
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 942 in _bootstrap_inner
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 905 in _bootstrap
[ 1848s]
[ 1848s] Current thread 0x7fb69e8f7740 (most recent call first):
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", 
line 972 in _fail_on_deadlock
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", 
line 1033 in test_crash
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 645 in run
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/case.py", line 693 in 
__call__
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in 
run
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in 
__call__
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in 
run
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in 
__call__
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 122 in 
run
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/suite.py", line 84 in 
__call__
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/unittest/runner.py", line 176 in 
run
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 
1919 in _run_suite
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 
2041 in run_unittest
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/test_concurrent_futures.py", 
line 1300 in test_main
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/support/__init__.py", line 
2173 in decorator
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", 
line 234 in _runtest_inner2
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", 
line 270 in _runtest_inner
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", 
line 141 in _runtest
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest.py", 
line 193 in runtest
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/runtest_mp.py", 
line 80 in run_tests_worker
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 
656 in _main
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 
636 in main
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/libregrtest/main.py", line 
713 in main
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 46 in 
_main
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/test/regrtest.py", line 50 in 

[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 
85 in _run_code
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/runpy.py", line 
193 in _run_module_as_main
[ 1848s]
[ 1848s]
[ 1848s] Traceback:
[ 1848s]  Thread 0x7fb68ffab700 (most recent call first):
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 296 in wait
[ 1848s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py", line 
224 in _feed
[ 1848s]   File "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/threading.py", 
line 885 in run
[ 1848s]   File 

[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26997
pull_request: https://github.com/python/cpython/pull/28627

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread Ken Jin


Ken Jin  added the comment:

Sadly, I can't reproduce the speedups OP reported from disabling 
test_patma.TestTracing. It's not any faster than what we have with PR28475. 
(See attached pyperformance).

I'm looking forward to their other fix :). Even if it comes in 3.10.1 that's 
still a huge win. I don't think everyone immediately upgrades when a new Python 
version arrives.

IMO, we should note in What's New that only for Windows, 3.10.0 has a slight 
slowdown. Some use cases are slower (by >10%!), while some people won't feel a 
thing. (Then again, maybe this is offset by the LOAD_ATTR opcache in 3.10 and 
we get a net zero effect?). I'll submit a PR soon if the full fix misses 3.10.0.

--
Added file: https://bugs.python.org/file50315/310rc2patched_vs_310rc2notrace.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45320] Remove deprecated inspect functions

2021-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Have you done any checks how much external code is using the deprecated 
callables in the wild? I remember when the 3.5 deprecations started, a lot of 
libraries started emitting them because they stuck to `getargspec` which was 
Python 2 compatible.

--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45211] Useful (expensive) information is discarded in getpath.c.

2021-09-29 Thread Eric Snow


Eric Snow  added the comment:

Yeah, I was thinking along those lines too but hesitated. :)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 412ae8ab10734b72384c969181919cc4eb154406 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-44394: Ensure libexpat is linked against libm (GH-28617) (GH-28621)
https://github.com/python/cpython/commit/412ae8ab10734b72384c969181919cc4eb154406


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors

2021-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 456d6d9fefac828c19fc1b562f6301f00965fe59 by Miss Islington (bot) 
in branch '3.8':
bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when 
building (GH-28393) (GH-28622)
https://github.com/python/cpython/commit/456d6d9fefac828c19fc1b562f6301f00965fe59


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26996
pull_request: https://github.com/python/cpython/pull/28624

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45318] Python 3.10: cyclomatic complexity of match-case syntax

2021-09-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

@Boštjan Mejak: I think this question belongs on a discussion forum rather than 
in the Python bug tracker - as I understand it, there's no bug reported here, 
and no change to the Python core proposed.

I'll close here. You might consider taking this to discuss.python.org or 
another forum.

--
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread miss-islington


miss-islington  added the comment:


New changeset fafa213870193cf79557588ae8f9a4af570fd6e3 by Miss Islington (bot) 
in branch '3.9':
bpo-44394: Ensure libexpat is linked against libm (GH-28617)
https://github.com/python/cpython/commit/fafa213870193cf79557588ae8f9a4af570fd6e3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26995
pull_request: https://github.com/python/cpython/pull/28622

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I have another fix.

If you have another fix, please create a PR ASAN and get it reviewed and merged 
by a core dev in the next 24 hours, otherwise it will need to wait until 3.10.1

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45319] Possible regression in __annotations__ descr for heap type subclasses

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ah, that is likely because type_getsets now gets directly an __annotations__ 
field.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26994
pull_request: https://github.com/python/cpython/pull/28621

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6c1154b9de29e1c9cd3d05f5289543e5cff73895 by Pablo Galindo Salgado 
in branch 'main':
bpo-44394: Ensure libexpat is linked against libm (GH-28617)
https://github.com/python/cpython/commit/6c1154b9de29e1c9cd3d05f5289543e5cff73895


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26993
pull_request: https://github.com/python/cpython/pull/28620

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1

2021-09-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26992
pull_request: https://github.com/python/cpython/pull/28619

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44896] AttributeError in ast.unparse

2021-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Sorry, I think we shouldn't be changing `ast.py` this way. To reiterate my 
review comment from the PR:

I think we should just let this go and instead advertise that if you put new 
synthetic nodes in a tree, you have to either:
- provide `lineno` and `col_offset` yourself; or
- use `fix_missing_locations()` to fill out the information for you.

The problem with the logic that I commented on twice now (on the PR) is one 
reason for my opinion. Another is bigger though:

Suppose user code is replacing nodes or just inserting new ones. This operation 
not only creates nodes without location attributes. It also in all likelihood 
*moves* locations of type comments and those aren't updated (for example, 
`_type_ignores[123]` should now really be `_type_ignores[125]` to still point 
at the same tokens). So user code shouldn't be naive when it comes to missing 
locations, and we definitely shouldn't paper over missing locations.

--
nosy: +lukasz.langa
resolution:  -> rejected
stage: patch review -> resolved

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread neonene


neonene  added the comment:

I have another fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >