[issue45565] More LOAD_ATTR specializations

2021-10-22 Thread Ken Jin


Change by Ken Jin :


--
components: Interpreter Core
nosy: Mark.Shannon, kj
priority: normal
severity: normal
status: open
title: More LOAD_ATTR specializations
type: performance
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



[issue45565] More LOAD_ATTR specializations

2021-10-22 Thread Ken Jin


Change by Ken Jin :


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

___
Python tracker 

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



[issue45535] Enum's dir() does not contain inherited members

2021-10-22 Thread Alex Waygood


Alex Waygood  added the comment:

Would there be interest in me submitting a PR along these lines?



> why use mro() instead of __mro__?

Er, no reason, really. To be honest, I've never really understood why Python 
has both.

--

___
Python tracker 

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



[issue45528] mmap: constants not listed in the documentation

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


--
type:  -> enhancement
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue45520] Frozen dataclass deep copy doesn't work with __slots__

2021-10-22 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
keywords: +patch
nosy: +sobolevn
nosy_count: 3.0 -> 4.0
pull_requests: +27423
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29147

___
Python tracker 

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



[issue44133] "Py_FrozenMain" symbol is not exported

2021-10-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +27425
pull_request: https://github.com/python/cpython/pull/29148

___
Python tracker 

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



[issue44133] "Py_FrozenMain" symbol is not exported

2021-10-22 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 276468dddb46c54980c782c09cdb53bd90755752 by Petr Viktorin in 
branch 'main':
bpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354)
https://github.com/python/cpython/commit/276468dddb46c54980c782c09cdb53bd90755752


--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-10-22 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 276468dddb46c54980c782c09cdb53bd90755752 by Petr Viktorin in 
branch 'main':
bpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354)
https://github.com/python/cpython/commit/276468dddb46c54980c782c09cdb53bd90755752


--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27424
pull_request: https://github.com/python/cpython/pull/29148

___
Python tracker 

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



[issue45125] Improve tests and docs of how `pickle` works with `SharedMemory` obejcts

2021-10-22 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Thanks everyone. It is now fixed

--
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



[issue44970] Re-examine complex pow special case handling

2021-10-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Is not it a duplicate of issue15996?

Yes, I think it's close enough. Thanks.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> pow() for complex numbers is rough around the edges

___
Python tracker 

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



[issue15996] pow() for complex numbers is rough around the edges

2021-10-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

See also discussion in #44970, which is closed as a duplicate of this issue.

--

___
Python tracker 

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



[issue41592] Make _SubParsersAction public

2021-10-22 Thread Ken Jin


Ken Jin  added the comment:

Turning a class public or not requires a lot more discussion by the argparse 
maintainers (I'm definitely not one of them). Have you considered this 
workaround for PyCharm?

from argparse import (
_SubParsersAction,  # noqa
ArgumentParser,
)

--
nosy: +rhettinger

___
Python tracker 

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



[issue45566] `test_frozen_pickle` does not use all possible `pickle` protocols

2021-10-22 Thread Nikita Sobolev


New submission from Nikita Sobolev :

While working on https://github.com/python/cpython/pull/29147 I've noticed that 
`test_frozen_pickle` does not use all possible `pickle` protocols: 
https://github.com/python/cpython/blob/276468dddb46c54980c782c09cdb53bd90755752/Lib/test/test_dataclasses.py#L2862

I will add `for` and `self.subTest` for each unique `pickle` protocol.
After that it would be in sync with `3.9` branch.

--
components: Tests
messages: 404728
nosy: sobolevn
priority: normal
severity: normal
status: open
title: `test_frozen_pickle` does not use all possible `pickle` protocols
type: behavior
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



[issue28375] cgi.py spam in Apache server logs

2021-10-22 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

All my projects now use werkzeug instead of the cgi module, so I can't confirm 
whether this problem still exists. I'm fine with closing this as unreproducible 
if no one else can reproduce it.

--
status: pending -> open

___
Python tracker 

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



[issue41086] Exception for uninstantiated interpolation (configparser)

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

This is not a bugfix so it should probably not be backported.

--
nosy: +iritkatriel
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 
3.8, Python 3.9

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27426
pull_request: https://github.com/python/cpython/pull/29149

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset 86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81 by Pablo Galindo Salgado 
in branch 'main':
bpo-45562: Only show debug output from the parser in debug builds (GH-29140)
https://github.com/python/cpython/commit/86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81


--
nosy: +miss-islington

___
Python tracker 

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



[issue45567] Support TLS Encrypted ClientHello (ECH)

2021-10-22 Thread Hans-Christoph Steiner


New submission from Hans-Christoph Steiner :

The next version of the IETF-standardized TLS protocol is known as Encrypted 
ClientHello (ECH) [1] formerly known as Encrypted SNI (ESNI). This ticket 
collects information for ECH support, and tracks which APIs have to be added to 
Python in order to implement ECH in Python's ssl module.  ECH is built on top 
of TLSv1.3 and completes the unfinished work from the TLSv1.3 effort.  It is 
now in draft-13 and there are many implementations that are interoperating.  
ECH is working for openssl[2], boringssl[3], nginx, Apache HTTPD, lighttpd, 
HAProxy, Conscrypt[4], curl, and more.  There is work underway in Firefox [5] 
and Chromium [6].  It has been sketched out for OkHTTP [7].  Early versions of 
the standard, known as ESNI, have been deployed in Firefox releases and some 
production web services.  ECH works in conjunction with the new DNS RR Types 
HTTPS and SVCB [8].  This means that DNS needs to be handled a bit differently.

As far as I understand it, the ssl module has to gain additional features:

1. HTTPS/SVCB DNS queries for setting up TLS connection with ECH.
2. A way to provide ECH Config Lists as bytes directly to ssl clients.
3. A callback that gets called whenever ECH negotiation fails and the server 
offers a "Retry Config".
4. A method to ensure encrypted DNS is used so all metadata is encrypted.

OpenSSL does not implement the necessary APIs yet. Stephen Farrell's 
development OpenSSL fork [9] implements ECH and has been used in Apache HTTPD, 
nginx, lighttpd, HAProxy, and curl implementations.

The TLS WG maintain a page with information about other implementations:
https://github.com/tlswg/draft-ietf-tls-esni/wiki/Implementations


[1] https://www.ietf.org/archive/id/draft-ietf-tls-esni-13.html
[2] https://github.com/openssl/openssl/issues/7482
[3] https://bugs.chromium.org/p/boringssl/issues/detail?id=275
[5] https://bugzilla.mozilla.org/show_bug.cgi?id=1725938
[6] https://bugs.chromium.org/p/chromium/issues/detail?id=1091403
[6] https://github.com/google/conscrypt/issues/730
[7] https://github.com/square/okhttp/issues/6539
[8] https://www.ietf.org/archive/id/draft-ietf-dnsop-svcb-https-07.html
[9] https://github.com/sftcd/openssl

--
assignee: christian.heimes
components: SSL
messages: 404732
nosy: christian.heimes, eighthave
priority: normal
severity: normal
status: open
title: Support TLS Encrypted ClientHello (ECH)
type: enhancement

___
Python tracker 

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



[issue22886] TestProgram leaves defaultTestLoader.errors dirty

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5

___
Python tracker 

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



[issue45566] `test_frozen_pickle` does not use all possible `pickle` protocols

2021-10-22 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2021-10-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

This should probably be a separate issue, but I wonder whether the 15-bit digit 
option has value any more. Should we just drop that option and always use 
30-bit digits? 

30-bit digits were introduced at a time when we couldn't rely on a 64-bit 
integer type always being available,  so we still needed to keep the 15-bit 
fallback option. But I think that's no longer the case.

--

___
Python tracker 

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



[issue6529] get{pw,gr}{nam,[ug]id}() calls are not re-entrant

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.1, Python 
3.2

___
Python tracker 

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



[issue6529] get{pw,gr}{nam,[ug]id}() calls are not re-entrant

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
stage: test needed -> 

___
Python tracker 

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



[issue6529] get{pw,gr}{nam,[ug]id}() calls are not re-entrant

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

The problem was fixed a couple of years ago. Python uses the reentrant 
functions since commit 23e65b25557f957af840cf8fe68e80659ce28629 / GH-7081.

--
nosy: +christian.heimes
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
superseder:  -> Release GIL for grp.getgr{nam,gid} and pwd.getpw{nam,uid}
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.10, Python 3.11, Python 
3.9

___
Python tracker 

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



[issue6529] get{pw,gr}{nam,[ug]id}() calls are not re-entrant

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.7 -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue24055] unittest package-level set up & tear down module

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

This was added under issue30108.

--
nosy: +iritkatriel
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
superseder:  -> test_site modifies sys.path

___
Python tracker 

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



[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

See also 23597.

--

___
Python tracker 

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



[issue23597] Allow easy display of local variables in log messages?

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
type:  -> enhancement
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue23597] Allow easy display of local variables in log messages?

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

See also 43656.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Yes, I know that (at the moment) it's only documented to work in the parser, 
but since Py_DebugFlag is a general purpose flag, this use could easily be 
extended to other parts of the interpreter as well, e.g. for parsing the 
command line or instrumenting the interpreter to collect debug stats.

In any case, thanks for the quick fix, Pablo.

--

___
Python tracker 

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



[issue45568] @asynccontextmanager is missing in decorator usage example

2021-10-22 Thread Zbigniew Siciarz


New submission from Zbigniew Siciarz :

The docs of contextlib.asynccontextmanager provide an example how to use it as 
a decorator 
(https://docs.python.org/3/library/contextlib.html#contextlib.asynccontextmanager).
 However, the example snippet of code doesn't decorate the timeit() function 
with @asynccontextmanager, leading to reader confusion.

--
assignee: docs@python
components: Documentation
messages: 404739
nosy: docs@python, zsiciarz
priority: normal
severity: normal
status: open
title: @asynccontextmanager is missing in decorator usage example
type: enhancement
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



[issue45568] @asynccontextmanager is missing in decorator usage example

2021-10-22 Thread Zbigniew Siciarz


Change by Zbigniew Siciarz :


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

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I had some time to debug this. It happens because we treat classes and 
functions differently.

The difference between `get_type_hints(B)` and `get_type_hints(B.__init__)` is 
that we use different `global` contexts there:
- For `B` we use `__mro__` entries and extract `globals` and `locals` from 
there: 
https://github.com/python/cpython/blob/86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81/Lib/typing.py#L1792-L1796
- For `B.__init__` we use simplier logic 
https://github.com/python/cpython/blob/86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81/Lib/typing.py#L1822-L1828
 It does not know anything about `__mro__` and super contexts

Funny thing, this problem goes away if we remove `@dataclass` decorator and 
convert our examples into regular classes:

```
# a.py
from __future__ import annotations

import collections


class A:
  x: collections.OrderedDict
  def __init__(self, x: collections.OrderedDict) -> None:
  ...
```

and

```
# b.py
from __future__ import annotations

import a
import typing

class B(a.A):
  pass

print(typing.get_type_hints(B))  
# {'x': }
print(typing.get_type_hints(B.__init__))
# {'x': , 'return': }
```

I am going to try to solve this with something really simple (if no one else is 
working on it).

--
nosy: +sobolevn

___
Python tracker 

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



[issue29374] Doc: signal.sig(timed)wait do not work outside the main thread

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue7438] Allow to use a part of subprocess module during building Python

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

Closed after 12 years of inactivity. The code has moved on quite a bit since 
then.

--
nosy: +iritkatriel
resolution:  -> out of date
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



[issue44959] EXT_SUFFIX is missing '.sl' on HP-UX

2021-10-22 Thread Florin Spătar

Florin Spătar  added the comment:

Can this be merged to python 3.10 as well? Thanks

--

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ae78ffdc9399802621eabcd1668e44a91ec5f45e by Miss Islington (bot) 
in branch '3.10':
bpo-45562: Only show debug output from the parser in debug builds (GH-29140) 
(#29149)
https://github.com/python/cpython/commit/ae78ffdc9399802621eabcd1668e44a91ec5f45e


--

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks you for the catch!

--

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

To add some more context:

This came up while porting eGenix PyRun to Python 3.10. While installing 
setuptools 58.2.0 via "pyrun setup.py install", an exception was raised in 
getframeinfo().

PyRun uses exec() to run Python code:

def pyrun_exec_code_file(filename, globals_dict, locals_dict=None):
with open(filename, 'r', encoding='utf-8') as file:
source = file.read()
code = compile(source, filename, 'exec', optimize=pyrun_optimized)
exec(code, globals_dict, locals_dict)

Using pdb, I then found that the top frame does not have f_lineno set in Python 
3.10.

--

___
Python tracker 

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



[issue44959] EXT_SUFFIX is missing '.sl' on HP-UX

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27430
pull_request: https://github.com/python/cpython/pull/29153

___
Python tracker 

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



[issue44959] EXT_SUFFIX is missing '.sl' on HP-UX

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27429
pull_request: https://github.com/python/cpython/pull/29152

___
Python tracker 

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



[issue44959] EXT_SUFFIX is missing '.sl' on HP-UX

2021-10-22 Thread STINNER Victor


STINNER Victor  added the comment:

> Can this be merged to python 3.10 as well? Thanks

It's unclear to me if it's a new feature or a bugfix. But since the change is 
trivial, I'm fine with backporting it as a bugfix to 3.9 and 3.10 branches.

--

___
Python tracker 

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



[issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported

2021-10-22 Thread Petr Viktorin


Petr Viktorin  added the comment:

Repurposing this bug to track all symbols that don't appear in some 
configurations.

- `Py_FrozenMain` should be added to stable ABI when this is fixed. It was left 
out of the 3.10 stable ABI for only this reason. See discussion here: 
https://mail.python.org/archives/list/capi-...@python.org/thread/5QLI3NUP3OSGLCCIBAQOTX4GEJQBWJ6F/

- `PyModule_Create2` and `PyModule_FromDefAndSpec2` are "temporarily" excluded 
from tests in `Tools/scripts/stable_abi.py`'s `gen_ctypes_test`, so that all 
the other symbols can get regression testing. When this issue is fixed, that 
special case should be removed.

--
title: "Py_FrozenMain" symbol is not exported -> Some C-API symbols (e.g. 
Py_FrozenMain) are not always exported

___
Python tracker 

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



[issue45567] Support TLS Encrypted ClientHello (ECH)

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks for filing this feature request!

The DNS lookup part is out of scope for the ssl module. I don't want to get 
into the DNS business. At $WORK I work on BIND, DNSSEC and DNS over TLS. Secure 
DNS (and DNS in general) is already complicated when you control the entire 
stack and only have to deal with one family of Linux distros. AFAIK there isn't 
even a platform-independent way to perform lookups with abitrary RRTYPEs. 
res_nquery() is only available on some platforms and doesn't work reliable with 
some libcs. I have had issues with EDNS0 on musl in the past. KRB5KDC SRV looks 
with large responses where unreliable. Let's offload the DNS part of consumers 
of the ssl module. They can use python-dns or c-ares.

The ECH part and callback look sensible, though. I'll include the APIs as soon 
as OpenSSL support them.

--

___
Python tracker 

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



[issue45569] Drop support for 15-bit PyLong digits?

2021-10-22 Thread Mark Dickinson


New submission from Mark Dickinson :

Looking at issue #35037 (which is a compatibility issue having to do with 
PYLONG_BITS_IN_DIGIT), I'm wondering whether it would make sense to drop 
support for 15-bit PyLong digits altogether. This would simplify some of the 
code, eliminate a configuration option, and eliminate the scope for ABI 
mismatches like that occurring in #35037.

There were a couple of reasons that we kept support for 15-bit digits when 
30-bit digits were introduced, back in #4258.

- At the time, we wanted to use `long long` for the `twodigits` type with 
30-bit digits, and we couldn't guarantee that all platforms we cared about 
would have `long long` or another 64-bit integer type available.

- It wasn't clear whether there were systems where using 30-bit digits in place 
of 15-bit digits might cause a performance regression.

Now that we can safely rely on C99 support on all platforms we care about, the 
existence of a 64-bit integer type isn't an issue (and indeed, we already rely 
on the existence of such a type in dtoa.c and elsewhere in the codebase).

As to performance, I doubt that there are still platforms where using 15-bit 
digits gives a performance advantage, but I admit I haven't checked.

--
messages: 404746
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Drop support for 15-bit PyLong digits?

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2021-10-22 Thread Simon McVittie


Change by Simon McVittie :


--
keywords: +patch
nosy: +smcv
nosy_count: 1.0 -> 2.0
pull_requests: +27431
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29154

___
Python tracker 

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



[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Can I do something for this pending PEP?

Ask Victor, he should know more. But as far as I know, no one started on it yet.


> I guess the outside user will use it MAYBE.

Py_TPFLAGS_DISALLOW_INSTANTIATION is not part of the limited API, so it would 
be nice to find another use case.

--

___
Python tracker 

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



[issue44959] EXT_SUFFIX is missing '.sl' on HP-UX

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset aa8c3446c085175e65e736b0d2e32719c4d2 by Miss Islington (bot) 
in branch '3.9':
bpo-44959: Add fallback to extension modules with '.sl' suffix on HP-UX 
(GH-27857)
https://github.com/python/cpython/commit/aa8c3446c085175e65e736b0d2e32719c4d2


--

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Alex Waygood


Alex Waygood  added the comment:

@Nikita, I had a go at writing some more rigorous tests regarding this issue. I 
found the same thing you did -- the issue seems:

* Isolated to dataclasses specifically (doesn't occur with TypedDicts, standard 
classes or NamedTuples)
* Isolated to the __init__ method of dataclasses
* Only occurs when you *subclass* a dataclass defined in another module.

My tests are in these two files on my cpython fork:

* 
https://github.com/AlexWaygood/cpython/blob/forward-annotations-bpo-45524/Lib/test/test_future_annotations.py
* 
https://github.com/AlexWaygood/cpython/blob/forward-annotations-bpo-45524/Lib/test/_typing_imports_helper.py

(I'm not proposing adding two new files to the cpython test suite -- just put 
the tests in new files so that I could isolate the new tests from the rest of 
the test suite and understand the problem better.)

--

___
Python tracker 

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



[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI, see bpo-43916 regarding the introduction and rationale of introducing 
Py_TPFLAGS_DISALLOW_INSTANTIATION.

Slightly related: bpo-43908

--

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Alex Waygood


Alex Waygood  added the comment:

If you try running my test script with the `from __future__ import annotations` 
line at the top commented out, however, the error is the same. (`from 
__future__ import annotations` is obviously still there in the module that's 
being imported by the test script.)

--

___
Python tracker 

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



[issue43974] Define Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

The proposal is related to Brett's ticket bpo-45548. I no longer think that we 
should define Py_BUILD_CORE_MODULE unconditionally. Instead I propose to move 
the defines into each C module. This avoids duplication of macros in setup.py 
and Modules/Setup.

--
components: +Extension Modules
nosy: +brett.cannon
title: setup.py should set Py_BUILD_CORE_MODULE as defined macro -> Define 
Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup
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



[issue45545] chdir __exit__ is not safe

2021-10-22 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

>> Can I do something for this pending PEP?
>
> Ask Victor, he should know more. But as far as I know, no one started on it 
> yet.

Quoting PEP 630 (active PEP):

  Whenever this PEP mentions extension modules, the advice also applies to
  built-in modules, such as the C parts of the standard library. The standard
  library is expected to switch to per-module state early.


Why is not PEP 630 enough? (I find these "political" discussions a bit hard to 
follow sometimes :)

--

___
Python tracker 

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



[issue43974] Define Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27432
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29157

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue43974] Define Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup

2021-10-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> I no longer think that we should define Py_BUILD_CORE_MODULE
> unconditionally. Instead I propose to move the defines into each C module.

+1. Explicit is nice.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

I had left a comment on Github about using stderr instead of stdout, to make 
the output more consistent (other parser error messages go to stderr).

Note sure whether that's something you still want to change before closing the 
issue.

--
stage: patch review -> 

___
Python tracker 

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



[issue41592] Make _SubParsersAction public

2021-10-22 Thread Ken Jin


Ken Jin  added the comment:

Closing this because this is a linter problem (inside PyCharm), not a Python 
problem. In the earlier message I provided a solution for PyCharm.

PS, mypy --strict doesn't complain when I import _SubParsersAction, meaning 
most type checkers likely won't complain either.

Thanks for your time!

--
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



[issue45555] Object stays alive for weak reference if an exception happens in constructor

2021-10-22 Thread Joannah Nanjekye

Joannah Nanjekye  added the comment:

I can reproduce the described scenario. I will nosy Pablo and Neil for another 
eye.

I suggest that if it's not a bug, then maybe the docs should be updated to 
explain this behavior.

The only part that talks about exceptions in the documentation for 
weakref.ref() reads as:

"""
Exceptions raised by the callback will be noted on the standard error output, 
but cannot be propagated; they are handled in exactly the same way as 
exceptions raised from an object’s __del__() method.
"""

--
nosy: +nanjekyejoannah, nascheme, pablogsal

___
Python tracker 

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



[issue45570] Simplify setup macros for pyexpat and _elementtree

2021-10-22 Thread Christian Heimes


New submission from Christian Heimes :

setup.py and Modules/Setup define a couple of macros for pyexpat and 
_elementtree. The macros are no longer needed or should be moved to our 
expat_config.h copy.

* HAVE_EXPAT_CONFIG_H is not used by our code and not used by system-wide expat 
header files
* USE_PYEXPAT_CAPI is no longer used by our code
* XML_POOR_ENTROPY should be defined in expat_config.h

--
assignee: christian.heimes
components: Build
messages: 404761
nosy: brett.cannon, christian.heimes, vstinner
priority: normal
severity: normal
status: open
title: Simplify setup macros for pyexpat and _elementtree
type: enhancement
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



[issue34240] Convert test_mmap to use tempfile

2021-10-22 Thread Tim Golden


Tim Golden  added the comment:

Closing as no longer reproducible in the current codebase on my current laptop

--
resolution:  -> not a bug
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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Mark Shannon


Mark Shannon  added the comment:

What is `source`?

--

___
Python tracker 

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



[issue45570] Simplify setup macros for pyexpat and _elementtree

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue45555] Object stays alive for weak reference if an exception happens in constructor

2021-10-22 Thread Mark Dickinson


Mark Dickinson  added the comment:

I don't think this is a bug: there's still a reference to the `A` instance in 
`sys.exc_info()` (specifically, in the exception traceback) in this case, so 
that instance is still alive.

If you add an `except: pass` clause to your `try / finally`, you should see 
that dereferencing the weakref gives `None` in the `finally` clause.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-10-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27435
pull_request: https://github.com/python/cpython/pull/29160

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

In the case of setuptools, this would be the file setup.py, but I think the 
specific file is not relevant. I can try to come up with a shorter example.

--

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread Christian Heimes


New submission from Christian Heimes :

I think that makesetup uses the wrong CFLAGS variable for shared modules. The 
script uses PY_CFLAGS:

no) cc="$cc \$(CCSHARED) \$(PY_CFLAGS) \$(PY_CPPFLAGS)";;

while setup.py uses PY_CFLAGS_NODIST:

set_compiler_flags('CFLAGS', 'PY_CFLAGS_NODIST')

The flags are similar but not equal. Amongst others PY_CFLAGS does not include 
Include/internal while PY_CFLAGS_NODIST has -I./Include/internal.

--
components: Build
messages: 404766
nosy: brett.cannon, christian.heimes, twouters, vstinner
priority: normal
severity: normal
status: open
title: Modules/makesetup uses wrong CFLAGS for *shared*
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2021-10-22 Thread tongxiaoge


New submission from tongxiaoge :

The python version I currently use in my development environment is 3.7.4. 
Using the following script, the program has never output, and seems to have 
entered an infinite loop.

To reproduce the issue we can use the following code:

from urllib.request import AbstractBasicAuthHandler
auth_handler = AbstractBasicAuthHandler()
header = {'www-authenticate': 'Basic ' + ',' * 64 + ' ' + 'foo' + ' ' +'realm'}
auth_handler.http_error_auth_reqed('www-authenticate','unused','unused',header)




So I tried to upgrade it to version 3.7.12, and the program will directly 
report an error. The information is as follows:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.7/urllib/request.py", line 990, in 
http_error_auth_reqed
headers = headers.get_all(authreq)
AttributeError: 'dict' object has no attribute 'get_all'

This problem also exists when I upgrade Python 3 to 3.11.0a1. In Python version 
3.7.4, the cause of program hang on seems to be a security vulnerability. Refer 
to https://bugs.python.org/issue39503. The reason for CVE is not the wrong type 
of headers. However, after repairing CVE, it seems that the type of headers is 
limited? For the CVE patch, I tried to only fix the part of the regular 
expression, and the program can run. So, after repairing CVE-2020-8492, what 
type should the headers parameter be for http_error_auth_reqed  function? Based 
on the current code, how should I adapt and modify it to make it run normally?

--
components: Library (Lib)
files: 3.7.4 hang on.png
messages: 404767
nosy: sxt1001
priority: normal
severity: normal
status: open
title: urllib.request:AttributeError: 'dict' object has no attribute 'get_all' 
in http_error_auth_reqed function
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50386/3.7.4 hang on.png

___
Python tracker 

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



[issue43974] Define Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 03e9f5dc751b8c441a85f428abc3f432ffe46345 by Christian Heimes in 
branch 'main':
bpo-43974: Move Py_BUILD_CORE_MODULE into module code (GH-29157)
https://github.com/python/cpython/commit/03e9f5dc751b8c441a85f428abc3f432ffe46345


--

___
Python tracker 

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



[issue43974] Define Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


--
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



[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2021-10-22 Thread tongxiaoge


Change by tongxiaoge :


Added file: https://bugs.python.org/file50387/3.7.4 fix Regex   ok.png

___
Python tracker 

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



[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2021-10-22 Thread tongxiaoge


Change by tongxiaoge :


Added file: https://bugs.python.org/file50388/3.7.12 fail.png

___
Python tracker 

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



[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2021-10-22 Thread tongxiaoge


Change by tongxiaoge :


Added file: https://bugs.python.org/file50389/3.11.0a1 fail.png

___
Python tracker 

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



[issue41592] Make _SubParsersAction public

2021-10-22 Thread Eric Pederson


Eric Pederson  added the comment:

Yes - that was the first thing I tried and why I logged the bug.  I will log a 
bug with Pycharm but it still seems like the long term solution is to make 
_SubParsersAction public since it is used like a public object.  I thought that 
logging the bug here would be the start of the discussion by the argparse 
maintainers.  Where can I get their attention?

--

___
Python tracker 

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



[issue45572] urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function

2021-10-22 Thread tongxiaoge


Change by tongxiaoge :


--
nosy: +vstinner

___
Python tracker 

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



[issue45551] EmailMessage utf-8 folding error

2021-10-22 Thread R. David Murray


R. David Murray  added the comment:

I'm pretty sure this is a duplicate report and that we worked on a fix, but I 
don't know if it got committed because I can't find the issue...

(To be clear, the problem here is the lack of whitespace at the start of the 
folded part of the header.)

--

___
Python tracker 

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



[issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue45555] Object stays alive for weak reference if an exception happens in constructor

2021-10-22 Thread Matias G


Matias G  added the comment:

About the reference in exception: I thought that Python 3 didn't have
the need for `sys.exc_clear()` (which has been removed), specifically
for this kind of problem.

The code I use is in fact more complex than the small snippet I posted
here to reproduce the (presumed) bug ; what I see, is that the reference
is **never** removed. The weakref cannot die.

My program is a REPL, I want exceptions to bubble up to users, so
catching it before it reaches the user layer is not so great.

--

___
Python tracker 

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



[issue45502] Fix test_shelve and make it discoverable

2021-10-22 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset b781cc3bfce7c052728b06aad9f1a467cced289d by Serhiy Storchaka in 
branch 'main':
bpo-45502: Fix test_shelve (GH-29003)
https://github.com/python/cpython/commit/b781cc3bfce7c052728b06aad9f1a467cced289d


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45562] python -d creates lots of tokenizer messages

2021-10-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yeah, let me fix that in another PR

--

___
Python tracker 

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



[issue41592] Make _SubParsersAction public

2021-10-22 Thread Ken Jin


Ken Jin  added the comment:

>  Where can I get their attention?

I've nosied Raymond on this bug, he should be receiving our messages.

--

___
Python tracker 

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2021-10-22 Thread Richard van den Berg


Richard van den Berg  added the comment:

I just ran into this 12 year old issue. Can this be merged please?

--
nosy: +richard.security.consultant

___
Python tracker 

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



[issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task

2021-10-22 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
keywords: +patch
nosy: +nanjekyejoannah
nosy_count: 2.0 -> 3.0
pull_requests: +27437
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29163

___
Python tracker 

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



[issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

@bernat and ncoghlan, please see if the wording I have used in the linked PR 
helps to clarify this.

--
stage: patch review -> 

___
Python tracker 

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



[issue42538] AsyncIO strange behaviour

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I opened a documentation PR agreeing with @ncoghlan, that adds this behavior. 
See https://bugs.python.org/issue44665

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue42538] AsyncIO strange behaviour

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I meant, "that describes the behaviour"

--

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +gvanrossum, kj

___
Python tracker 

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



[issue45555] Object stays alive for weak reference if an exception happens in constructor

2021-10-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I concur, this is not a bug. The contract of the weakref is that the callback 
will be triggered when the object is destroyed, but here the object is not 
destroyed because is owned by the frame in the traceback.

As Mark correctly mentions, the object should die when the try/except/finally 
ends.

I am not sure if it makes sense to document this because this does not really 
relate to weak reference, but why an object is alive. This is by far not the 
only weird way that can keep the object alive and maintain the behaviour so I 
don't know if it makes sense to document this because there are many many other 
confusing scenarios.

For now, I am marking this as "not a bug" but keeping it open in case we want 
to improve the docs.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

Could you or somebody else please create a PR with patch and a test case?

--
versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 
3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-10-22 Thread Christian Heimes


New submission from Christian Heimes :

pkg-config [1] is a standard tool on Linux and other platforms to detect 
presence of dependencies as well as to figure out which compiler and linker 
flags they require. Development packages provide a .pc file, e.g. ncurses 
provides a ncursesw.pc file.

$ pkg-config --libs --cflags ncursesw
-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -lncursesw -ltinfo

I propose to use a modified version of pkg-config's 
PKG_HAVE_DEFINE_WITH_MODULES macro in our configure script. On succss the 
modified macro defines:

* HAVE_FOO=1
* FOO_CFLAGS="some compile flags"
* FOO_LIBS="some library flags for linker"

On error, it sets nothing and does not cause configure to stop with an error.

The macro also allows users to override flags by setting FOO_CFLAGS and 
FOO_LIBS env vars. HAVE_FOO is added to pyconfig.h. The FOO_CFLAGS/LIBS are 
added to Makefile, from where it can be consumed by Modules/Setup.

Eventually Python could use the flags in setup.py, too. For now I would like to 
start with Modules/Setup. It is only used by some power users and has less risk 
of breaking the setup of beginners.

[1] https://www.freedesktop.org/wiki/Software/pkg-config/

--
assignee: christian.heimes
components: Build
messages: 404781
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Use pkg-config autoconf macros to detect flags for Modules/Setup
type: enhancement
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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task

2021-10-22 Thread Chris Meyer


Chris Meyer  added the comment:

Is there a way to reproduce this issue? I run the following code in Python 3.9 
and it works as expected (prints "xyz" twice).

import asyncio
import gc

async def xyz():
print("xyz")

event_loop = asyncio.get_event_loop()

event_loop.create_task(xyz())

t = event_loop.create_task(xyz())
del t

gc.collect()

event_loop.stop()
event_loop.run_forever()

--
nosy: +cmeyer

___
Python tracker 

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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

I added some whitespace to Modules/Setup. All lines starting with ``#([a-z_])`` 
compile cleanly on Fedora 34 with all dependencies available. dbm, tkinter, and 
sqlite are missing or untested.


$ sed -E -i 's/^#([a-z_])/\1/g' Modules/Setup
$ make
...
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc   _asyncio   _bisect 
_blake2_bz2   _codecs_cn  
_codecs_hk _codecs_iso2022_codecs_jp  
_codecs_kr _codecs_tw _contextvars
_crypt _csv   _curses 
_curses_panel  _datetime  _elementtree
_hashlib   _heapq _json   
_lsprof_lzma  _md5
_multibytecodec_opcode_pickle 
_posixsubprocess   _queue _random 
_sha1  _sha256_sha3   
_sha512_socket_ssl
_statistics_struct_testbuffer 
_testimportmultiple   _testinternalcapi   _testmultiphase 
_typing_xxsubinterpreters   _xxtestfuzz 
_zoneinfo  array  audioop 
binascii   cmath  fcntl   
grpmath   mmap
nisossaudiodevpwd 
pyexpatreadline   resource
select spwd   syslog  
termiostime   unicodedata 
xxlimited  xxlimited_35   zlib   

$  ./python -c "import sys; print(sys.builtin_module_names)"
('_abc', '_ast', '_asyncio', '_bisect', '_blake2', '_bz2', '_codecs', 
'_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', 
'_codecs_tw', '_collections', '_contextvars', '_crypt', '_csv', '_curses', 
'_curses_panel', '_datetime', '_elementtree', '_functools', '_hashlib', 
'_heapq', '_imp', '_io', '_json', '_locale', '_lsprof', '_lzma', '_md5', 
'_multibytecodec', '_opcode', '_operator', '_pickle', '_posixsubprocess', 
'_queue', '_random', '_sha1', '_sha256', '_sha3', '_sha512', '_signal', 
'_socket', '_sre', '_ssl', '_stat', '_statistics', '_string', '_struct', 
'_symtable', '_testbuffer', '_testimportmultiple', '_testinternalcapi', 
'_testmultiphase', '_thread', '_tokenize', '_tracemalloc', '_typing', 
'_warnings', '_weakref', '_xxsubinterpreters', '_xxtestfuzz', '_zoneinfo', 
'array', 'atexit', 'audioop', 'binascii', 'builtins', 'cmath', 'errno', 
'faulthandler', 'fcntl', 'gc', 'grp', 'itertools', 'marshal', 'math', 'mmap', 
'nis', 'ossaudiodev', 'posix', 'pwd', 'pyexpat'
 , 'readline', 'resource', 'select', 'spwd', 'sys', 'syslog', 'termios', 
'time', 'unicodedata', 'xx', 'xxlimited', 'xxlimited_35', 'xxsubtype', 'zlib')
$ ldd python
linux-vdso.so.1 (0x7fffa1f4)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7f6032fe2000)
libdl.so.2 => /lib64/libdl.so.2 (0x7f6032fdb000)
libutil.so.1 => /lib64/libutil.so.1 (0x7f6032fd6000)
libm.so.6 => /lib64/libm.so.6 (0x7f6032e92000)
libcrypt.so.2 => /lib64/libcrypt.so.2 (0x7f6032e58000)
libnsl.so.2 => /lib64/libnsl.so.2 (0x7f6032e3c000)
libtirpc.so.3 => /lib64/libtirpc.so.3 (0x7f6032e0a000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x7f6032df7000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x7f6032dcb000)
libz.so.1 => /lib64/libz.so.1 (0x7f6032db1000)
libreadline.so.8 => /lib64/libreadline.so.8 (0x7f6032d59000)
libssl.so.1.1 => /lib64/libssl.so.1.1 (0x7f6032cbc000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x7f60329cc000)
libncursesw.so.6 => /lib64/libncursesw.so.6 (0x7f603298d000)
libtinfo.so.6 => /lib64/libtinfo.so.6 (0x7f603295e000)
libpanel.so.6 => /lib64/libpanel.so.6 (0x7f6032958000)
libc.so.6 => /lib64/libc.so.6 (0x7f6032789000)
/lib64/ld-linux-x86-64.so.2 (0x7f6033029000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x7f6032732000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x7f6032652000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x7f603263a000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x7f6032633000)
libncurses.so.6 => /lib64/libncurses.so.6 (0x7f6032606000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x7f60325f5000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x7f60325ec000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x7f60325d2000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x7f60325a6000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x7f603250f000)

--
nosy: +brett.cannon, twouters

___
Python tracker 


[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

$ find build/lib.linux-x86_64-3.11/ -name '*.so' | sort
build/lib.linux-x86_64-3.11/_ctypes.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_ctypes_test.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_dbm.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_decimal.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_gdbm.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_multiprocessing.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_posixshmem.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_sqlite3.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_testcapi.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_tkinter.cpython-311-x86_64-linux-gnu.so
build/lib.linux-x86_64-3.11/_uuid.cpython-311-x86_64-linux-gnu.so

--

___
Python tracker 

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



[issue19460] Add test for MIMENonMultipart

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be converted to a GitHub PR.

--
keywords: +easy -patch
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

___
Python tracker 

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



[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread Nikita Sobolev

New submission from Nikita Sobolev :

Recently, GitHub started to show a new warning:

> Check warning on line 999 in Parser/tokenizer.c
> GitHub Actions / Address sanitizer
> Parser/tokenizer.c#L999
> ‘print_escape’ defined but not used [-Wunused-function]

Link: 
https://github.com/python/cpython/pull/29158/files#file-parser-tokenizer-c-L999

I guess this happens because `print_escape` is only used when `Py_DEBUG` is set:

```
#if defined(Py_DEBUG)
if (Py_DebugFlag) {
printf("line[%d] = ", tok->lineno);
print_escape(stdout, tok->cur, tok->inp - tok->cur);
printf("  tok->done = %d\n", tok->done);
}
#endif
```

Will this be a proper fix? Or do we need it for some other reason?

```
#if defined(Py_DEBUG)
static void
print_escape(FILE *f, const char *s, Py_ssize_t size)
// ...
# endif
```

If it's fine, I will send a PR :)

--
messages: 404786
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Warning: ‘print_escape’ defined but not used

___
Python tracker 

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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-10-22 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



  1   2   3   >