[issue43999] Cannot pickle frozen dataclasses with slots

2021-05-01 Thread Eric V. Smith
Change by Eric V. Smith : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue44004] test_nntplib is failing in all buildbots

2021-05-01 Thread Christian Heimes
Christian Heimes added the comment: RHEL 7 doesn't come with OpenSSL 1.1.1. I'll talk to Charis and check if he can provide local copies of OpenSSL 1.1.1. Or we can drop RHEL 7 testing. Regular support ended almost 2 years ago. -- ___ Python track

[issue44005] multiple socket bind failure on Mac OS X with SO_REUSEADDR

2021-05-01 Thread giangy
New submission from giangy : I am connecting to a server using a multicast UDP socket. Running two instances of the code below, in two shell windows on the same computer, it works on both Windows 10 and Ubuntu 18.04, but it fails on Mac OS 10.15.7, reporting: >>> sock.bind(('', MCAST_PORT))

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2021-05-01 Thread Csaba Torda
Change by Csaba Torda : -- nosy: +TCsaba ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue44004] test_nntplib is failing in all buildbots

2021-05-01 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: If would be great if we can have these buildbots using a locally compiled version of OpenSSL. -- ___ Python tracker ___ _

[issue44002] Use functools.lru_cache in urllib.parse instead of 1996 custom caching

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +24486 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25798 ___ Python tracker ___

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: That was anecdotal evidence: ``` Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:10:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def func(arg=1, *, kwarg=2): pass ... >>> import func

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: the pure python functools.lru_cache doesn't get this right either. here's a desirable testcase for this bug: ``` def test_lru_defaults_bug44003(self): @self.module.lru_cache(maxsize=None) def func(arg='ARG', *, kw='KW'): ret

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think this should be done. We want the lru_cache to be a pass-through. Applying defaults or keyword-only/positional-only restrictions is the responsibility of the inner function. FWIW, here are the fields that Nick selected to be included in

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +24487 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25800 ___ Python tracker

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: __defaults__ and __kwdefaults__ get used for code introspection. Just as __annotations__ does. __annotations__ is already available on the lru_cache wrapped function. All of those seem to go together from a runtime inspection point of view. --

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: An inner function can't know if somebody else might want to inspect it. This is a decorator that does not change anything about the argument signature of the wrapped function, carrying over the reference to meta-information about that by default seems to

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm working on a more specialized case of this for functools.lru_cache in bpo-issue44003. But I believe this issue also makes sense. It is basically suggesting that __defaults__ and __kwdefaults__ should be included in the default set of assigned= attrib

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: https://bugs.python.org/issue41232 covers the more general case of suggesting changing update_wrapper's behavior. That would alleviate the need to fix the pure python implementation within my own PR. -- ___ Pyt

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Change by Gregory P. Smith : -- type: behavior -> enhancement versions: -Python 3.10, Python 3.9 ___ Python tracker ___ ___ Python-

[issue43972] Simple HTTP Request Handler in http.server does not set a content-length and does not close connections on 301s

2021-05-01 Thread Stephen Rosen
Stephen Rosen added the comment: Ach! Sorry! I didn't even realize this but the issue only arises when you are modifying the handler to set the protocol to HTTP/1.1 . In HTTP/1.0 , there's no notion of persistent connections, so the issue does not arise. But when the protocol version change

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't really like it. Carrying forward these attributes isn't the norm for wrapping functions. The __defaults__ argument is normally only used where it has an effect rather than in a wrapper where it doesn't. Given that it is mutable, it invites a

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Oh, I didn't realize mutating those would actually change the code runtime behavior. But it makes sense, those are needed before the code object is entered. Yeah that is different, and suggests making this the default is not actually desired. (this issu

[issue44006] symbol documentation still exists

2021-05-01 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : symbol is being removed in 3.10, but https://docs.python.org/3.10/library/symbol.html still exists and claims it will be removed in "future versions". It was removed in bpo-40939 / GH-21005. -- assignee: docs@python components: Documentation messag

[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Arcadiy Ivanov
New submission from Arcadiy Ivanov : $ ~/.pyenv/versions/3.8.6/bin/python3.8 Python 3.8.6 (default, Oct 8 2020, 13:32:06) [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from urllib.parse import urlparse >>> urlparse(

[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Arcadiy Ivanov
Change by Arcadiy Ivanov : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue44006] symbol documentation still exists

2021-05-01 Thread Shantanu
Shantanu added the comment: Do you see what's generating it? As far as I can tell, the RST was removed a while ago in https://github.com/python/cpython/pull/21624 -- nosy: +hauntsaninja ___ Python tracker _

[issue44006] symbol documentation still exists

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: You're right, the file doesn't exist on master. I guess there must be some sort of caching. For what it's worth, I found it by going to the module documentation on an earlier version and using the dropdown to navigate to 3.10. If you go to the dataclasses do

[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Martin Panter
Martin Panter added the comment: I suspect this comes from Issue 27657. Consider how similar URLs like tel:123 or javascript:123 should be parsed. -- nosy: +martin.panter ___ Python tracker

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We should not do this, because the wrapping function may have different defaults, and updating __defaults__ would make it use the wrapped function's defaults. Example: >>> def f(y=1): ... print(y) ... >>> f() 1 >>> f.__defaults__ (1,) >>> f.__defaults_

[issue43987] Add "Annotations Best Practices" to HOWTO

2021-05-01 Thread Larry Hastings
Larry Hastings added the comment: New changeset 49b26fa517165f991c35a4afcbef1fcb26836bec by larryhastings in branch 'master': bpo-43987: Add "Annotations Best Practices" HOWTO doc. (#25746) https://github.com/python/cpython/commit/49b26fa517165f991c35a4afcbef1fcb26836bec -- ___

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Even if we shouldn't blindly propagate defaults (wrong in some wrapping scenarios), there is still a problem here as noted in Thor's opening message. A bug exists between functools.wraps and inspect.signature. The signature reported is wrong. why? -

[issue44007] urlparse("host:123", "http") inconsistent between 3.8 and 3.9

2021-05-01 Thread Arcadiy Ivanov
Arcadiy Ivanov added the comment: I guess I'll work around this, thanks. -- stage: -> resolved status: open -> closed ___ Python tracker ___ _

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: rejecting. code trying to make direct use of __defaults__ is likely better off using inspect.signature(). there might be an issue with inspect in some cases (https://bugs.python.org/issue41232) but I do not believe that is true for lru_cache wrapped thin

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: That's because inspect.signature by default follows the `.__wrapped__` attribute, so it gives you the signature for the *wrapped* function. That behavior is occasionally problematic (I ran into it in the context of https://github.com/quora/pyanalyze/issues/8

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: That makes sense. It seems like we're missing information signature() would need to be able to differentiate between when it should default to follow .__wrapped__ vs when it shouldn't. Neither default can satisfy everyone. --

[issue41232] Python `functools.wraps` doesn't deal with defaults correctly

2021-05-01 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: We could add a new argument to `@functools.wraps()` to differentiate between a wrapper with the same signature and one with a different signature. Here's a possible design: * functools.wraps adds a new keyword-only argument signature_changed. It defaults to

[issue44008] os.walk and other directory traversal does not handle recursive mounts on Windows

2021-05-01 Thread R0b0t1
New submission from R0b0t1 : Using `os.walk` to traverse a filesystem on Windows does not terminate in the case of a recursive mountpoint existing somewhere in the path. In my case C:\circlemount is linked to C:\, producing paths such as C:\circlemount\circlemount\circlemount\circlemount\...

[issue43733] PEP 597: netrc uses locale encoding.

2021-05-01 Thread Inada Naoki
Inada Naoki added the comment: New changeset fd0bc7e7f4f2c7de98a1ebc7ad1ef65b8f8f7ad6 by Inada Naoki in branch 'master': bpo-43733: netrc try to use UTF-8 before using locale encoding. (GH-25781) https://github.com/python/cpython/commit/fd0bc7e7f4f2c7de98a1ebc7ad1ef65b8f8f7ad6 -- _

[issue43733] PEP 597: netrc uses locale encoding.

2021-05-01 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots

2021-05-01 Thread Shreyan Avigyan
Change by Shreyan Avigyan : -- nosy: +shreyanavigyan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue44003] functools.lru_cache omits __defaults__ attribute from wrapped function

2021-05-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I meant that I looked up the code of functools.update_wrapper() and did not see that it sets the __defaults__ attribute. In your example in msg392643 you use functools.update_wrapper() incorrectly. The first argument is wrapper, and the second argument is

[issue43997] dataclasses documentation needs version added for match_args, kw_only, and slots

2021-05-01 Thread Shreyan Avigyan
Change by Shreyan Avigyan : -- keywords: +patch pull_requests: +24488 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25803 ___ Python tracker _

<    1   2