[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://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

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



[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


--

___
Python tracker 

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



[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\...

A drive mount point may be set up as follows:

```diskpart (enters shell)
list volume`
select volume ${#}`
assign mount=${path}
```

Notably this only happens for Win32 python. Cygwin and MSYS2 pythons as well as 
the pythons distributed with some packages like Inkscape behave properly.

--
components: Windows
messages: 392666
nosy: R0b0t1, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.walk and other directory traversal does not handle recursive mounts 
on Windows
type: behavior
versions: Python 3.8

___
Python tracker 

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



[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 False for backward compatibility.
* If signature_changed is True:
  * __annotations__ are not copied
  * __wrapped__ is not set on the wrapping function. Instead, we set a new 
attribute __wrapped_with_changed_signature__ (that's a pretty terrible name, 
open to suggestions). This will make inspect.signature not look at the wrapped 
function.

--

___
Python tracker 

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



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

--

___
Python tracker 

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



[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/82), but I don't think it can be 
safely changed.

--

___
Python tracker 

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



[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 things.

--
resolution:  -> rejected
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



[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 

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



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

--

___
Python tracker 

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



[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


--

___
Python tracker 

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



[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__ = ()
>>> f()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: f() missing 1 required positional argument: 'y'

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[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 

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



[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 docs and select a version where it doesn't exist 
yet (e.g., 3.6), it redirects to https://docs.python.org/3.6/. That feels like 
the right behavior here too.

--

___
Python tracker 

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



[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 

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



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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("host:123", "http")
ParseResult(scheme='http', netloc='', path='host:123', params='', query='', 
fragment='')
>>> 

$ ~/.pyenv/versions/3.8.9/bin/python3.8
Python 3.8.9 (default, May  1 2021, 23:27:11) 
[GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> urlparse("host:123", "http")
ParseResult(scheme='http', netloc='', path='host:123', params='', query='', 
fragment='')
>>> 

$ ~/.pyenv/versions/3.9.4/bin/python3.9
Python 3.9.4 (default, Apr  8 2021, 17:27:49) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> urlparse("host:123", "http")
ParseResult(scheme='host', netloc='', path='123', params='', query='', 
fragment='')
>>> 


While I'm not sure, it seems to me that 3.9 is wrong here, given that the 
default scheme is specified as a second parameter to URL parse, i.e. "host:123" 
should be treated as "http://host:123; as in 3.8.

We also relied on this parser behavior, i.e. for us it's a regression.

--
components: Library (Lib)
messages: 392654
nosy: arcivanov
priority: normal
severity: normal
status: open
title: urlparse("host:123", "http") inconsistent between 3.8 and 3.9
versions: 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



[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
messages: 392653
nosy: Jelle Zijlstra, docs@python, lys.nikolaou
priority: normal
severity: normal
status: open
title: symbol documentation still exists
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



[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 issue and the other one)

I guess our rule is that introspection code really must check for and be ready 
to handle .__wrapped__ if its goal is robustness?

--

___
Python tracker 

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



[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 
change that won't work.  For example:

>>> def pow(base, exp=2):
return base ** exp

>>> pow.__defaults__
(2,)
>>> pow.__defaults__ = (3,)
>>> pow(2) 
8

Also, an introspection function can only meaningfully use defaults when 
accompanied by the names of the fields:

>>> pow.__code__.co_varnames
('base', 'exp')

However, these aren't visible by directly introspecting the wrapper.

FWIW, we've never had a user reported issue regarding the absence of 
__defaults__.  If ain't broke, let's don't "fix" it.

Nick and Serhiy, any thoughts?

--

___
Python tracker 

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



[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 changes to 1.1 , persistent connections are the 
norm, and curl will wait indefinitely.

The following short script is sufficient to reproduce:
```
import http.server


class CustomRequestHandler(http.server.SimpleHTTPRequestHandler):
protocol_version = "HTTP/1.1"


with http.server.HTTPServer(("", 8000), CustomRequestHandler) as httpd:
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt received, exiting.")
```

After double-checking the docs, the current doc for `protocol_version` [1] is 
quite clear about this:
"your server must then include an accurate Content-Length header (using 
send_header()) in all of its responses to clients"

I still think the fix I proposed is an improvement. Setting a Content-Length 
isn't forbidden in HTTP/1.0 , and it guarantees good behavior when HTTP/1.1 is 
used.

[1] 
https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.protocol_version

--

___
Python tracker 

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



[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-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

--

___
Python tracker 

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



[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= attributes that functools.update_wrapper applies.

The argument in favor of this is that it already has __annotations__ in the 
default set.  With that, the default isn't really correct for use on any 
decorator that modifies the meaning or overall call signature of the function 
if it happens to have annotations.  as __annotations__ and __defaults__ and 
__kwdefaults__ are all abstract callable introspection interfaces.

>From Python's perspective some may call each of these an Enhancement rather 
>than a Bugfix.  I'm fine with that.  It doesn't come up super often but would 
>make Python things more consistent if it were done.

Your PR makes sense to me, though we'll need to understand and fix that test 
failure you identified where it appears to be potentially testing for the wrong 
thing (I haven't studied it enough study to say yet).

--
nosy: +gregory.p.smith

___
Python tracker 

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



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 make sense.

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



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

--

___
Python tracker 

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



[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 

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



[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 
update_wrapper():  ('__module__', '__name__', '__qualname__', '__doc__', 
'__annotations__').

Those are sufficient to get help() to work which is all we were aiming for:

>>> from functools import *
>>> @lru_cache
def cached_func(b=5):
pass

>>> help(cached_func)
Help on _lru_cache_wrapper in module __main__:

cached_func(b=5)

--
nosy: +rhettinger

___
Python tracker 

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



[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'):
return arg, kw

self.assertEqual(func.__wrapped__.__defaults__, ('ARG',))
self.assertEqual(func.__wrapped__.__kwdefaults__, {'kw': 'KW'})
self.assertEqual(func.__defaults__, ('ARG',))
self.assertEqual(func.__kwdefaults__, {'kw': 'KW'})
```

results in

```
ERROR: test_lru_defaults_bug44003 (test.test_functools.TestLRUC)
--
Traceback (most recent call last):
  File "/Users/greg/oss/python/gpshead/Lib/test/test_functools.py", line 1738, 
in test_lru_defaults_bug44003
self.assertEqual(func.__defaults__, ('ARG',))
AttributeError: 'functools._lru_cache_wrapper' object has no attribute 
'__defaults__'

==
FAIL: test_lru_defaults_bug44003 (test.test_functools.TestLRUPy)
--
Traceback (most recent call last):
  File "/Users/greg/oss/python/gpshead/Lib/test/test_functools.py", line 1738, 
in test_lru_defaults_bug44003
self.assertEqual(func.__defaults__, ('ARG',))
AssertionError: None != ('ARG',)
```

--

___
Python tracker 

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



[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 functools
>>> from functools import lru_cache, update_wrapper
>>> @lru_cache
... def cached_func(arg=1, *, kwargs=2): pass
... 
>>> def x(*args, **kwargs): func(*args, **kwargs)
... 
>>> updated_x = update_wrapper(func, x)
>>> x

>>> updated_x

>>> updated_x.__defaults__
(1,)
>>> updated_x.__kwdefaults__
{'kwarg': 2}
>>> func.__defaults__
(1,)
>>> func.__kwdefaults__
{'kwarg': 2}
>>> cached_func.__defaults__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'functools._lru_cache_wrapper' object has no attribute 
'__defaults__'
>>> cached_func.__kwdefaults__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'functools._lru_cache_wrapper' object has no attribute 
'__kwdefaults__'
```

--

___
Python tracker 

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



[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 

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



[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 

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



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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))
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 48] Address already in use

~~

import socket 

CLIENT_IP = '192.168.1.53'

MCAST_ADDR = '239.0.1.1'
MCAST_PORT = 1

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, 
socket.inet_aton(CLIENT_IP))
sock.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, 
socket.inet_aton(MCAST_ADDR) + socket.inet_aton(CLIENT_IP))
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, 
socket.inet_aton(CLIENT_IP))
sock.bind(('', MCAST_PORT))

--
components: Library (Lib), macOS
messages: 392641
nosy: ned.deily, ronaldoussoren, sforzagianluca
priority: normal
severity: normal
status: open
title: multiple socket bind failure on Mac OS X with SO_REUSEADDR
type: behavior
versions: Python 3.8

___
Python tracker 

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



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

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



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks Ethan and Roberto!

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:

What's the plan for heap type exceptions? PyErr_NewException() and 
PyErr_NewExceptionWithDoc() doesn't accept flags.

--

___
Python tracker 

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



[issue41277] documentation: os.setxattr() errno EEXIST and ENODATA

2021-05-01 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue41277] documentation: os.setxattr() errno EEXIST and ENODATA

2021-05-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24485
pull_request: https://github.com/python/cpython/pull/25795

___
Python tracker 

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



[issue41277] documentation: os.setxattr() errno EEXIST and ENODATA

2021-05-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +24484
pull_request: https://github.com/python/cpython/pull/25794

___
Python tracker 

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



[issue41277] documentation: os.setxattr() errno EEXIST and ENODATA

2021-05-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

Sorry, ZackerySpytz. I saw PR 25742 first and reviewed and merged it before I 
saw that you have an earlier PR on this issue.

--
nosy: +eric.smith

___
Python tracker 

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



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread miss-islington


miss-islington  added the comment:


New changeset 1ae05fdf2d0a4cf12e355ad74c437cbfa89c9b93 by Ethan Furman in 
branch 'master':
Revert "bpo-43989: Temporarily disable warnings in ssltests (GH-25780)" 
(GH-25793)
https://github.com/python/cpython/commit/1ae05fdf2d0a4cf12e355ad74c437cbfa89c9b93


--
nosy: +miss-islington

___
Python tracker 

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



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset ddbef71a2c166a5d5dd168e26493973053a953d6 by Christian Heimes in 
branch 'master':
bpo-43916: Rewrite new hashlib tests, fix typo (GH-25791)
https://github.com/python/cpython/commit/ddbef71a2c166a5d5dd168e26493973053a953d6


--

___
Python tracker 

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



[issue43957] [Enum] update __contains__ to return True for valid values

2021-05-01 Thread Ethan Furman


Change by Ethan Furman :


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



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +24483
pull_request: https://github.com/python/cpython/pull/25793

___
Python tracker 

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



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 55e5c680dde39c934bf162965820787272ce95f9 by Roberto Hueso in 
branch 'master':
bpo-43989: Add signal format specifier for unix_events (GH-25769)
https://github.com/python/cpython/commit/55e5c680dde39c934bf162965820787272ce95f9


--

___
Python tracker 

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



[issue43957] [Enum] update __contains__ to return True for valid values

2021-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ethan can we close this issue?

--

___
Python tracker 

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



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have transformed 
https://discuss.python.org/t/list-of-built-in-types-converted-to-heap-types/8403
 into a wiki. Tell me if you need some alterations of something is missing.

--

___
Python tracker 

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



[issue44004] test_nntplib is failing in all buildbots

2021-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Should be fixed by a5669b3c627e64c9196d9bb58b733eb723d34e99

Does this mean that all the RHEL7 buildbots are not testing the SSL module?

--

___
Python tracker 

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



[issue44004] test_nntplib is failing in all buildbots

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:

Should be fixed by a5669b3c627e64c9196d9bb58b733eb723d34e99

--

___
Python tracker 

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



[issue43998] Increase security of TLS settings in 3.10

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset a5669b3c627e64c9196d9bb58b733eb723d34e99 by Christian Heimes in 
branch 'master':
bpo-43998: Fix testing without ssl module (GH-25790)
https://github.com/python/cpython/commit/a5669b3c627e64c9196d9bb58b733eb723d34e99


--

___
Python tracker 

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2021-05-01 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24482
pull_request: https://github.com/python/cpython/pull/25792

___
Python tracker 

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



[issue44004] test_nntplib is failing in all buildbots

2021-05-01 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

test test_nntplib crashed -- Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/libregrtest/runtest.py",
 line 282, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/libregrtest/runtest.py",
 line 229, in _runtest_inner2
the_module = importlib.import_module(abstest)
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/importlib/__init__.py",
 line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1050, in _gcd_import
  File "", line 1027, in _find_and_load
  File "", line 1006, in _find_and_load_unlocked
  File "", line 688, in _load_unlocked
  File "", line 882, in exec_module
  File "", line 241, in _call_with_frames_removed
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_nntplib.py",
 line 350, in 
class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
  File 
"/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto-pgo/build/Lib/test/test_nntplib.py",
 line 371, in NetworkedNNTP_SSLTests
ssl_context = ssl._create_unverified_context()
AttributeError: 'NoneType' object has no attribute '_create_unverified_context'
1 test failed again:
test_nntplib

Example failure:

https://buildbot.python.org/all/#/builders/96/builds/107/steps/5/logs/stdio

--
assignee: christian.heimes
components: SSL
messages: 392628
nosy: christian.heimes, pablogsal
priority: normal
severity: normal
status: open
title: test_nntplib is failing in all buildbots

___
Python tracker 

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



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

2021-05-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Where does functools.update_wrapper() set __defaults__?

--

___
Python tracker 

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



[issue512981] readline /dev/tty problem

2021-05-01 Thread Pierre


Pierre  added the comment:

I suggest to reopen this issue as there was a regression with python3.

import sys
sys.stdin = open("/dev/tty", "r")
import readline
print(input())

Write some text and press left.
Expected: the cursor goes left.
Actual: prints '^[[D' as is readline had not been imported.

bltinmodule.c checks that the current sys.stdin filno matches the C stdin 
fileno. When they are different, it falls back to the default input 
implementation.

https://github.com/python/cpython/blob/1e7b858575d0ad782939f86aae4a2fa1c29e9f14/Python/bltinmodule.c#L2097

I noticed that PyFile_AsFile no longer exists. Would calling `fdopen` be 
acceptable?

--
nosy: +pierre.labatut
type:  -> behavior
versions: +Python 3.10, Python 3.11, 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



[issue37903] IDLE Shell sidebar.

2021-05-01 Thread Guido van Rossum

Guido van Rossum  added the comment:

Also, presumably most users don’t right click and look for options. They
just drag a selection and hit ^C (or cmd-C).--
--Guido (mobile)

--

___
Python tracker 

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



[issue43815] documentation for types.new_class() mention misleading default for exec_body

2021-05-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, shreyneil!

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



[issue43815] documentation for types.new_class() mention misleading default for exec_body

2021-05-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24481
pull_request: https://github.com/python/cpython/pull/25788

___
Python tracker 

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



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24480
pull_request: https://github.com/python/cpython/pull/25791

___
Python tracker 

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



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

2021-05-01 Thread Gregory P. Smith


New submission from Gregory P. Smith :

When the C implementation of functools.lru_cache was added in bpo/issue14373, 
it appears to have omitted setting `.__defaults__` on its wrapped function.


```
Python 3.10.0a7+ (heads/master-dirty:823fbf4e0e, May  1 2021, 11:10:30) [Clang 
12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> def func(b=5): pass
... 
>>> @functools.lru_cache
... def cached_func(b=5): pass
... 
>>> func.__defaults__
(5,)
>>> cached_func.__defaults__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'functools._lru_cache_wrapper' object has no attribute 
'__defaults__'
```

functools.update_wrapper() does set __defaults__ so this appears to just be an 
oversight in Modules/_functoolsmodule.c.

--
components: Library (Lib)
keywords: 3.5regression
messages: 392623
nosy: gregory.p.smith, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: functools.lru_cache omits __defaults__ attribute from wrapped function
type: behavior
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2021-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> See https://meta.discourse.org/t/what-is-a-wiki-post/30801

Gotcha, will try to do that as soon as possible

--

___
Python tracker 

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



[issue43957] [Enum] update __contains__ to return True for valid values

2021-05-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9a42d5069a4c2a531076abfb198d2be26b57216c by Pablo Galindo in 
branch 'master':
bpo-43957: Add a missins space to the new format enum warning (#25770)
https://github.com/python/cpython/commit/9a42d5069a4c2a531076abfb198d2be26b57216c


--

___
Python tracker 

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



[issue43998] Increase security of TLS settings in 3.10

2021-05-01 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24479
pull_request: https://github.com/python/cpython/pull/25790

___
Python tracker 

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



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

2021-05-01 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Yeah, the Quoter class seems a little odd...

Past notes of some the caching performance around the character quoting for 
quote() can be found in https://bugs.python.org/issue1285086 circa 2005-2010.

--
nosy:  -rhettinger

___
Python tracker 

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



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

2021-05-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

While you're cleaning up the module, take a look at the Quoter class.  It 
overrides __init__ and __missing__, so Quoter is not using any of the 
defaultdict features at all.  I'm thinking it could just inherit from dict.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34027] python 3.7 openpty/forkpty build failure using nix package manager macOS environment

2021-05-01 Thread Luke Granger-Brown


Luke Granger-Brown  added the comment:

Still seems to be a problem with everything up to Py3.11.

--
nosy: +lukegb
versions: +Python 3.10, Python 3.11, 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



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks Roberto! I leave the review to Ethan.

--

___
Python tracker 

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



[issue43998] Increase security of TLS settings in 3.10

2021-05-01 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



[issue43998] Increase security of TLS settings in 3.10

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset e983252b516edb15d4338b0a47631b59ef1e2536 by Christian Heimes in 
branch 'master':
bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)
https://github.com/python/cpython/commit/e983252b516edb15d4338b0a47631b59ef1e2536


--

___
Python tracker 

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



[issue43815] documentation for types.new_class() mention misleading default for exec_body

2021-05-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +24478
pull_request: https://github.com/python/cpython/pull/25789

___
Python tracker 

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



[issue37903] IDLE Shell sidebar.

2021-05-01 Thread Tal Einat


Tal Einat  added the comment:

The "copy only code" feature has been removed for now.  It can't currently be 
properly implemented, due to code input not being marked different than user 
input in between REPL commands, e.g. in response to an input() call.

With that, the PR is currently free of known bugs. I'd be very grateful to 
anyone who would try it out and give some feedback!

--

___
Python tracker 

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



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

2021-05-01 Thread Gregory P. Smith


New submission from Gregory P. Smith :

`urllib.parse` has custom caching code for both `urlsplit()` and `quote()`.  
From 1996.

https://github.com/python/cpython/commit/3fd32ecd9232fcb041b9f1f7a19a1e7e65cf11a0
https://github.com/python/cpython/commit/74495409861b357d9925937d6576229c74e2550d

with a truthful comment added by Nick in 2010 that we should just use 
functools.lru_cache.

https://github.com/python/cpython/commit/9fc443cf590c76d4b979c46dc954d3956cee0319#diff-b3712475a413ec972134c0260c8f1eb1deefb66184f740ef00c37b4487ef873e

time to clean up this cruft and do that.

I'm waiting for after the 3.10 cut and a still in progress urllib.parse 
security fix to land before rebasing my soon to be attached PR to avoid code 
conflicts.

--
assignee: gregory.p.smith
components: Library (Lib)
messages: 392614
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: Use functools.lru_cache in urllib.parse instead of 1996 custom caching
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



[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Cyril Jouve


Cyril Jouve  added the comment:

sure, I'll raise the issue with poetry then.

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



[issue43994] change representation of match as / capture as `Name(..., ctx=Store())`

2021-05-01 Thread Guido van Rossum

Guido van Rossum  added the comment:

Honestly if someone manages to get a PR in I won’t be a spoilsport. So make
me +0.--
--Guido (mobile)

--

___
Python tracker 

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



[issue43999] Cannot pickle frozen dataclasses with slots

2021-05-01 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-01 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I think there's still a flaw in the fixes implemented in 3.10 and 3.9 so far.  
We're closer, but probably not quite good enough yet.

why?  We aren't stripping the newlines+tab early enough.

I think we need to do the stripping *right after* the _coerce_args(url, ...) 
call at the start of the function.

Otherwise we
  (1) are storing url variants with the bad characters in _parse_cache [a mere 
slowdown in the worst case as it'd just overflow the cache sooner]
  (2) are splitting the scheme off the URL prior to stripping.  in 3.9+ there 
is a check for valid scheme characters, which will defer to the default scheme 
when found.  The WHATWG basic url parsing has these characters stripped before 
any parts are split off though, so 'ht\rtps' - for example - would wind up as 
'https' rather than our behavior so far of deferring to the default scheme.

I noticed this when reviewing the pending 3.8 PR as it made it more obvious due 
to the structure of the code and would've allowed characters through into query 
and fragment in some cases.  
https://github.com/python/cpython/pull/25726#pullrequestreview-649803605

--

___
Python tracker 

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



[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 Senthil Kumaran


Senthil Kumaran  added the comment:

Hi Stephen,

Could you give a brief demo of using curl to see the problematic behavior.

I have testing with a version python and saw that without content length, the 
curl was behaving properly.

```
$mkdir foo
$#add index.html to directory foo
$python -m http.server foo
$ curl -I -L http://0.0.0.0:8082/foo
HTTP/1.0 301 Moved Permanently
Server: SimpleHTTP/0.6 Python/3.6.13+
Date: Sat, 01 May 2021 17:16:14 GMT
Location: /foo/

HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.6.13+
Date: Sat, 01 May 2021 17:16:14 GMT
Content-type: text/html
Content-Length: 171
Last-Modified: Sat, 01 May 2021 14:34:48 GMT
```

And 

```
curl --version
curl 7.65.3
```

--

___
Python tracker 

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



[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +lukasz.langa, ned.deily, pablogsal

___
Python tracker 

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



[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

PEP 440 applies to Python packages, not to CPython itself. The "+" convention 
has been used in CPython for a long time, and changing it without a strong 
justification seems risky.

--
nosy: +Jelle Zijlstra -lukasz.langa, ned.deily, pablogsal

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-01 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

After the changes from bpo-42345, the Literal documentation claims that 
"Literal objects will now raise a TypeError exception during equality 
comparisons if one of their parameters are not immutable." But in fact it's 
*unhashable* types that raise an error; mutable but hashable types such as 
functions or custom objects work fine.

I'll submit a PR for this but may wait until GH-25787 is resolved.

--
assignee: Jelle Zijlstra
components: Documentation
messages: 392608
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: typing.Literal: args must be hashable, not immutable
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Ned Deily


Change by Ned Deily :


--
nosy: +lukasz.langa, ned.deily, pablogsal

___
Python tracker 

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



[issue44000] Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

2021-05-01 Thread Cyril Jouve


New submission from Cyril Jouve :

It was changed from 3.10.0a7 to 3.10.0a7+ in 
https://github.com/python/cpython/commit/04eecf7fac8bb8d7a19d14cf2009088046956ab5

According to 
https://www.python.org/dev/peps/pep-0440/#public-version-identifiers, it should 
be something like 3.10.0a7.post1

or with https://www.python.org/dev/peps/pep-0440/#local-version-identifiers, it 
should be something like 3.10.0a7+post

see also implementation in packaging: 
https://github.com/pypa/packaging/blob/main/packaging/version.py#L225

--
messages: 392607
nosy: Cyril Jouve
priority: normal
severity: normal
status: open
title: Current PY_VERSION 3.10.0a7+ does not conform to PEP 440

___
Python tracker 

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



[issue43999] Cannot pickle frozen dataclasses with slots

2021-05-01 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-01 Thread Anthony Sottile


Anthony Sottile  added the comment:

ah yeah that's the `asname` ast change -- if you use the unreleased main branch 
it has a fix for that

--

___
Python tracker 

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



[issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems

2021-05-01 Thread Ned Batchelder


Change by Ned Batchelder :


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

___
Python tracker 

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



[issue43993] Update bundled pip to 21.1.1

2021-05-01 Thread Stéphane Bidoul

Change by Stéphane Bidoul :


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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-01 Thread Ned Batchelder


Ned Batchelder  added the comment:

I'm trying to see if these changes affect coverage.py, but pytest 6.2.3 fails 
with:

=== CPython 3.10.0a7+ (rev 558df90109) with Python tracer 
(.tox/anypy/bin/python) ===
ImportError while loading conftest 
'/Users/nedbatchelder/coverage/trunk/tests/conftest.py'.
TypeError: required field "lineno" missing from alias


Is this something I am doing wrong?

--

___
Python tracker 

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



[issue43999] Cannot pickle frozen dataclasses with slots

2021-05-01 Thread Eric V. Smith


New submission from Eric V. Smith :

Originally reported in https://github.com/ericvsmith/dataclasses/issues/154

import pickle
from dataclasses import dataclass

@dataclass(frozen=True, slots=True)
class ExampleDataclass:
foo: str
bar: int



assert ExampleDataclass.__slots__ == ("foo", "bar")

assert pickle.loads(
pickle.dumps(ExampleDataclass("a", 1))
) == ExampleDataclass("a", 1)

  File "", line 4, in __setattr__
dataclasses.FrozenInstanceError: cannot assign to field 'foo'

I'll get a PR ready, likely based on ariebovenberg's solution in the above 
mentioned issue.

--
assignee: eric.smith
components: Library (Lib)
messages: 392603
nosy: eric.smith
priority: deferred blocker
severity: normal
status: open
title: Cannot pickle frozen dataclasses with slots
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



[issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems

2021-05-01 Thread Ned Batchelder


Ned Batchelder  added the comment:

I just spent an hour debugging this problem.  I don't understand the 
intricacies of how setup.py is looking for files, but more and more people will 
have Catalina and the issue this presents.

I can confirm that Andrew's suggestion works.  Can we get this applied to 3.10?

--
nosy: +nedbat

___
Python tracker 

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



[issue43993] Update bundled pip to 21.1.1

2021-05-01 Thread Paul Moore

Paul Moore  added the comment:


New changeset 6034c4aa58fe7257d39b53c77944393700c66396 by Stéphane Bidoul in 
branch '3.8':
[3.8] bpo-43993: Update vendored pip to 21.1.1 (GH-25761). (GH-25783)
https://github.com/python/cpython/commit/6034c4aa58fe7257d39b53c77944393700c66396


--

___
Python tracker 

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



[issue43993] Update bundled pip to 21.1.1

2021-05-01 Thread Paul Moore

Paul Moore  added the comment:


New changeset af1e06c62f3958082c4b409e771f291d12479b3d by Stéphane Bidoul in 
branch '3.9':
[3.9] bpo-43993: Update vendored pip to 21.1.1 (GH-25761). (GH-25782)
https://github.com/python/cpython/commit/af1e06c62f3958082c4b409e771f291d12479b3d


--

___
Python tracker 

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



[issue31356] Add context manager to temporarily disable GC

2021-05-01 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


--
nosy: +Yonatan Goldschmidt

___
Python tracker 

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



[issue36656] Add race-free os.link and os.symlink wrapper / helper

2021-05-01 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


--
nosy: +Yonatan Goldschmidt

___
Python tracker 

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



[issue43993] Update bundled pip to 21.1.1

2021-05-01 Thread Stéphane Bidoul

Change by Stéphane Bidoul :


--
pull_requests: +24474
pull_request: https://github.com/python/cpython/pull/25783

___
Python tracker 

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



[issue43993] Update bundled pip to 21.1.1

2021-05-01 Thread Stéphane Bidoul

Change by Stéphane Bidoul :


--
pull_requests: +24473
pull_request: https://github.com/python/cpython/pull/25782

___
Python tracker 

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



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread robertohueso


robertohueso  added the comment:

I opened PR 25769, I think it's the correct fix but I'm a new contributor, so 
not 100% sure.
Please, review when you have time :)

--

___
Python tracker 

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



[issue29657] os.symlink: FileExistsError shows wrong message

2021-05-01 Thread Yonatan Goldschmidt


Yonatan Goldschmidt  added the comment:

Just reached this issue independently (spent a few minutes debugging an error 
message like "FileExistsError: [Errno 17] File exists: 'a' -> 'b'", where 'a' 
didn't exist...)

I agree with Rich on this - for me, the source of confusion was that the way 
Python uses the arrow notation is just swapped from how ls(1) uses it.

Stage is "patch review" but I couldn't find any PR for it; if we're good with 
Larry's solution then I'm happy to post a PR implementing it.

--
nosy: +Yonatan Goldschmidt

___
Python tracker 

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



[issue43989] Enum deprecation breaks SSL tests

2021-05-01 Thread Christian Heimes


Christian Heimes  added the comment:

Ethan,

I have added a temporary workaround. Please revert 
f82fd77717b58c97a16c05e25c72388b35860459 when you fix the issue. Thanks!

--
priority: deferred blocker -> high

___
Python tracker 

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



  1   2   >