[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Arie Bovenberg


Arie Bovenberg  added the comment:

@eric.smith awesome! 

What would you like to do about the __weakref__ slot?

1. take no action
2. create a separate ticket to discuss further
3. implement as done in attrs, now that we're changing __slots__ dataclass 
behavior anyway

I wouldn't recommend (1), because sooner or later this feature request will pop 
up. It seems reasonable to support it.

--

___
Python tracker 

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



[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2022-03-17 Thread Tim Mitchell


Change by Tim Mitchell :


Added file: https://bugs.python.org/file50689/test_sdm.py

___
Python tracker 

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



[issue36457] functools.singledispatchmethod interacts poorly with subclasses

2022-03-17 Thread Tim Mitchell


Tim Mitchell  added the comment:

I've come up with a version that does not require a base class.

Seems a bit hacky as the descriptor __get__ method now modifies the class to 
put the dispatch table in place the first time the method is accessed.

--
Added file: https://bugs.python.org/file50688/singledispatchmethod.py

___
Python tracker 

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



[issue47054] "SyntaxError: non-default argument follows default argument" should be "parameter"

2022-03-17 Thread Vedran Čačić

Vedran Čačić  added the comment:

The problem is more subtle. The thing is, "default parameter" doesn't make 
sense in this context. Yes, a and b are parameter, but a is not "default 
parameter" in any sensible way. It is _None_ which is the default argument for 
parameter a, while parameter b has no default argument. In other words, if the 
function weren't called with a first argument, the default argument would be 
used.

So, the fix should be a bit more complicated. Maybe, "a parameter without a 
default follows a parameter with a default"?

--
nosy: +veky

___
Python tracker 

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



[issue46421] unittest ValueError when invoking as module

2022-03-17 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue46421] unittest ValueError when invoking as module

2022-03-17 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 1cab44d8650ae3eece90b04fca373908205e7ee0 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-46421: Fix unittest filename evaluation when called as a module 
(GH-30654) (GH-31970)
https://github.com/python/cpython/commit/1cab44d8650ae3eece90b04fca373908205e7ee0


--

___
Python tracker 

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



[issue47055] `issubclass` on two different subclasses of abstract base class like `os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8

2022-03-17 Thread mobiusklein


New submission from mobiusklein :

The following code looks correct:

```python
import os

class A(os.PathLike):
pass

class B(os.PathLike):
pass

assert issubclass(A, os.PathLike) # direct inheritance relationship
assert issubclass(B, os.PathLike) # direct inheritance relationship
assert not issubclass(A, B) # A is not derived from B or vice-versa
```

On Python 3.7.0-3.7.6 and 3.8.0-3.8.1 the third assertion fails. The expected 
behavior was restored in 3.7.7 and 3.8.2. This seems to be around when the 
internals of `abc` were translated to C.

Given that the behavior was fixed, but a bug fix matching this behavior wasn't 
listed in the changelog, the only resolution is to document that this behavior 
may be extant in older but still supported minor versions of Python. Where 
should that text be placed?

--
components: Library (Lib)
messages: 415467
nosy: mobiusklein
priority: normal
severity: normal
status: open
title: `issubclass` on two different subclasses of abstract base class like 
`os.PathLike` returns unexpected value on early versions of Py3.7 and Py3.8
type: behavior
versions: 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



[issue42782] shutil.move creates a new directory even on failure

2022-03-17 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset e808c9d5c78e5a7a9d804eced013a02c0c7df1a5 by Jelle Zijlstra in 
branch '3.9':
[3.9] bpo-42782: fix broken shutil test (GH-31971)
https://github.com/python/cpython/commit/e808c9d5c78e5a7a9d804eced013a02c0c7df1a5


--

___
Python tracker 

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



[issue9736] doctest.DocTestSuite doesn't handle test globs correctly

2022-03-17 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Yes.

--
nosy: +JelleZijlstra
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> doctest.DocTestCase fails when run repeatedly

___
Python tracker 

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



[issue36744] functools.singledispatch: Shouldn't require a positional argument if there is only one keyword argument

2022-03-17 Thread Tim Mitchell


Tim Mitchell  added the comment:

I would really prefer the dispatch logic remains simple and fast, rather than 
handle single keyword arguments.

--
nosy: +Tim Mitchell2

___
Python tracker 

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



[issue42782] shutil.move creates a new directory even on failure

2022-03-17 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +JelleZijlstra
nosy_count: 3.0 -> 4.0
pull_requests: +30061
pull_request: https://github.com/python/cpython/pull/31971

___
Python tracker 

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



[issue47054] "SyntaxError: non-default argument follows default argument" should be "parameter"

2022-03-17 Thread Bluenix


New submission from Bluenix :

Running the code below will produce a SyntaxError with the message: 
"non-default argument follows default argument".

def test(a=None, b):
return b if a is None else a

The issue is that `a` and `b` aren't *arguments*, rather, they are 
*parameters*. The error message should be changed to: "non-default parameter 
follows default parameter".

This change appears simple enough and although it is not something I've found 
to be troublesome, it will help users to use correct keywords (arguments vs. 
parameters) when searching on the internet.

--
components: Interpreter Core
messages: 415463
nosy: Bluenix2
priority: normal
severity: normal
status: open
title: "SyntaxError: non-default argument follows default argument" should be 
"parameter"
versions: Python 3.10, 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



[issue40296] help(list[int]) fails

2022-03-17 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue46421] unittest ValueError when invoking as module

2022-03-17 Thread miss-islington


miss-islington  added the comment:


New changeset 0b5f99ad1af0892a2d6043abd8aeb10d685d3844 by Miss Islington (bot) 
in branch '3.10':
bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)
https://github.com/python/cpython/commit/0b5f99ad1af0892a2d6043abd8aeb10d685d3844


--

___
Python tracker 

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



[issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0)

2022-03-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
assignee:  -> asvetlov

___
Python tracker 

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



[issue46421] unittest ValueError when invoking as module

2022-03-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30060
pull_request: https://github.com/python/cpython/pull/31970

___
Python tracker 

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



[issue46421] unittest ValueError when invoking as module

2022-03-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +30059
pull_request: https://github.com/python/cpython/pull/31969

___
Python tracker 

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



[issue46421] unittest ValueError when invoking as module

2022-03-17 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb by Bader Zaidan in 
branch 'main':
bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)
https://github.com/python/cpython/commit/a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb


--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue46223] asyncio cause infinite loop during debug

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Fixed by #47039

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Normalize asyncio future and task repr()

___
Python tracker 

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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree the error message could be better. Also, "s.error('bad escape %s' % 
this, len(this))" should probably be "from None", since as @mrabarnett notes 
the KeyError is an implementation detail.

--

___
Python tracker 

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



[issue47005] Improve performance of bytes_repeat

2022-03-17 Thread Dennis Sweeney


Change by Dennis Sweeney :


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



[issue47005] Improve performance of bytes_repeat

2022-03-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Thanks for the contribution -- that's a really nice speedup.

--

___
Python tracker 

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



[issue47005] Improve performance of bytes_repeat

2022-03-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:


New changeset ac8308d3eaf2526318c1bbf13d4a214fd24605d2 by Pieter Eendebak in 
branch 'main':
bpo-47005: Improve performance of bytearray_repeat and bytearray_irepeat 
(GH-31856)
https://github.com/python/cpython/commit/ac8308d3eaf2526318c1bbf13d4a214fd24605d2


--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue47046] Add `f_state` attribute to FrameObjects.

2022-03-17 Thread Ned Batchelder


Ned Batchelder  added the comment:

These look great.  Currently, coverage.py only tries to distinguish between 
return/yield, which I guess will now be COMPLETED and SUSPENDED?

--

___
Python tracker 

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



[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-17 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
type: security -> performance

___
Python tracker 

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



[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-17 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-17 Thread Dennis Sweeney


New submission from Dennis Sweeney :

There was a discussion here: 
https://github.com/faster-cpython/ideas/discussions/269

Checking for whether the assignment target is the left-hand side, rather than 
just checking for the right refcount, is more stable and reduces the number of 
deoptimizations, and even increases performance on some benchmarks.

Note that `PyUnicode_Append` is already a somewhat expensive function that 
already checks for the right reference counts, so it's fine to let as much code 
as possible get there, even if it will take the slow path -- we mostly just 
want to reduce allocations and avoid the quadratic string concatenation 
otherwise.

--
components: Interpreter Core
messages: 415455
nosy: Dennis Sweeney, brandtbucher
priority: normal
severity: normal
status: open
title: Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE
type: security
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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Matthew Barnett


Matthew Barnett  added the comment:

I'd just like to point out that to a user it could _look_ like a bug, that an 
error occurred while reporting, because the traceback isn't giving a 'clean' 
report; the stuff about the KeyError is an internal detail.

--

___
Python tracker 

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



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't have a problem saying that for a class to be used as a base class for a 
dataclass, its __slots__ must not be an iterator that's been exhausted. That 
doesn't seem like a very onerous requirement.

I'm also not concerned about people using __slots__ to iterate over the fields, 
but I agree that a documentation note couldn't hurt.

@ariebovenberg: go ahead and submit your PR. Thanks!

--

___
Python tracker 

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



[issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() )

2022-03-17 Thread Dennis Sweeney

Dennis Sweeney  added the comment:

In particular, it's one ascii character:

>>> b'abracadabra'.hex('😋')
ValueError: sep must be ASCII.

I wouldn't be completely opposed to allowing longer strings, but since there 
are easy enough ways to do it already, put me at a -0. We can see if anyone 
else is in favor.

--
components: +Interpreter Core -IO
nosy: +gregory.p.smith
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



[issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() )

2022-03-17 Thread arne123


arne123  added the comment:

Well, I think there are many ways to solve this in python (e.g. I used 
iteration before, wasn't aware of the sep. at all), but when there is already a 
separator, why limiting it to one character?

--

___
Python tracker 

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



[issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() )

2022-03-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Would there be substantial benefit of a new feature over using the existing 
feature and then calling str.replace()?

>>> b = b'abracadabra'
>>> "0x" + b.hex(":").replace(":", ", 0x")
'0x61, 0x62, 0x72, 0x61, 0x63, 0x61, 0x64, 0x61, 0x62, 0x72, 0x61'

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-03-17 Thread Steve Dower


Steve Dower  added the comment:

Okay, that kind of makes sense.

If you try to uninstall 3.10.3 (either through Programs & Features, or through 
the installer), how far can you get? Hopefully far enough that one of the 
3.10.2 options will work, or possibly for a new 3.10.3 install to succeed.

Unfortunately, once an install gets corrupted like this, it gets real hard to 
clean things up. The next option is to find a tool that will remove MSI 
metadata from your system so you can just delete the installs that way, clean 
up the files manually, and start fresh. But there's no nice recovery here, I'm 
afraid.

--

___
Python tracker 

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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, I assume that's what the OP intended, but then stumbled across the error 
with '\s'.

In any event, I don't think there's a bug here so I'm going to close this. 
@siddheshsathe: if you disagree, please respond here.

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

___
Python tracker 

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



[issue47052] allow string as sep in _Py_strhex_impl ( bytearray.hex() )

2022-03-17 Thread arne123


New submission from arne123 :

I use Python to support some C development.
Often I need to convert bytearrays to C like convention:
0x12, 0x34

It would be very convenient for this use case if the separator could be a 
string (like ", 0x") instead of just a single character.

--
components: IO
messages: 415447
nosy: arne123
priority: normal
severity: normal
status: open
title: allow string as sep in _Py_strhex_impl ( bytearray.hex() )
type: enhancement

___
Python tracker 

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



[issue34790] Deprecate-remove passing coroutine objects to asyncio.wait()

2022-03-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue34790] Deprecate-remove passing coroutine objects to asyncio.wait()

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 903f0a02c16240dc769a08c30e8d072a4fb09154 by Andrew Svetlov in 
branch 'main':
bpo-34790: Remove passing coroutine objects to asyncio.wait() (GH-31964)
https://github.com/python/cpython/commit/903f0a02c16240dc769a08c30e8d072a4fb09154


--

___
Python tracker 

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



[issue46030] socket module add couple of FreeBSD constants

2022-03-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue46030] socket module add couple of FreeBSD constants

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 33698e8ff40fcc67df3d95658e87196f8021de6f by David CARLIER in 
branch 'main':
bpo-46030: socket module add couple of FreeBSD constants. (GH-30018)
https://github.com/python/cpython/commit/33698e8ff40fcc67df3d95658e87196f8021de6f


--
nosy: +asvetlov

___
Python tracker 

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



[issue47051] Windows v3.10.3 .chm file (in python310\doc) page headings are messed up and spread out over several lines. Also the font has changed from the former san serif font to a smaller and harde

2022-03-17 Thread Donald O'Donnell


Change by Donald O'Donnell :


--
assignee: docs@python
components: Documentation
nosy: DonnieODonnell, docs@python
priority: normal
severity: normal
status: open
title: Windows v3.10.3 .chm file (in python310\doc) page headings are messed up 
and spread out over several lines. Also the font has changed from the former 
san serif font to a smaller and harder to read serif font.
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

There seem to be a number of escaping problems in the OP's example.

Is this what was intended?

>>> re.sub(r"\{(\w+)\}", r"\1", "Hello! {user}")
'Hello! user'

--
nosy: +rhettinger
status: pending -> open

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-17 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +30057
pull_request: https://github.com/python/cpython/pull/31968

___
Python tracker 

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



[issue47046] Add `f_state` attribute to FrameObjects.

2022-03-17 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-17 Thread Brett Cannon


Brett Cannon  added the comment:

I think it depends on whether we want to say the standard/included/built-in 
import mechanisms don't support byte paths, or byte paths are entirely not 
supported even for 3rd-party code? I definitely think we should at least do the 
former, but I'm hesitant to close the door for those that need it by doing the 
latter.

--

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-17 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-03-17 Thread Alex Waygood


Alex Waygood  added the comment:

Hmm, well if I try running the 3.10.2 installer, it now presents me with an 
error message saying that "a newer version of Python 3.10 is already installed".

--

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-03-17 Thread Alex Waygood


Alex Waygood  added the comment:

> Looks like you may have "cleaned up" your package cache at some point, which 
> means you can't uninstall the old version anymore.

Not knowingly!

> Try getting the 3.10.2 installer and running it directly.

Thanks, I'll have a go.

--

___
Python tracker 

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



[issue47049] Incorrect shutil.copytree() behaviour with symlinks

2022-03-17 Thread Zoltan Vajda


Change by Zoltan Vajda :


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

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-03-17 Thread Alex Waygood


Alex Waygood  added the comment:

Attaching the log file from the installation.

--
Added file: https://bugs.python.org/file50687/installer_log_file.txt

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-03-17 Thread Steve Dower


Steve Dower  added the comment:

Looks like you may have "cleaned up" your package cache at some point, which 
means you can't uninstall the old version anymore.

Try getting the 3.10.2 installer and running it directly. If it's the right 
one, you'll get Modify/Repair/Uninstall options, and those should work. (At 
worst, "Repair" will work and then it should be uninstallable.)

--

___
Python tracker 

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



[issue47050] Cannot install Python 3.10.3 on Windows

2022-03-17 Thread Alex Waygood


New submission from Alex Waygood :

I have tried several times now to upgrade to Python 3.10.3 using the 64-bit 
installer for Windows at https://www.python.org/downloads/release/python-3103/. 
Each time, I encounter an error message stating that "The feature you are 
trying to use is on a network resource that is unavailable". Further error 
messages include statements that "The older version of Python 3.10.3 Test Suite 
(64-bit) cannot be removed", and finally, "0x80070643 - Fatal error during 
installation".

Screenshots of the full error messages are attached.

Hardware details:
- Microsoft Windows 10 Home, Version 10.0.19043 Build 19043
- A x64-based PC
- An HP Pavilion Notebook laptop
- Processor AMD A8-7410 APU

Does anybody have any idea what might be going wrong?

I initially tried installing Python 3.10.3 with 3.10.2 still installed, but 
have now uninstalled Python 3.10.2 from my machine. It has made no difference.

--
components: Windows
files: error_messages-compressed.pdf
messages: 415438
nosy: AlexWaygood, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cannot install Python 3.10.3 on Windows
versions: Python 3.10
Added file: https://bugs.python.org/file50686/error_messages-compressed.pdf

___
Python tracker 

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



[issue47049] Incorrect shutil.copytree() behaviour with symlinks

2022-03-17 Thread Zoltan Vajda

New submission from Zoltan Vajda :

shutil.copytree incorrectly does not copy symlink contents if called
with symlink=False and ignore_dangling_symlinks=True.

The wrong behaviour can be reproduced like this:

$ tree
.
└── a
├── a.txt
└── b
└── a.txt -> ../a.txt

$ python3 -c "import shutil;shutil.copytree('a/b', 'c', symlinks=False, 
ignore_dangling_symlinks=True)"

As a result directoy c will be created but it will remain empty.
Expected result is a file c/a.txt with the contents of a/b/a.txt.

--
components: Library (Lib)
messages: 415437
nosy: vajdaz
priority: normal
severity: normal
status: open
title: Incorrect shutil.copytree() behaviour with symlinks
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



[issue47047] smtplib: allow custom policy or use msg.policy in send_message

2022-03-17 Thread Mikael Koli


Mikael Koli  added the comment:

It seems the message's policy is actually used. However, the mangle_from_ is 
still always True as the policy is not passed in the initiation of the 
generator. It seems though that all the options I mentioned could still make 
the mangle_from_ to be changeable if one wishes so.

--

___
Python tracker 

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



[issue47037] Build problems on Windows

2022-03-17 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30054
pull_request: https://github.com/python/cpython/pull/31965

___
Python tracker 

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



[issue47037] Build problems on Windows

2022-03-17 Thread Steve Dower


Steve Dower  added the comment:

I think this is also a good enough reason to switch the GitHub CI back to a 
debug build, rather than release, so that assert failures are caught before 
they get merged. This is not the first time it's happened.

--

___
Python tracker 

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



[issue34790] Deprecate-remove passing coroutine objects to asyncio.wait()

2022-03-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +30053
pull_request: https://github.com/python/cpython/pull/31964

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Christian Heimes


Change by Christian Heimes :


--
nosy:  -christian.heimes

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

tk release availability is a bit confusing.
  https://wiki.tcl-lang.org/page/Changes+in+Tcl%2FTk+8%2E6
appears to lists things 'new' in 3.6.1, but that seems to mean new since 8.5.1, 
as it includes thing introduced in 8.5.n, where n > 1. For instance, ttk 
spinbox is listed in this doc, but was available in 8.5.9, so is in 8.5.12+ and 
can be used without an 8.6 requirement.

Similarly,
  https://www.tcl.tk/man/tcl8.5/TkCmd/ttk_treeview.html
the 8.5.19 doc for the widget, shows the 'new in 8.6' treeview tag commands.  I 
suspect that they were present in 8.5.13.  Is there a specific 8.5.12 doc 
available?  I searched and tried adding '.12' in the url above and both failed. 
 Buildbots without _tkinter don't help either.

--
status: open -> closed

___
Python tracker 

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



[issue46965] Enable informing callee it's awaited via vector call flag

2022-03-17 Thread Dino Viehland


Dino Viehland  added the comment:

Doh, sorry about that link, this one goes to a specific commit: 
https://github.com/facebookincubator/cinder/blob/6863212ada4b569c15cd95c4e7a838f254c8ccfb/Python/ceval.c#L6642

I do think a new opcode is a good way to go, and that could just be emitted by 
the compiler when it recognizes the pattern.  I think we mainly avoided that 
because we had some issues around performance testing when we updated the byte 
code version and the peek was negligible, but with improved call performance in 
3.11 that may not be the case anymore.

It's probably possible to keep most of gather in Python if necessary, there'd 
still need to be a C wrapper which could flow the wrapper in and the wait 
handle creation would need to be possible from Python (which slightly scares 
me).  There's probably also a perf win from the C implementation - I'll see if 
@v2m has any data on that.

--

___
Python tracker 

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



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

asyncio.run() present since Python 3.7
After the main coroutine finish, it cancels all background tasks and waits for 
their termination.

Background tasks can use old good `try/finally` for resources cleanup.
An additional API is not required IMHO.

--

___
Python tracker 

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



[issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more

2022-03-17 Thread Laurent Delphin


Laurent Delphin  added the comment:

But make OK with Gcc 4.9.4, built with the formentionned clang (Xcode) compiler.
So, Compiler sensitive... 
Thank you,

--

___
Python tracker 

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



[issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more

2022-03-17 Thread Laurent Delphin


Change by Laurent Delphin :


Added file: https://bugs.python.org/file50685/my-configure.log

___
Python tracker 

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



[issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more

2022-03-17 Thread Laurent Delphin


Change by Laurent Delphin :


Added file: https://bugs.python.org/file50684/config.log

___
Python tracker 

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



[issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more

2022-03-17 Thread Laurent Delphin


Change by Laurent Delphin :


Added file: https://bugs.python.org/file50683/make.log

___
Python tracker 

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



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-17 Thread xloem


xloem <0xl...@gmail.com> added the comment:

I'm sorry, is this closure an error? Could you explain more how to use 
asyncio.run() to clean up resources when an unhandled exception is thrown? Is 
this new with a recent python improvement?

--
status: closed -> open

___
Python tracker 

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



[issue47048] Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more

2022-03-17 Thread Laurent Delphin


New submission from Laurent Delphin :

Hello developers :

Hereafter somme comments about a fatal error when Running make. Enclosed log 
(txt) files if I succeed in uploading them. 
Python3 : 3.10.3.
Osx : Lion 10.7.5. 
Compiler family : clang (Xcode). 

Message :
return PyErr_SetFromErrno(PyExec_OSError) ;
fatal error : error in backend etc.

Kind regards,

--
messages: 415429
nosy: laurentang001
priority: normal
severity: normal
status: open
title: Python 3.10.3 + Osx Lion : fatal error (make) signalmodule or more
type: compile error

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
status: closed -> open

___
Python tracker 

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



[issue47047] smtplib: allow custom policy or use msg.policy in send_message

2022-03-17 Thread Mikael Koli


New submission from Mikael Koli :

The method smtplib.SMTP.send_message does not use the message's Policy if all 
of the from_addrs or to_addrs are not international. See: 
https://github.com/python/cpython/blob/v3.10.3/Lib/smtplib.py#L983 (unchanged 
in current main). The email.generator.BytesGenerator does not capture the 
email's policy as it was not passed to its init.

This has at least one notable setback: you cannot set the mangle_from to False 
meaning that the method will always turn "From ..." to ">From ..." in the plain 
text part (though often that is desirable). This is especially confusing as 
email library has the mangle_from as False by default for EmailMessages but 
smtplib.SMTP's send_message does not respect this by default.

The smtplib.SMTP.send_message has a mention about this in the docstring thus 
not entirely sure if intentional:

... Otherwise the generator is called without modifying the
policy.


If we changed this line: 
https://github.com/python/cpython/blob/v3.10.3/Lib/smtplib.py#L983

from this:
g = email.generator.BytesGenerator(bytesmsg)

to this:
g = email.generator.BytesGenerator(bytesmsg, policy=msg.policy.clone()

smptlib's tests are passed but I suspect it's not that simple. The docstring 
mention indicates this is at some level intentional and I think the mangle_from 
needs to remain True as otherwise, it may cause security problems in existing 
code. Another option perhaps could be that the policy could be passed with the 
send_message and that is used if not None or we could have argument 
"msg_policy=False" that if True, the message's policy is used.

One could also think that this could be overcome by subclassing the SMTP. 
However, the logic is such deep in that it is not convenient.

So in short, the options I thought of:
- Have an argument "policy" in send_message to force usage of your own policy 
(safe option)
- Have an argument "msg_policy" (name debatable) in send_message and if True, 
the message's policy is always used (safe option)
- Use the message's policy always (unsafe, possibly breaking and causing 
security issues in existing code)

--
components: Library (Lib), email
messages: 415428
nosy: Miksus, barry, r.david.murray
priority: normal
severity: normal
status: open
title: smtplib: allow custom policy or use msg.policy in send_message
versions: Python 3.10, Python 3.11, 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



[issue47037] Build problems on Windows

2022-03-17 Thread Eryk Sun


Change by Eryk Sun :


--
priority: normal -> critical

___
Python tracker 

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



[issue47045] Remove the RESUME instruction

2022-03-17 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue47046] Add `f_state` attribute to FrameObjects.

2022-03-17 Thread Mark Shannon


New submission from Mark Shannon :

When tracing, the event supplied is insufficient to determine what is actually 
happening.

E.g. A "call" event could be a call to a function or resuming a generator or 
coroutine.

Adding a state field to the FrameObject would allow these cases to be 
disambiguated without having to make dubious deductions from `f_lasti` or other 
frame attributes.

The proposed states would be:

FRAME_CREATED# Frame created, but not executed at all
FRAME_SUSPENDED  # Frame suspended after yield or yield from
FRAME_EXECUTING  # Frame is executed normally
FRAME_COMPLETED  # Frame has completed 
FRAME_CLEARED# Frame has been cleared


Ned, any other states that you might need to know about?

--
messages: 415427
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: Add `f_state` attribute to FrameObjects.

___
Python tracker 

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



[issue47042] Fix test_html_doc in test_pydoc

2022-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a5d246066b5352a7d72e70ec0acb643e7c0861fa by Serhiy Storchaka in 
branch 'main':
bpo-47042: Fix testing the HTML output in test_pydoc (GH-31959)
https://github.com/python/cpython/commit/a5d246066b5352a7d72e70ec0acb643e7c0861fa


--

___
Python tracker 

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



[issue24080] asyncio.Event.wait() Task was destroyed but it is pending

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Duplicate for #39622

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> KeyboardInterrupt is ignored when await asyncio.sleep(0)

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +30051
pull_request: https://github.com/python/cpython/pull/31962

___
Python tracker 

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



[issue34790] Deprecate-remove passing coroutine objects to asyncio.wait()

2022-03-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
title: Deprecate passing coroutine objects to asyncio.wait() -> 
Deprecate-remove passing coroutine objects to asyncio.wait()

___
Python tracker 

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



[issue47045] Remove the RESUME instruction

2022-03-17 Thread Mark Shannon


New submission from Mark Shannon :

The RESUME instruction was added to make resumption points explicit in the 
bytecode. This makes it easier to implement tracing, quickening, and interrupt 
checks as there is an explicit place to perform these checks.

Unfortunately, it also has considerable overhead. So we should remove it.
To do that, we need to:
1. Remove f_state from the InterpreterFrame so we don't need to update it.
2 .Quicken automatically in the adaptive instructions.
3. Check the evalbreaker when resuming a frame in the interpreter.
4. Add some metadata to the code object, so that we know when to fire "call" 
events when tracing.

--
assignee: Mark.Shannon
messages: 415424
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Remove the RESUME instruction
type: performance

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

After PR 31839 has been merged you cannot build the _tkinter module with Tcl/Tk 
older than 8.5.12. If you will still try to run IDLE on such incomplete build, 
an import error during importing tkinter will be translated to IDLE error:

$ ./python -m idlelib
** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **

IDLE might someday require 8.6 if it start using some 8.6 features 
non-optionally.

--

___
Python tracker 

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



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-03-17 Thread Mark Shannon


Change by Mark Shannon :


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



[issue47044] Python 2.7.18 + tck/tk 8.6.1 + Osx Lion : tkinter built failes

2022-03-17 Thread Christian Heimes


Christian Heimes  added the comment:

Python 2.7 is no longer supported by us and we no longer accept bug reports for 
it. Please update to a supported version.

--
nosy: +christian.heimes
resolution:  -> out of date
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



[issue47044] Python 2.7.18 + tck/tk 8.6.1 + Osx Lion : tkinter built failes

2022-03-17 Thread Laurent Delphin


New submission from Laurent Delphin :

Hello Python developers :

The module tkinter failed to be built for Python 2.7.18, although for Python 
3,it works with the following test : python -m tkinter. It doesn't with 
Python2. 
Configuration :
Mac osx Lion 10.7.5.
Python2 : 2.7.18
Compiler : clang (Xcode).
Tcl/Tk : 8.6.12.
If I succeed, log files will be enclosed hereby.
Thank you.

--
messages: 415421
nosy: laurentang001
priority: normal
severity: normal
status: open
title: Python 2.7.18 + tck/tk 8.6.1 + Osx Lion : tkinter built failes
type: compile error

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Ronald: According to a page (which I cannot find, E. Paine should know) Centos 
7 has the oldest tcl among current *nix distributions.  
https://centos.pkgs.org/7/centos-x86_64/tcl-8.5.13-8.el7.x86_64.rpm.html
says it is 8.5.13, which is what I remember from the comparison page.

Serhiy: IDLE has required TkVersion >= 8.5 for some years (currently top of 
pyshell.py).  Does the _tkinter.c line
  #error "Tk older than 8.5.12 not supported"
translate into an ImportError (which is already caught).  I never worried about 
someone trying to import 8.3 or before, but Apple's 8.5.9 is possible.

Is there any reason that IDLE might someday require 8.6 before tkinter does?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry, the previous message was written via a phone because of blackout, so the 
formatting is a tine bit messy.

__slotnames__ is set in copyreg._slotnames(). If you want to keep a list of all 
slots you should save it in __slotnames__, either using copyreg._slotnames() 
directly or by duplicating its code.

But as for the original issue, I do not think that the current behavior is 
incorrect. At least it is consistent with the behavior of regular classes.

--

___
Python tracker 

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



[issue40465] Deprecate the optional *random* argument to random.shuffle()

2022-03-17 Thread Hugo van Kemenade


Hugo van Kemenade  added the comment:

GH-31818 adds an entry to What's New in 3.11.

--
message_count: 5.0 -> 6.0
nosy: +hugovk
nosy_count: 3.0 -> 4.0
pull_requests: +30050
pull_request: https://github.com/python/cpython/pull/31818

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Implemented by #32591

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Deprecate sys.set_coroutine_wrapper and replace it with more 
focused API(s)

___
Python tracker 

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



[issue42683] asyncio should handle keyboard interrupt while the event loop is running

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Duplicate for #39622

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> KeyboardInterrupt is ignored when await asyncio.sleep(0)

___
Python tracker 

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



[issue43019] wait_for(to_thread)) does not work as expected. Extra documentation or fix needed.

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Threads are not interruptable in Python.
The same for concurrent.future executor.
asyncio and `wait_for` is not special.

I'm not sure should we document it and *if* yes -- where should we do it?

Adding a note to every function could be cumbersome.

--

___
Python tracker 

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



[issue47043] Argparse can't parse subparsers with parse_known_args

2022-03-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal

___
Python tracker 

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



[issue47043] Argparse can't parse subparsers with parse_known_args

2022-03-17 Thread rive_n


rive_n  added the comment:

Let's say we have default parser configuration:
https://docs.python.org/3/library/argparse.html#other-utilities

Like this one:

```python3
import argparse

parser = argparse.ArgumentParser(prog='PROG')
parser.add_argument('--foo', action='store_true', help='foo help')
subparsers = parser.add_subparsers(help='sub-command help')

# create the parser for the "a" command
parser_a = subparsers.add_parser('a', help='a help')
parser_a.add_argument('-a', help='bar help')

# create the parser for the "b" command
parser_b = subparsers.add_parser('b', help='b help')
parser_b.add_argument('-b', help='baz help')

```

So i want to parse all subparsers arguments. For this purpose i could use 
`parse_known_args` method. 

But for some reason there is no way to get all of current args specified via 
command prompt or via list:
`print(parser.parse_known_args(['a', '-a', '12', 'b', '-b', '32']))` - will not 
print 'a' and 'b' data. It will only contain first valid argument; 

This is pretty strange behavior. Why i can't just get all of actions 
(subparsers) ? 

--- 

I've found a solutions:
1. Easy way (and most stupid):

```python3
args, unk_args = (parser.parse_known_args(['a', '-a', '12', 'b', '-b', '32']))
args, unk_args = (parser.parse_known_args(unk_args))
```

Simple recursive calls on `unk_args`

2. Hard way -> sources fork (or just fix this, lul!)

`parse_know_args` -> 1799-1807 lines:

```python3
try:
namespace, args = self._parse_known_args(args, namespace)
if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):
args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
return namespace, args
except ArgumentError:
err = _sys.exc_info()[1]
self.error(str(err))
```

There is only 1 call to `self._parse_known_args` instead of amount of current 
subparsers.

--

___
Python tracker 

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



[issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError

2022-03-17 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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



[issue46553] typing: get_type_hints on stringified lone ClassVar raises TypeError

2022-03-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Is there any reason to keep this issue open? The PR was merged.

--

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +30049
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/31961

___
Python tracker 

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



[issue47043] Argparse can't parse subparsers with parse_known_args

2022-03-17 Thread rive_n


New submission from rive_n :

Let's say we have default parser configuration:
https://docs.python.org/3/library/argparse.html#other-utilities

Like this one:

```python3
import argparse

parser = argparse.ArgumentParser(prog='PROG')
parser.add_argument('--foo', action='store_true', help='foo help')
subparsers = parser.add_subparsers(help='sub-command help')

# create the parser for the "a" command
parser_a = subparsers.add_parser('a', help='a help')
parser_a.add_argument('-a', help='bar help')

# create the parser for the "b" command
parser_b = subparsers.add_parser('b', help='b help')
parser_b.add_argument('-b', help='baz help')

```

So i want to parse all subparsers arguments. For this purpose i could use 
`parse_known_args` method. 

But for some reason there is no way to get all of current args specified via 
command prompt or via list:
`print(parser.parse_known_args(['a', '-a', '12', 'b', '-b', '32']))` - will not 
print 'a' and 'b' data. It will only contain first valid argument; 

This is pretty strange behavior. Why i can't just get all of actions 
(subparsers) ?

--
components: Parser
messages: 415412
nosy: lys.nikolaou, pablogsal, rive-n
priority: normal
severity: normal
status: open
title: Argparse can't parse subparsers with parse_known_args
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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-17 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 

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



[issue42838] Wait for cleanup coroutines before event loop is closed.

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

asyncio.run() does the task

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



[issue40811] Allow to create new Event Loops on Threads

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I suggest closing.
The documentation explicitly describes how asyncio works with threads.

--
resolution:  -> wont fix
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



[issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

A duplicate of #47010

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Implement zero copy writes in SelectorSocketTransport in asyncio

___
Python tracker 

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



[issue42941] Infinite loop in asyncio sslproto

2022-03-17 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

sslproto was rewritten from scratch in Python 3.11

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



[issue47038] Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase

2022-03-17 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This may be quite bad, because this means that 3.10 and 3.9 doesn't build in 
CentOS 6, which is used for manylinux2010 wheels

--

___
Python tracker 

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



[issue46968] Insufficient sigaltstack size used by CPython prevents extensions from using new ISA

2022-03-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: normal -> release blocker

___
Python tracker 

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



  1   2   >