[issue45361] Provide a more convenient way to set an exception as "active", from Python code

2021-10-09 Thread Guido van Rossum


Guido van Rossum  added the comment:

In a brief off-line chat we concluded that the desired API would be closer to 
PyErr_Restore().

--

___
Python tracker 

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



[issue45421] Remove dead code from html.parser

2021-10-09 Thread Alberto Mardegan


New submission from Alberto Mardegan :

There appears to be some dead code in the html.parser module:

https://github.com/python/cpython/blob/main/Lib/html/parser.py#L331-L337

Support for parser errors (with line and offset information) was removed long 
ago, so this code is useless now. The updatepos() and getpos() methods should 
also be removed.

--
components: Library (Lib)
messages: 403571
nosy: mardy
priority: normal
severity: normal
status: open
title: Remove dead code from html.parser
type: enhancement

___
Python tracker 

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Here's a simplification of Marco's snippet to focus the discussion.

import asyncio

async def job():
# raise RuntimeError('error!')
await asyncio.sleep(5)

async def main():
task = asyncio.create_task(job())
await asyncio.sleep(1)
task.cancel('cancel job')
await task

if __name__=="__main__":
asyncio.run(main())


Running this pre-Python 3.9 gives something like this--

Traceback (most recent call last):
  File "test.py", line 15, in 
asyncio.run(main())
  File "/.../python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
  File "/.../python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
concurrent.futures._base.CancelledError


Running this with Python 3.9+ gives something like the following. The 
difference is that the traceback now starts at the sleep() call:

Traceback (most recent call last):
  File "/.../test.py", line 6, in job
await asyncio.sleep(5)
  File "/.../python3.9/asyncio/tasks.py", line 654, in sleep
return await future
asyncio.exceptions.CancelledError: cancel job

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../test.py", line 12, in main
await task
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../test.py", line 15, in 
asyncio.run(main())
  File "/.../python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
  File "/.../python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
asyncio.exceptions.CancelledError


Uncommenting the RuntimeError turns it into this--

Traceback (most recent call last):
  File "/.../test.py", line 15, in 
asyncio.run(main())
  File "/.../python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
  File "/.../python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
  File "/.../test.py", line 12, in main
await task
  File "/.../test.py", line 5, in job
raise RuntimeError('error!')
RuntimeError: error!


I agree it would be a lot nicer if the original CancelledError('cancel job') 
could bubble up just like the RuntimeError does, instead of creating a new 
CancelledError at each await and chaining it to the previous CancelledError. 
asyncio's creation of a new CancelledError at each stage predates the PR that 
added the chaining, so this could be viewed as an evolution of the change that 
added the chaining.

I haven't checked to be sure, but the difference in behavior between 
CancelledError and other exceptions might be explained by the following lines:
https://github.com/python/cpython/blob/3d1ca867ed0e3ae343166806f8ddd9739e568ab4/Lib/asyncio/tasks.py#L242-L250
You can see that for exceptions other than CancelledError, the exception is 
propagated by calling super().set_exception(exc), whereas with CancelledError, 
it is propagated by calling super().cancel() again.

Maybe this would even be an easy change to make. Instead of asyncio creating a 
new CancelledError and chaining it to the previous, asyncio can just raise the 
existing one. For the pure Python implementation at least, it may be as simple 
as making a change here, inside _make_cancelled_error():
https://github.com/python/cpython/blob/3d1ca867ed0e3ae343166806f8ddd9739e568ab4/Lib/asyncio/futures.py#L135-L142

--

___
Python tracker 

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



[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread Eryk Sun


Eryk Sun  added the comment:

> Is there any benefit of calling SetWaitableTimer() with an 
> absolute timeout

No, the due time of a timer object is stored in absolute interrupt time, not 
absolute system time. This has to be calculated either way, and it's actually 
more work for the kernel if an absolute system time is passed.

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-09 Thread debohman


Change by debohman :


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

___
Python tracker 

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



[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread Benjamin Szőke

Benjamin Szőke  added the comment:

Absolute timeout implementation via SetWaitableTimer() and 
GetSystemTimePreciseAsFileTime() is always better because it can reduce the 
"waste time" or "overhead time" what is always exist in any simple interval 
sleep implementation. Moreover, it is the only one which is eqvivalent with 
clock_nanosleep() implementation of Linux which is now the most state of the 
art implementation for precise sleeping.

So, my opinion is that absolute timeout implementation could be the most modern 
and sustainable for future python.

--

___
Python tracker 

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



[issue42174] shutil.get_terminal_size() returns 0 when run in a pty

2021-10-09 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

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



[issue45420] Python 3.10 final installation failure

2021-10-09 Thread wyz23x2


wyz23x2  added the comment:

Note: I'm trying to move the installation path from 
Local\Programs\Python\Python310 under user dir to C:\Program Files\Python310.

--
Added file: https://bugs.python.org/file50336/old_modify_log.log

___
Python tracker 

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



[issue45420] Python 3.10 final installation failure

2021-10-09 Thread wyz23x2


New submission from wyz23x2 :

Hi, I've downloaded Python 3.10 final (64-bit) from python.org on October 6. 
But when I run the installer with administrator permission, it says "No Python 
3.10 installation was detected". Error code: 0x80070643. The stranger thing is 
when I run "repair" from the 3.10rc2 installer, it's the same message & code; 
but, if "modify" is run, the window is "A newer version of Python 3.10 is 
already installed", error code same. Thanks for help.

--
components: Installation, Windows
files: new_install_log.log
messages: 403566
nosy: paul.moore, steve.dower, tim.golden, wyz23x2, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.10 final installation failure
type: crash
versions: Python 3.10
Added file: https://bugs.python.org/file50335/new_install_log.log

___
Python tracker 

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



[issue45419] DegenerateFiles.Path mismatch to Traversable interface

2021-10-09 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue45419] DegenerateFiles.Path mismatch to Traversable interface

2021-10-09 Thread Jason R. Coombs


New submission from Jason R. Coombs :

In [pytest-dev/pytest#9174](https://github.com/pytest-dev/pytest/issues/9174), 
it became clear that the DegenerateFiles object has a couple of interface 
mismatches to Traversable:

- name is a property
- open accepts a 'mode' and arbitrary args and kwargs.

Because DegenerateFiles is an intentionally broken handle (when a resource 
provider is unavailable), there's little harm in the interface being broken, 
and the interface is already gone in Python 3.11, so the urgency of fixing this 
is small.

--
messages: 403564
nosy: jaraco
priority: low
severity: normal
status: open
title: DegenerateFiles.Path mismatch to Traversable interface
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



[issue45384] Accept Final as indicating ClassVar for dataclass

2021-10-09 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

Yeah, I was just discussing this with someone in IRC, and I appreciate an 
example of it in the wild.

I agree there's some wiggle room with what "initialized in a class body" means 
when it comes to dataclasses.

I see several interpretations there, and I would strongly prefer feedback from 
typing folks, particularly since they would be responsible for implementing any 
Final default_factory exceptions.

On the implementation side this does complicate things a bit depending on 
specifics. Are Final default_factory fields real fields or pseudo-fields? (i.e. 
are they returned by dataclasses.fields()?) Depending on how this works 
dataclasses might need a bit more refactoring than I'd be the right person for, 
but I'm still willing to give it a shot.

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-09 Thread Ned Deily


Ned Deily  added the comment:

"A PR against configure.ac in main would be welcome, we can auto-backport to 
other active branches as necessary."

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-09 Thread debohman


debohman  added the comment:

Okay. Should the branch for the PR be off the main branch, or 3.10?

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-09 Thread Ned Deily


Ned Deily  added the comment:

> Do you plan to stick with $PLATFORM_TRIPLET = darwin, even on the arm 
> machines?

For now, yes. Apple long ago implemented the equivalent of multi-architecture 
support using "-arch" in the compiler driver and the Python build system 
(configure, Makefile, setup.py, distutils, et al) supports that for macOS 
without using PLATFORM_TRIPLET.

--

___
Python tracker 

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



[issue45384] Accept Final as indicating ClassVar for dataclass

2021-10-09 Thread Saaket Prakash


Saaket Prakash  added the comment:

Treating Final as ClassVar by default may be fine,
but it should not throw when using default_factory like ClassVar does.

There are valid uses of Final with instance variable when one would want the 
value to be unchanged after the `__init__` runs
but different instances can be initialized with different values that are 
generated by a default_factory.

A quick search on github for this pattern gives this
https://github.com/166MMX/hiro-python-library/blob/fb29e3247a8fe1b0f7dc4e68141cf7340a8dd0a5/src/arago/hiro/model/ws.py#L120
which will break if Final throws when using default_factory.

PEP 591 says:
Type checkers should infer a final attribute _that is initialized in a class 
body_ as being a class variable.
When using default_factory the attribute is not initialized inside the class 
body but when the instance is initialized.
So allowing instance level Final with default_factory will not be going against 
the PEP.

--
nosy: +saaketp

___
Python tracker 

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



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

2021-10-09 Thread neonene


neonene  added the comment:

PR28475 is not in the official source archive.
https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz

I'll check later whether official binary has the fix.

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-09 Thread debohman


debohman  added the comment:

I have version 2.71 of autoconf and the latest autoconf-archive installed on my 
machine.

--

___
Python tracker 

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



[issue45399] Remove hostflags from PySSLContext

2021-10-09 Thread ramikg


ramikg  added the comment:

@komugi The same code written independently by multiple people is probably the 
most effective and least cost-efficient form of code review.

@christian.heimes Of course, there is no hurry.

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2021-10-09 Thread debohman


debohman  added the comment:

Yes, I don't understand why the llvm / clang decided to implement this in 
version 13. In version 12, the switch caused an error to stderr, and nothing to 
stdout. GCC 11.1 generates a single \n to stdout.

Do you plan to stick with $PLATFORM_TRIPLET = darwin, even on the arm machines? 
Early on, I tried setting $PLATFORM_TRIPLET in the script to the actual value 
returned by the complier, and that blew up later during the actual build. That 
was when I decided to just fix the logic so that it continued to operate the 
same on all platforms, even darwin with --print-multiarch generating the 
triplet.

--

___
Python tracker 

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



[issue45384] Accept Final as indicating ClassVar for dataclass

2021-10-09 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

When I originally submitted the issue I hadn't finished going through all of 
the dataclasses code and it hadn't even occurred to me that it could be valid 
to use ClassVar with field(). I (wrongly) assumed this would always raise and 
that field() is only valid for things intended to be instance vars.

I do find this behavior a little surprising, but on reflection I don't think 
it's explicitly wrong as long we raise for default_factory like it currently 
does. I think it's then appropriate to just do the exact same behavior for 
Final as ClassVar.

I'm going to start working on a PR, thanks for your feedback.

--

___
Python tracker 

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



[issue45418] types.UnionType is not subscriptable

2021-10-09 Thread Joseph Perez


New submission from Joseph Perez :

`types.UnionType` is not subscriptable, and this is an issue when type 
manipulations are done.

A common maniputation I've to do is to substitute all the `TypeVar` of a 
potential generic type by their specialization in the given context.
For example, given a class:
```python
@dataclass
class Foo(Generic[T]):
bar: list[T]
baz: T | None
```
in the case of `Foo[int]`, I want to compute the effective type of the fields, 
which will be `list[int]` and `int | None`.
It could be done pretty easily by a recursive function:
```python
def substitute(tp, type_vars: dict):
origin, args = get_origin(tp), get_args(tp)
if isinstance(tp, TypeVar):
return type_vars.get(tp, tp)
elif origin is Annotated:
return Annotated[(substitute(args[0], type_vars), *args[1:])]
else:
return origin[tuple(substitute(arg) for arg in args)]  # this line 
fails for types.UnionType
```

And this is not the only manipulation I've to do on generic types. In fact, all 
my library (apischema) is broken in Python 3.10 because of `types.UnionType`.
I've to substitute `types.UnionType` by `typing.Union` everywhere to make 
things work; `types.UnionType` is just not usable for dynamic manipulations.

I've read PEP 604 and it doesn't mention if `types.UnionType` should be 
subscriptable or not. Is there a reason for not making it subscriptable?

--
messages: 403554
nosy: joperez
priority: normal
severity: normal
status: open
title: types.UnionType is not subscriptable
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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage: commit review -> resolved

___
Python tracker 

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



[issue45384] Accept Final as indicating ClassVar for dataclass

2021-10-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

I was waiting for someone smarter than me to chime in on one of the discussions.

I wouldn't worry about whether it's a bug or feature, at this point. Assuming 
buy-in from type checkers, I'd probably call it a bug, but I can be reasoned 
with.

One thing I don't understand is what you mean by:

"""
There is at least one edge case that would need to be handled where someone 
might want to explicitly mark a dataclass field Final, which could be allowed 
as a field:
a: Final[int] = dataclasses.field(init=False, default=10)
"""

I assume we'd want to treat it like a ClassVar, whatever that does. What's your 
thought? Are you saying ClassVar works incorrectly in this instance.

--

___
Python tracker 

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



[issue45384] Accept Final as indicating ClassVar for dataclass

2021-10-09 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

Hi Eric,

I've been shopping this idea around on the mailing list and haven't received 
any objections. Do you have any concerns? Can we handle Final with the same 
checks as ClassVar?

Regarding potentially merging a change, I'm not sure where this falls between a 
bug fix and a feature. On one hand the PEP 591 instruction to typecheckers on 
how to treat Final is relatively absolute and the dataclasses behavior could be 
considered a buggy interaction with it. On the other hand this is sorta a new 
behavior. Do you have any opinions? Should I not worry about it when working on 
patch and let core devs figure out if it would need backported?

I've read through the dataclasses code and I think I can implement this myself 
and submit a PR, but I may need a bit of a heavy handed code review since I've 
only recently started getting serious with Python.

Thanks for your time and work on dataclassess.

--

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread miss-islington


miss-islington  added the comment:


New changeset 459a4db5eae1f5ef063b34c61cc099820aa9ed0a by Miss Islington (bot) 
in branch '3.10':
bpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)
https://github.com/python/cpython/commit/459a4db5eae1f5ef063b34c61cc099820aa9ed0a


--

___
Python tracker 

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



[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread Eryk Sun


Eryk Sun  added the comment:

> In Python 3.11, time.sleep() is now always implemented with a 
> waitable timer. 

A regular waitable timer in Windows becomes signaled with the same resolution 
as Sleep(). It's based on the current interrupt timer period, which can be 
lowered to 1 ms via timeBeginPeriod(). Compared to Sleep() it's more flexible 
in terms of periodic waits, WaitForMultipleObjects(), or 
MsgWaitForMultipleObjects() -- not that time.sleep() needs this flexibility.

That said, using a waitable timer leaves the door open for improvement in 
future versions of Python. In particular, it's possible to get higher 
resolution in newer versions of Windows 10 and Windows 11 with 
CreateWaitableTimerExW() and the undocumented flag 
CREATE_WAITABLE_TIMER_HIGH_RESOLUTION (2).

--
nosy: +eryksun

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

While arguably unnecessary as it is documented as a dictionary and this is a 
normal Python dict behavior, it is a global dict and it can be modified at 
times that are unintuitive to users of all experience levels.  A note in the 
documentation makes sense.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue44904] Classmethod properties are erroneously "called" in multiple modules

2021-10-09 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +tim.peters
title: Erroneous behaviour for abstract class properties -> Classmethod 
properties are erroneously "called" in multiple modules

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 3d1ca867ed0e3ae343166806f8ddd9739e568ab4 by Gregory P. Smith in 
branch 'main':
bpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)
https://github.com/python/cpython/commit/3d1ca867ed0e3ae343166806f8ddd9739e568ab4


--

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +27155
pull_request: https://github.com/python/cpython/pull/28843

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +27154
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/28842

___
Python tracker 

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



[issue42034] Unchecked return in Objects/typeobject.c and possible uninitialized variables in cls and new_mro

2021-10-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is no bug in this code. The list "temp" contains only 2- and 3-tuples. 
PyArg_UnpackTuple() never fails.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45103] IDLE: make configdialog font page survive font failures

2021-10-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Bizarre.  The SO OP just reported that deleting FiraCode fixed *his* 3.10 
problem.  There must be some unobvious difference in systems.

--

___
Python tracker 

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



[issue44904] Erroneous behaviour for abstract class properties

2021-10-09 Thread Alex Waygood


Change by Alex Waygood :


--
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44904] Erroneous behaviour for abstract class properties

2021-10-09 Thread Alex Waygood


Change by Alex Waygood :


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

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In #13487, Gregory fixed the problem by using .copy().  That seems to have 
worked for 1 1/2 years.  You still have not reported an actual bug in the 
current CPython stdlib.

Perhaps we should mention in 
https://docs.python.org/3/library/sys.html#sys.modules that sys.modules can be 
unexpectedly changed during iteration by lazy imports or other threads, so that 
a copy might be needed.

Gregory, what do you think?

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



[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread STINNER Victor


STINNER Victor  added the comment:

> it is time to use nicely GetSystemTimePreciseAsFileTime() in time.time()

See bpo-19007 for that.

> it is time to (...) time.sleep() as absolute sleeping because it is available 
> since Windows 8.

In Python 3.11, time.sleep() is now always implemented with a waitable timer. I 
chose to use a relative timeout since it's simpler to implement. Is there any 
benefit of calling SetWaitableTimer() with an absolute timeout, compared to 
calling it with a relative timeout?

--

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 543acbce5a1e23633379a853f38dc55b12f6d931 by Pablo Galindo Salgado 
in branch 'main':
bpo-45256: Small cleanups for the code that inlines Python-to-Python calls in 
ceval.c (GH-28836)
https://github.com/python/cpython/commit/543acbce5a1e23633379a853f38dc55b12f6d931


--

___
Python tracker 

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



[issue29410] Moving to SipHash-1-3

2021-10-09 Thread Christian Heimes


Christian Heimes  added the comment:

> But do they use them as dict keys? AFAIK strings aren't hashed until hash() 
> is called on them.

That's correct. The hash of str and bytes is calculated on demand and then 
cached.

Frozensets also cache their hash values while tuples don't have a cache. We ran 
experiments with hash caching in tuples many years ago. It turned out that the 
increased size had an overall negative effect on performance. This may have 
changed with modern hardware with more RAM and much larger CPU caches, though.

--

___
Python tracker 

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



[issue27580] CSV Null Byte Error

2021-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue27580] CSV Null Byte Error

2021-10-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b454e8e4df73bc73bc1a6f597431f171bfae8abd by Serhiy Storchaka in 
branch 'main':
bpo-27580: Add support of null characters in the csv module. (GH-28808)
https://github.com/python/cpython/commit/b454e8e4df73bc73bc1a6f597431f171bfae8abd


--

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset e4fcb6fd3dcc4db23867c2fbd538189b8f221225 by Dong-hee Na in branch 
'3.9':
[3.9] bpo-20028: Keep original exception when PyUnicode_GetLength return -1 
(GH-28832) (GH-28835)
https://github.com/python/cpython/commit/e4fcb6fd3dcc4db23867c2fbd538189b8f221225


--

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset c80f0b7aa1d90332d0069d3e85ee112d0c9da7f0 by Dong-hee Na in branch 
'3.10':
[3.10] bpo-20028: Keep original exception when PyUnicode_GetLength return -1 
(GH-28832) (GH-28834)
https://github.com/python/cpython/commit/c80f0b7aa1d90332d0069d3e85ee112d0c9da7f0


--

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-09 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +27152
pull_request: https://github.com/python/cpython/pull/28836

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-09 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b4903afd4debbbd71dc49a2c8fefa74a3b6c6832 by Pablo Galindo Salgado 
in branch 'main':
bpo-45256: Remove the usage of the C stack in Python to Python calls (GH-28488)
https://github.com/python/cpython/commit/b4903afd4debbbd71dc49a2c8fefa74a3b6c6832


--

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +27151
pull_request: https://github.com/python/cpython/pull/28835

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +27150
pull_request: https://github.com/python/cpython/pull/28834

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread miss-islington


miss-islington  added the comment:


New changeset 8772935765e7a4f04f7f561e37d0c0aee71d8030 by Miss Islington (bot) 
in branch '3.10':
bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)
https://github.com/python/cpython/commit/8772935765e7a4f04f7f561e37d0c0aee71d8030


--

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +27149
pull_request: https://github.com/python/cpython/pull/28833

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread miss-islington


miss-islington  added the comment:


New changeset 6f3bc5eee6729197747d324c167da12902fb7c27 by Miss Islington (bot) 
in branch '3.9':
bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)
https://github.com/python/cpython/commit/6f3bc5eee6729197747d324c167da12902fb7c27


--

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset ec04db74e24a5f5da441bcabbe259157b4938b9b by Dong-hee Na in branch 
'main':
bpo-20028: Keep original exception when PyUnicode_GetLength return -1 (GH-28832)
https://github.com/python/cpython/commit/ec04db74e24a5f5da441bcabbe259157b4938b9b


--

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +27148
pull_request: https://github.com/python/cpython/pull/28832

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27147
pull_request: https://github.com/python/cpython/pull/28831

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue20028] csv: Confusing error message when giving invalid quotechar in initializing dialect

2021-10-09 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 34bbc87b2ddbaf245fbed6443c3e620f80c6a843 by Dong-hee Na in branch 
'main':
bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)
https://github.com/python/cpython/commit/34bbc87b2ddbaf245fbed6443c3e620f80c6a843


--

___
Python tracker 

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Marco Pagliaricci

Marco Pagliaricci  added the comment:

Chris,
ok, I have modified the snippet of code to better show what I mean.
Still here, the message of the CancelledError exception is lost, but if I
comment line 10, and uncomment line 11, so I throw a ValueError("TEST"),
that "TEST" string will be printed, so the message is not lost.
Again, I just find this behavior very counter-intuitive, and should be VERY
WELL documented in the docs.

Thanks,
M.

On Sat, Oct 9, 2021 at 3:06 PM Chris Jerdonek 
wrote:

>
> Chris Jerdonek  added the comment:
>
> I still don't see you calling asyncio.Task.exception() in your new
> attachment...
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file50334/task_bug.py

___
Python tracker 

___import asyncio


async def job():
print("job(): START...")
try:
await asyncio.sleep(5.0)
except asyncio.CancelledError as e:
print("job(): CANCELLED!", e)
raise asyncio.CancelledError("TEST")
#raise ValueError("TEST")
print("job(): DONE.")


async def cancel_task_after(task, time):
try:
await asyncio.sleep(time)
except asyncio.CancelledError:
print("cancel_task_after(): CANCELLED!")
except Exception as e:
print("cancel_task_after(): Exception!", e.__class__.__name__, 
e)
task.cancel("Hello!")


async def main():
task = asyncio.create_task(job())
# RUN/CANCEL task.
try:
await asyncio.gather(task, cancel_task_after(task, 1.0))
except asyncio.CancelledError as e:
try:
task_exc = task.exception()
except BaseException as be:
task_exc = be
print("In running task, we encountered a cancellation! 
Excpetion message is: ", e)
print("   ^ Task exc is:", task_exc.__class__.__name__, 
task_exc)
except Exception as e:
print("In running task, we got a generic Exception:", 
e.__class__.__name__, e)
# GET result.
try:
result = task.result()
except asyncio.CancelledError as e:
print("Task has been cancelled, exception message is: ", e)
except Exception as e:
try:
task_exc = task.exception()
except BaseException as be:
task_exc = be
print("Task raised generic exception", e.__class__.__name__, e)
print("  ^ Task exc is:", task_exc.__class__.__name__, task_exc)
else:
print("Task result is: ", result)


if __name__=="__main__":
asyncio.run(main())

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

I still don't see you calling asyncio.Task.exception() in your new attachment...

--

___
Python tracker 

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Marco Pagliaricci

Marco Pagliaricci  added the comment:

Chris,
I'm attaching to this e-mail the code I'm referring to.
As you can see, in line 10, I re-raise the asyncio.CancelledError exception
with a message "TEST".
That message is lost, due to the reasons we've talked about.

My point is that, if we substitute that line 10, with the commented line
11, and we comment the line 10, so we raise a ValueError("TEST") exception,
as you can see, the message "TEST" is NOT LOST.
I just find this counter-intuitive, and error-prone.

AT LEAST should be very well specified in the docs.

Regards,
M.

On Sat, Oct 9, 2021 at 2:51 PM Chris Jerdonek 
wrote:

>
> Chris Jerdonek  added the comment:
>
> > 2) Now: if I re-raise the asyncio.CancelledError as-is, I lose the
> message,
> if I call the `asyncio.Task.exception()` function.
>
> Re-raise asyncio.CancelledError where? (And what do you mean by
> "re-raise"?) Call asyncio.Task.exception() where? This isn't part of your
> example, so it's not clear what you mean exactly.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file50333/task_bug.py

___
Python tracker 

___import asyncio


async def job():
print("job(): START...")
try:
await asyncio.sleep(5.0)
except asyncio.CancelledError as e:
print("job(): CANCELLED!", e)
#raise asyncio.CancelledError("TEST")
raise ValueError("TEST")
print("job(): DONE.")


async def cancel_task_after(task, time):
try:
await asyncio.sleep(time)
except asyncio.CancelledError:
print("cancel_task_after(): CANCELLED!")
except Exception as e:
print("cancel_task_after(): Exception!", e.__class__.__name__, 
e)
task.cancel("Hello!")


async def main():
task = asyncio.create_task(job())
# RUN/CANCEL task.
try:
await asyncio.gather(task, cancel_task_after(task, 1.0))
except asyncio.CancelledError as e:
print("In running task, we encountered a cancellation! 
Excpetion message is: ", e)
except Exception as e:
print("In running task, we got a generic Exception:", 
e.__class__.__name__, e)
# GET result.
try:
result = task.result()
except asyncio.CancelledError as e:
print("Task has been cancelled, exception message is: ", e)
except Exception as e:
print("Task raised generic exception", e.__class__.__name__, e)
else:
print("Task result is: ", result)


if __name__=="__main__":
asyncio.run(main())

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

> 2) Now: if I re-raise the asyncio.CancelledError as-is, I lose the message,
if I call the `asyncio.Task.exception()` function.

Re-raise asyncio.CancelledError where? (And what do you mean by "re-raise"?) 
Call asyncio.Task.exception() where? This isn't part of your example, so it's 
not clear what you mean exactly.

--

___
Python tracker 

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



[issue45388] Use JUMP_FORWARD for all forward jumps.

2021-10-09 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +27145
pull_request: https://github.com/python/cpython/pull/28829

___
Python tracker 

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



[issue45353] sys.modules: dictionary changed size during iteration

2021-10-09 Thread Idan Cohen


Idan Cohen  added the comment:

An example can be found here: 
https://github.com/python/cpython/commit/7058d2d96c5ca4dfc6c754c5cd737c6eb2a8fd67
https://bugs.python.org/issue13487

Those links are about an issue that was until March 2020 with how sys.modules 
is iterated. It is not safe to iterate over since it can get updated during the 
iteration because of lazy importing for example.

If you look in older reports you can find that there us an issue with iterating 
over it and it was not addressed yet at all.

--

___
Python tracker 

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



[issue45351] asyncio doc: List all sockets in TCP echo server using streams

2021-10-09 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +27144
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28828

___
Python tracker 

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



[issue45416] "loop argument must agree with lock" instantiating asyncio.Condition

2021-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

2021-10-09 Thread Benjamin Szőke

Benjamin Szőke  added the comment:

https://www.python.org/downloads/windows/
"Note that Python 3.10.0 cannot be used on Windows 7 or earlier."

vstinner: Is it true that Windows 7 is not supported OS anymore? In this case 
we do not need to care about Windows 7 and earlier Windows OS compatibility and 
it is time to use nicely GetSystemTimePreciseAsFileTime() in time.time() and 
time.sleep() as absolute sleeping because it is available since Windows 8.

--

___
Python tracker 

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



[issue45399] Remove hostflags from PySSLContext

2021-10-09 Thread Christian Heimes


Christian Heimes  added the comment:

I have limited time to review code at the moment. It might take a while until I 
can get back to you.

--
stage:  -> patch review

___
Python tracker 

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



[issue20803] doc: clarify that struct.pack_into writes 0x00 for pad bytes

2021-10-09 Thread komugi


komugi  added the comment:

The PR is stale. Can I work on it ?

--
nosy: +komugi

___
Python tracker 

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



[issue42914] pprint numbers with underscore

2021-10-09 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

Ok, I will not send a PR to change the current behavior until python4 (in case 
it exists one day).

--

___
Python tracker 

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



[issue45399] Remove hostflags from PySSLContext

2021-10-09 Thread komugi


komugi  added the comment:

You've already done it, my bad. It was a waste of time.

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-10-09 Thread Julien Palard


Julien Palard  added the comment:

New suspicious today:

[library/typing:1011] "`" found in "# Type of ``val`` is narrowed 
to ``list[str]``."

But it's only because the old one with List[str] instead of list[str] was in 
susp-ignored.csv, so I just fixed susp-ignored.csv in 
https://github.com/python/cpython/pull/28827.

--

___
Python tracker 

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



[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2021-10-09 Thread STINNER Victor


STINNER Victor  added the comment:

> And I have doubts about Py_ADJUST_ERANGE2(). I think that it is used 
> incorrectly. See issue44970.

The question here is if it should be exported in the C API. I propose to remove 
it.

Fixing it is a different issue: bpo-44970 :-)

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-10-09 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +27143
pull_request: https://github.com/python/cpython/pull/28827

___
Python tracker 

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



[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Marco Pagliaricci


Marco Pagliaricci  added the comment:

OK, I see your point.
But I still can't understand one thing and I think it's very confusing:

1) if you see my example, inside the job() coroutine, I get correctly
cancelled with an `asyncio.CancelledError` exception containing my message.
2) Now: if I re-raise the asyncio.CancelledError as-is, I lose the message,
if I call the `asyncio.Task.exception()` function.
3) If I raise a *new* asyncio.CancelledError with a new message, inside the
job() coroutine's `except asyncio.CancelledError:` block, I still lose the
message if I call `asyncio.Task.exception()`.
4) But if I raise another exception, say `raise ValueError("TEST")`, always
from the `except asyncio.CancelledError:` block of the job() coroutine, I
*get* the message!
I get `ValueError("TEST")` by calling `asyncio.Task.exception()`, while I
don't with the `asyncio.CancelledError()` one.

Is this really wanted? Sorry, but I still find this a lot confusing.
Shouldn't it be better to return from the `asyncio.Task.exception()` the
old one (containing the message) ?
Or, otherwise, create a new instance of the exception for *ALL* the
exception classes?

Thank you for your time,
My Best Regards,

M.

On Thu, Oct 7, 2021 at 10:25 AM Thomas Grainger 
wrote:

>
> Thomas Grainger  added the comment:
>
> afaik this is intentional https://bugs.python.org/issue31033
>
> --
> nosy: +graingert
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue10716] Modernize pydoc to use better HTML and separate CSS

2021-10-09 Thread Julien Palard


Julien Palard  added the comment:


New changeset c91b6f57f3f75b482e4a9d30ad2afe37892a8ceb by Julien Palard in 
branch 'main':
bpo-10716: Migrating pydoc to html5. (GH-28651)
https://github.com/python/cpython/commit/c91b6f57f3f75b482e4a9d30ad2afe37892a8ceb


--

___
Python tracker 

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



[issue45399] Remove hostflags from PySSLContext

2021-10-09 Thread ramikg


ramikg  added the comment:

In addition to https://github.com/python/cpython/pull/28602?
What would the PR include?

--

___
Python tracker 

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