[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-10 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Other tests are also affected:
- `./python.exe -m test -m 
unittest.test.test_break.TestBreakDefaultIntHandler.testSecondInterrupt 
test_unittest -F`
- `./python.exe -m test -m 
unittest.test.test_break.TestBreakDefaultIntHandler.testTwoResults 
test_unittest -F`
- `./python.exe -m test -m 
unittest.test.test_break.TestBreakDefaultIntHandler.testHandlerReplacedButCalled
 test_unittest -F`
- etc

I think that we need a universal solution, I am going to write a helper method 
and add it to all tests there.

--

___
Python tracker 

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



[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Did you try to print a traceback of the exception?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-10 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I think this might be a side effect of 
https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers

> A Python signal handler does not get executed inside the low-level (C) signal 
> handler. Instead, the low-level signal handler sets a flag which tells the 
> virtual machine to execute the corresponding Python signal handler at a later 
> point(for example at the next bytecode instruction). This has consequences

--

___
Python tracker 

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



[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-10 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I am trying to debug this.

Several intersting notes:
1. `time.sleep()` does not help
2. It always fails on `8`th turn
3. Changing `self.assertTrue(result.shouldStop)` to

```
msg = f'{type(result)} {vars(result)}'
self.assertTrue(result.shouldStop, msg)
```

fixes the problem.

--
nosy: +sobolevn

___
Python tracker 

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



[issue45451] IDLE - modify text frame and widget borders

2022-02-10 Thread Ashlyn Woods


Ashlyn Woods  added the comment:

In addition, I would encourage that people in future try to get a bigger gauge 
of how many people actually want a feature like this, how many don't, and then 
make a decision about whether to put it in- considering that there have been a 
fair few cases where people have clearly reacted negatively to this, maybe you 
should have checked if people'd dislike it before rolling it out w/o any easy 
way of undoing it.

--

___
Python tracker 

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



[issue45451] IDLE - modify text frame and widget borders

2022-02-10 Thread Ashleigh Woods


Ashleigh Woods  added the comment:

At a minimum, I think that there should be a toggle for whether this should be 
present or not, without having to dig in and change the values in IDLE (with, 
I'd like to note, absolutely no clue where to do that!). This is particularly 
an issue for beginners.

It'd also be nice to control the color scheme/size etc, but I can understand if 
that's more complicated.

--
nosy: +pulsiedulsie

___
Python tracker 

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



[issue46705] Memory optimization for set.issubset

2022-02-10 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Would not testing len(self.difference(other)) == 0 
> be more efficient?

Yes, I think so.

--
Added file: https://bugs.python.org/file50620/instrument_issubset.py

___
Python tracker 

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



[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I reproduced as far back as Python 3.6 with this:

---
import gc

exc = Exception()
deltas = []

for i in range(2, 15):
ref1 = len(gc.get_objects())
for j in range(2**i):
try:
raise exc
except Exception:
pass
ref2 = len(gc.get_objects())
deltas.append(ref2 - ref1)

print(deltas)
# [4, 8, 16, 9, 64, 128, 256, 512, 1024, 2048, 4072, 8192, 16384]
---


Note that the memory does get freed up once the exception is deleted:

---
import gc

deltas = []

for i in range(2, 15):
ref1 = len(gc.get_objects())

exc = Exception()
for j in range(2**i):
try:
raise exc
except Exception:
pass
del exc  # <<<

ref2 = len(gc.get_objects())
deltas.append(ref2 - ref1)

print(deltas)
# [0, 0, 0, 0, 0, -14, 0, 0, 0, 0, -14, 0, 0]
---

--
nosy: +Dennis Sweeney, iritkatriel

___
Python tracker 

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



[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread George Gensure


New submission from George Gensure :

Instantiating an exception and raising it multiple times causes 1 frame and 2 
traceback objects to remain allocated for each raise. The attached example 
causes python to consume 8GB of ram after a few seconds of execution on 
Windows/Linux.

--
components: Interpreter Core
files: exc.py
messages: 413035
nosy: ggensure
priority: normal
severity: normal
status: open
title: Raising exception multiple times leaks memory
type: resource usage
versions: Python 3.11
Added file: https://bugs.python.org/file50619/exc.py

___
Python tracker 

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



[issue46400] Please update bundled libexpat to 2.4.4 with security fixes (CVE-2021-45960)

2022-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: Please update bundled libexpat to 2.4.4 with security fixes -> Please 
update bundled libexpat to 2.4.4 with security fixes (CVE-2021-45960)

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset 1124ab6d1d15dc5058e03b63fd1d95e6f1009cc3 by Miss Islington (bot) 
in branch '3.10':
bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)
https://github.com/python/cpython/commit/1124ab6d1d15dc5058e03b63fd1d95e6f1009cc3


--

___
Python tracker 

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



[issue46716] regrtest didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x

2022-02-10 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

The test only completed once I purposefully terminated the offending Python 
process.  The only identifying information I noticed was the command-line of 
`-c "while True: pass"`, indicating it was stuck in either
test_call_timeout() or test_timeout() in test_subprocess.py.

Something to note is that Windows does not, by default, have a concept of 
process trees whereas terminating a parent automatically kills the children.  
Eryk Sun may have additional ideas on how this desired behavior could be 
accomplished.

--
nosy: +eryksun, jkloth

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-02-10 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29433
pull_request: https://github.com/python/cpython/pull/31269

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d by Arie Bovenberg in 
branch 'main':
bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)
https://github.com/python/cpython/commit/dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d


--
nosy: +miss-islington

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-02-10 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I'm pretty sure both EntryPoints and DeprecatedList were introduced in Python 
3.10, so 3.9 and 3.8 aren't relevant.

--
versions:  -Python 3.8, Python 3.9

___
Python tracker 

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



[issue46705] Memory optimization for set.issubset

2022-02-10 Thread Jack Nguyen


Change by Jack Nguyen :


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

___
Python tracker 

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



[issue46705] Memory optimization for set.issubset

2022-02-10 Thread Jack Nguyen


Jack Nguyen  added the comment:

As you say, which implementation performs better likely depends on the nature 
of the sets. I would suspect that using set.difference won't be substantially 
faster than using set.intersection in the best case, but it would be much 
slower if len(self) is much larger than len(self.intersection(other)) e.g. 
set(range(1_000_000)).issubset(range(10)). Overall I think that using 
set.intersection will have more well-rounded performance.

--

___
Python tracker 

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



[issue36876] [subinterpreters] Global C variables are a problem

2022-02-10 Thread Eric Snow


Eric Snow  added the comment:


New changeset 80e4f262aa27a39abf3fadc19a6323fea4607a8f by Eric Snow in branch 
'main':
bpo-36876: Make sure the c-analyzer is checking all the source files.' 
(gh-31264)
https://github.com/python/cpython/commit/80e4f262aa27a39abf3fadc19a6323fea4607a8f


--

___
Python tracker 

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



[issue46716] regrtest didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x

2022-02-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: regrtest didn't respect the timeout on AMD64 Windows11 3.x -> regrtest 
didn't respect the timeout when running test_subprocess on AMD64 Windows11 3.x

___
Python tracker 

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



[issue46716] regrtest didn't respect the timeout on AMD64 Windows11 3.x

2022-02-10 Thread STINNER Victor

New submission from STINNER Victor :

regrtest was run with --timeout 900 on AMD64 Windows11 3.x: timeout confirmed 
by "(timeout: 15 min, worker timeout: 20 min)" log. But then test_subprocss was 
only stopped after "4 hour 55 min".

If the regrtest main process is able to display an update 2x per minutes (every 
30 sec), it should be able to stop the test worker process (test_subprocess) 
after 20 minutes. How is it possible that the process took so long?

There are multiple guards:

* (1) in the worker process: _runtest() calls 
faulthandler.dump_traceback_later(ns.timeout, exit=True)
* (2) libregrtest/runtest_mp.py: TestWorkerProcess._run_process() thread uses 
popen.communicate(timeout=self.timeout)
* (3) faulthandler.dump_traceback_later(MAIN_PROCESS_TIMEOUT, exit=True): kill 
the parent process if it is blocked for longer than 5 minutes

Guards (1) and (2) didn't work.

Maybe the parent process should implement a 4th guard using the 20 minute 
timeout: almost 5 hours is way longer than 20 minutes!


C:\buildbot\3.x.kloth-win11\build>"C:\buildbot\3.x.kloth-win11\build\PCbuild\amd64\python_d.exe"
  -u -Wd -E -bb -m test  -uall -rwW --slowest --timeout 1200 --fail-env-changed 
-j1 -j2 --junit-xml test-results.xml -j40 --timeout 900
== CPython 3.11.0a5+ (main, Feb 10 2022, 04:03:24) [MSC v.1930 64 bit (AMD64)]
== Windows-10-10.0.22000-SP0 little-endian
== cwd: C:\buildbot\3.x.kloth-win11\build\build\test_python_5732�
== CPU count: 32
== encodings: locale=cp1252, FS=utf-8
Using random seed 6320493
0:00:00 Run tests in parallel using 40 child processes (timeout: 15 min, worker 
timeout: 20 min)
(...)
0:03:13 load avg: 0.76 [431/432] test_multiprocessing_spawn passed (3 min 13 
sec) -- running: test_subprocess (3 min 11 sec)
0:03:43 load avg: 0.46 running: test_subprocess (3 min 41 sec)
(...)
4:53:17 load avg: 0.00 running: test_subprocess (4 hour 53 min)
4:53:47 load avg: 0.00 running: test_subprocess (4 hour 53 min)
4:54:17 load avg: 0.09 running: test_subprocess (4 hour 54 min)
4:54:47 load avg: 0.35 running: test_subprocess (4 hour 54 min)
4:55:17 load avg: 0.48 running: test_subprocess (4 hour 55 min)
4:55:46 load avg: 0.50 [432/432/1] test_subprocess timed out (4 hour 55 min) (4 
hour 55 min)

== Tests result: FAILURE ==

397 tests OK.

10 slowest tests:
- test_subprocess: 4 hour 55 min
- test_multiprocessing_spawn: 3 min 13 sec
- test_concurrent_futures: 2 min 46 sec
- test_peg_generator: 2 min 32 sec
- test_compileall: 1 min 34 sec
- test_unparse: 1 min 31 sec
- test_distutils: 1 min 23 sec
- test_asyncio: 1 min 22 sec
- test_tokenize: 1 min 8 sec
- test_io: 1 min 5 sec

1 test failed:
test_subprocess

--
components: Tests
messages: 413028
nosy: vstinner
priority: normal
severity: normal
status: open
title: regrtest didn't respect the timeout on AMD64 Windows11 3.x
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



[issue44953] Add vectorcall on operator.itemgetter and attrgetter objects

2022-02-10 Thread Dennis Sweeney


Dennis Sweeney  added the comment:


New changeset 035414a878a772d1d293cdecdc4470bcce5e5d7a by Dennis Sweeney in 
branch 'main':
bpo-44953: Add newline at end of NEWS entry (GH-31265)
https://github.com/python/cpython/commit/035414a878a772d1d293cdecdc4470bcce5e5d7a


--

___
Python tracker 

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



[issue44953] Add vectorcall on operator.itemgetter and attrgetter objects

2022-02-10 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
pull_requests: +29431
pull_request: https://github.com/python/cpython/pull/31265

___
Python tracker 

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



[issue46713] Provide a C implementation of collections.abc.KeysView and friends

2022-02-10 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +rhettinger
type:  -> performance
versions: +Python 3.11

___
Python tracker 

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



[issue36876] [subinterpreters] Global C variables are a problem

2022-02-10 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +29430
pull_request: https://github.com/python/cpython/pull/31264

___
Python tracker 

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



[issue44953] Add vectorcall on operator.itemgetter and attrgetter objects

2022-02-10 Thread Dennis Sweeney


Dennis Sweeney  added the comment:


New changeset 0a145069e807fdafd1fa0315b9bc22da363d2d39 by Dennis Sweeney in 
branch 'main':
bpo-44953: Add vectorcall for itemgetter and attrgetter instances (GH-27828)
https://github.com/python/cpython/commit/0a145069e807fdafd1fa0315b9bc22da363d2d39


--

___
Python tracker 

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



[issue46715] asyncio.create_unix_server has an off-by-one error concerning the backlog parameter

2022-02-10 Thread John Snow


New submission from John Snow :

Hi, asyncio.create_unix_server appears to treat the "backlog" parameter as 
where 0 means that *no connection will ever possibly be pending*, which (at the 
very least for UNIX sockets on my machine) is untrue.

Consider a (non-asyncio) server:

```python
import os, socket, sys, time

sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind('test.sock')

sock.listen(backlog=0)

while True:
print('.', end='', file=sys.stderr)
time.sleep(1)
```

This server never calls accept(), and uses a backlog of zero. However, a client 
can actually still successfully call connect against such a server:

```python
import os, socket, time

sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setblocking(False)

sock.connect('test.sock')
print("Connected!")
```

When run against the server example, the first invocation of this client will 
actually connect successfully (Surprising, but that's how the C syscalls work 
too, so... alright) but the second invocation of this client will raise 
BlockingIOError (EAGAIN).

Further, if we amend the first server example to actually call accept(), it 
will succeed when the first client connects -- demonstrating that the actual 
total queue length here was actually effectively 1, not 0.

(i.e. there's always room for at least one connection to be considered, and the 
backlog counts everybody else.)

However, in asyncio.BaseSelectorEventLoop._accept_connection(...), the code 
uses `for _ in range(backlog)` to determine the maximum number of accept calls 
to make. When backlog is set to zero, this means we will *never* call accept, 
even when there are pending connections.

Note that when backlog=1, this actually allows for *two* pending connections 
before clients are rejected, but this loop will only fire once. This behavior 
is surprising, because backlog==0 means we'll accept no clients, but backlog==1 
means we will allow for two to enqueue before accepting both. There is 
seemingly no way with asyncio to actually specify "Exactly one pending 
connection".

I think this loop should be amended to reflect the actual truth of the backlog 
parameter, and it should iterate over `backlog + 1`. This does necessitate a 
change to `Lib/test/test_asyncio/test_selector_events.py` which believes that 
backlog=100 means that accept() should be called 100 times (instead of 101.)

A (very) simple fix is attached here; if it seems sound, I can spin a real PR 
on GitHub.

--
components: asyncio
files: issue.patch
keywords: patch
messages: 413025
nosy: asvetlov, jnsnow, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.create_unix_server has an off-by-one error concerning the 
backlog parameter
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50618/issue.patch

___
Python tracker 

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



[issue46714] Python 3.10 - Users (except from the one who installed) not able to see python in add remove programs.

2022-02-10 Thread Steve Dower


Steve Dower  added the comment:

Thanks. This is being tracked in issue25166, and is waiting on a fix from our 
installer toolset, who have previously indicated that they're not interested in 
fixing it, but wouldn't rule it out in their next major version.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Windows All Users installation places uninstaller in user 
profile

___
Python tracker 

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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2022-02-10 Thread Géry

Change by Géry :


--
nosy: +maggyero

___
Python tracker 

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



[issue45670] New .mapping attribute is broken for some existing uses of dict views

2022-02-10 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thank you for confirming that ChainMap.__iter__() would be in the same boat as 
bidict if a similar .mapping attribute were ever added to dict_keyiterators. 
The specifics of this issue are interesting, but even more interesting to me is 
whatever learnings we can generalize from this.


After testing that the performance impact would be significant, I created the 
feature request you suggested in https://bugs.python.org/issue46713. Thanks for 
suggesting that.


In the meantime, I've updated the relevant docstrings:

>>> help(b.keys)
keys() -> KeysView[~KT] method of bidict.bidict instance
A set-like object providing a view on the contained keys.

When *b._fwdm* is a :class:`dict`, *b.keys()* returns a
*dict_keys* object that behaves exactly the same as
*collections.abc.KeysView(b)*, except for

  - offering better performance

  - being reversible on Python 3.8+

  - having a .mapping attribute in Python 3.10+
that exposes a mappingproxy to *b._fwdm*.

>>> help(b.values)
values() -> bidict.BidictKeysView[~VT] method of bidict.bidict instance
A set-like object providing a view on the contained values.

Since the values of a bidict are equivalent to the keys of its inverse,
this method returns a set-like object for this bidict's values
rather than just a collections.abc.ValuesView.
This object supports set operations like union and difference,
and constant- rather than linear-time containment checks,
and is no more expensive to provide than the less capable
collections.abc.ValuesView would be.

See :meth:`keys` for more information.

etc.


Regarding:
> The values() call unexpectedly returns an instance of dict_keys(). At first, 
> I was surprised that this got past the type checker -- you can do set 
> operations with KeysView but not with a ValuesView.

Check out https://github.com/jab/bidict/blob/82f931/bidict/_base.py#L38-L45:

```
class BidictKeysView(t.KeysView[KT], t.ValuesView[KT]):
"""Since the keys of a bidict are the values of its inverse (and vice 
versa),
the ValuesView result of calling *bi.values()* is also a KeysView of 
*bi.inverse*.
"""


dict_keys: t.Type[t.KeysView[t.Any]] = type({}.keys())
BidictKeysView.register(dict_keys)
```

See also https://github.com/python/typeshed/issues/4435 for a request that 
typeshed use a Protocol (structural typing) here.


Thanks again for taking the time to look at my code and discuss so generously.

--

___
Python tracker 

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



[issue46714] Python 3.10 - Users (except from the one who installed) not able to see python in add remove programs.

2022-02-10 Thread richd


New submission from richd :

Experiencing the same issue as reported in https://bugs.python.org/issue31011

When Python is deployed using an enterprise solution, Python is not displayed 
in Programs and Features.

Examples:
1. Using PSExec as System to install Python 3.10.x, logged in users will not 
see Python installed. The Python launcher does appear however.

2. Deployment of Python through SCCM has the same behavior, where logged in 
users do not see the installed Python version in Programs and Features.

--
components: Windows
messages: 413022
nosy: paul.moore, richd, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.10 - Users (except from the one who installed) not able to see 
python in add remove programs.
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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2022-02-10 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

The tempora library implements a [portable 
strftime](https://tempora.readthedocs.io/en/latest/index.html#tempora.strftime).

--

___
Python tracker 

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



[issue46713] Provide a C implementation of collections.abc.KeysView and friends

2022-02-10 Thread Joshua Bronson

New submission from Joshua Bronson :

As suggested by @rhettinger in https://bugs.python.org/msg409443, I'm creating 
a feature request for C implementations of collections.abc.KeysView, 
ValuesView, and ItemsView.

Because these do not currently benefit from C speedups, they're a lot slower 
than their dict_keys, dict_values, and dict_items counterparts. As a result, 
libraries that implement custom Mapping types that are backed by dicts are 
incentivized to override the implementations of keys(), values(), and items() 
they inherit from collections.abc.Mapping to instead return their backing 
dicts' mapping views, causing a potential abstraction leak.

An example can be found in https://github.com/jab/bidict, which implements 
bidirectional mapping types that wrap a forward and an inverse dict which are 
kept in sync with one another.

>>> from bidict import *
>>> bi = bidict({1: 'one', 2: 'two'})
>>> bi.items()  # Overridden for performance:
dict_items([(1, 'one'), (2, 'two')])

Ditto for OrderedBidict:

>>> OrderedBidict(bi).keys()
_OrderedBidictItemsView(OrderedBidict([(1, 'one'), (2, 'two')]))


(The _OrderedBidictItemsView is a custom view whose __iter__ uses the 
implementation inherited by its collections.abc.ItemsView base class so that 
the correct order is respected, but proxies other method calls through to the 
backing dict's dict_items object: 
https://github.com/jab/bidict/blob/2ab42a/bidict/_orderedbidict.py#L90-L150)


Here is a microbenchmark of calling __eq__ on an _OrderedBidictItemsView vs. a 
collections.abc.ItemsView, to estimate the performance impact (using Python 
3.10):

❯ set setup '
from collections.abc import ItemsView
from bidict import OrderedBidict
d = dict(zip(range(), range()))
ob = OrderedBidict(d)'

❯ python -m pyperf timeit -s $setup 'ob.items() == d.items()' -o 1.json

❯ python -m pyperf timeit -s $setup 'ItemsView(ob) == d.items()' -o 2.json

❯ pyperf compare_to 2.json 1.json
Mean +- std dev: [2] 4.21 ms +- 1.10 ms -> [1] 168 us +- 6 us: 25.13x faster


This demonstrates a potentially significant speedup. Similar microbenchmarks 
for ItemsView vs. dict_items, as well as KeysView vs. both dict_keys and 
_OrderedBidictKeysView, also indicate similarly significant potential.

Note that the performance benefits of this may propagate to other code as well. 
For example, bidicts' __eq__ methods are implemented in terms of their 
itemsviews (see 
https://github.com/jab/bidict/blob/2ab42a/bidict/_base.py#L285-L286), so 
speeding up bidict.items().__eq__ speeds up bidict.__eq__ commensurately.

--
messages: 413020
nosy: jab
priority: normal
severity: normal
status: open
title: Provide a C implementation of collections.abc.KeysView and friends

___
Python tracker 

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



[issue33017] Special set-cookie setting will bypass Cookielib

2022-02-10 Thread Adrian Chaves


Adrian Chaves  added the comment:

So, PoC shows how an empty domain attribute (Domain=) is erroneously turned 
into a dot (.).

I want to add that a dot (Domain=.) should be turned into an empty string (the 
specification asks to remove a leading dot if found).

--
nosy: +adrian2

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-10 Thread hydroflask


hydroflask  added the comment:

Thanks again everyone, very much appreciated.

--

___
Python tracker 

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



[issue45923] Improve performance of sys.settracing based tools.

2022-02-10 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset d7a5aca982def155a9255893cefcc1493c127c9c by Brandt Bucher in 
branch 'main':
bpo-45923: Add `RESUME_QUICK` (GH-31244)
https://github.com/python/cpython/commit/d7a5aca982def155a9255893cefcc1493c127c9c


--

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-10 Thread Alex Waygood

Alex Waygood  added the comment:

@Guido, OP already has — Jelle and I have both reviewed and approved it :)

--

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

"PR"

--

___
Python tracker 

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



[issue13305] datetime.strftime("%Y") not consistent for years < 1000

2022-02-10 Thread Chris Larson


Chris Larson  added the comment:

Has there been any work/progress on this? Alternatively, what suggested work 
around/mitigations are suggested?

--
nosy: +cklarson

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-10 Thread Guido van Rossum


Guido van Rossum  added the comment:

Go ahead and send a or to deprecate it.--
--Guido (mobile)

--

___
Python tracker 

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



[issue46433] _PyType_GetModuleByDef optimization is incorrect

2022-02-10 Thread Petr Viktorin


Petr Viktorin  added the comment:

Just 3.10, after all. 3.9 doesn't have the function yet.

I did the backport, but I'd welcome a review by a fresh set of eyes!

--
versions:  -Python 3.9

___
Python tracker 

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



[issue46433] _PyType_GetModuleByDef optimization is incorrect

2022-02-10 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +29429
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/31262

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-10 Thread Éric Araujo

Éric Araujo  added the comment:

Thinking about it again: The issue is that these tables (for sys.float_info and 
other named tuples / structseqs) use the const role, which is not meant to 
identify attributes but to link to them (similar to func, mod, data, etc).  In 
other words we are fixing an issue that a wrong target is used, but we should 
not be linking for a target at all, this is the target.  So if we can’t use the 
equivalent of directives function, module, etc (that define the targets of 
func, mod, etc), then maybe they should be just ``name``, not :role:`name`.

--

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-10 Thread Zachary Ware


Zachary Ware  added the comment:

An updated reST linting check was added between the time you created the PR and 
your last update.  As Jelle noted on the PR, there doesn't need to be a NEWS 
entry for this anyway.

We might have an issue there if sphinx-lint is going to have an issue with no 
trailing newline and blurb-it isn't going to add a trailing newline, though. 
(+mdk)

--
nosy: +mdk, zach.ware

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-10 Thread Meer Suri


Meer Suri  added the comment:

Can someone guide me on why I'm getting a no-new-line at end of file error for 
the NEWS entry when I didnt change this file in the last commit and it passed 
the Azure checks earlier

Error: [1] 
../Misc/NEWS.d/next/Documentation/2022-02-08-15-38-16.bpo-46586.6qVFVL.rst:0: 
No newline at end of file (no-newline-at-end-of-file). Do I need to manually 
add the new line?

--

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-10 Thread Jelle Zijlstra

Jelle Zijlstra  added the comment:

> How do I find other instances of this problem? Is there a systematic way to 
> look for such references?

You could write a script that goes something like this, iterating over all the 
docs RST files:

- Find all definitions in the file (e.g. `.. decorator:: property`)
- Filter to those that have names that also appear in builtins
- Find any links using those names within the same file

That would catch the enum.property case, but not the float_info one Éric 
noticed, because sys.rst doesn't define `max` at all. To catch that one, you 
could look at the link role: sys.rst links to it with :const:`max`, but 
functions.rst defines it as `.. function:: max`. Mismatches like that could be 
another clue that something is wrong (but there are some legitimate reasons why 
the roles won't match perfectly, like "decorator" in the definition vs. "func" 
in the link).

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-10 Thread Meer Suri


Meer Suri  added the comment:

It took me some time to figure out how to prevent the creation of a 
reference/hyperlink using the ! prefix. I've made the change to remove the 
references to the max and min attributes of sys.float_info and pushed.

How do I find other instances of this problem? Is there a systematic way to 
look for such references?

--

___
Python tracker 

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



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-10 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +29428
pull_request: https://github.com/python/cpython/pull/31261

___
Python tracker 

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



[issue46710] Install launcher for all users on the domain

2022-02-10 Thread Marcus Fillipe Groetares Rocha Siqueira


Marcus Fillipe Groetares Rocha Siqueira  added the 
comment:

Thanks Steve, it worked.
Hava a nice day :)

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

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-02-10 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-02-10 Thread Kumar Aditya


Kumar Aditya  added the comment:

I have refactored generate_global_objects.py, and now instead of hard-coding 
every identifier manually, it now scans *.c files extracts the identifiers used 
in it and then generate the header file. This has multiple advantages:

- No need to manually add identifiers, as soon as it is used in a c file it is 
added to the global identifiers struct.
- It simplifies the codegen a lot.
- Remove the need of special casing certain file for checking now it is just a 
set of identifiers and auto removes unused global strings.

--
nosy: +eric.snow

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-10 Thread Christian Heimes


Christian Heimes  added the comment:

Please leave the ticket open until we have an agreement how to handle the 
missing error checks.

--
resolution: fixed -> 
stage: resolved -> 
status: closed -> open
type:  -> behavior

___
Python tracker 

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



[issue46712] Share global string identifiers in deepfreeze

2022-02-10 Thread Kumar Aditya


New submission from Kumar Aditya :

Since bpo-46541, the global strings are statically allocated so they can now be 
referenced by deep-frozen modules just like any other singleton. Sharing 
identifiers with deepfreeze will reduce the duplicated strings hence it would 
save space.

See https://github.com/faster-cpython/ideas/issues/218
See https://github.com/faster-cpython/ideas/issues/230

--
messages: 413003
nosy: gvanrossum, kumaraditya303
priority: normal
severity: normal
status: open
title: Share global string identifiers in deepfreeze
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



[issue46608] Exclude marshalled-frozen data if deep-freezing to save 300 KB space

2022-02-10 Thread Kumar Aditya


Change by Kumar Aditya :


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



[issue46430] intern strings in deepfrozen modules

2022-02-10 Thread Kumar Aditya


Kumar Aditya  added the comment:

I consider this done so closing it as improving the error handling of interning 
it out of scope of this issue.

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



[issue46681] gzip.compress does not forward compresslevel to zlib.compress

2022-02-10 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-10 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue46494] Mention typing_extensions in the typing documentation

2022-02-10 Thread Meer Suri


Change by Meer Suri :


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

___
Python tracker 

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



[issue46690] create_autospec() doesn't respect configure_mock style kwargs

2022-02-10 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I guess the problem is that during the initial mock creation kwargs is passed 
so calling test_method immediately after mock creation raises ValueError. But 
as we loop through the attributes and create new child mock for the attributes 
the original configured mock for the method that raises ValueError is 
overridden by another object without the configuration info. Probably it makes 
sense to call configure_mock again after all children mock are constructed. 
Something like below works and I don't see any test failures in mock related 
test cases.

index 2719f74d6f..585e875c95 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2637,6 +2637,7 @@ def create_autospec(spec, spec_set=False, instance=False, 
_parent=None,
f'[object={spec!r}]')
 is_async_func = _is_async_func(spec)
 _kwargs = {'spec': spec}
+original_kwargs = kwargs
 if spec_set:
 _kwargs = {'spec_set': spec}
 elif spec is None:
@@ -2740,6 +2741,9 @@ def create_autospec(spec, spec_set=False, instance=False, 
_parent=None,
 if isinstance(new, FunctionTypes):
 setattr(mock, entry, new)
 
+if _is_instance_mock(mock):
+mock.configure_mock(**original_kwargs)
+
 return mock

--
components: +Library (Lib) -Tests
nosy: +cjw296, lisroach, mariocj89, michael.foord

___
Python tracker 

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



[issue46711] test_logging: test_post_fork_child_no_deadlock() failed with timeout on AMD64 Arch Linux Asan Debug 3.10

2022-02-10 Thread STINNER Victor


New submission from STINNER Victor :

The test calls support.wait_process() which uses SHORT_TIMEOUT.

wait_process() should use LONG_TIMEOUT, or the ASAN buildbot should increase 
its timeout (regrtest --timeout parameter).

IMO using LONG_TIMEOUT is fine: it's ok if the test takes 2 minutes instead of 
1 second, it's only important that it completes :-) The test should not measure 
the *performance* of the code, only if the code is valid. When tests are run in 
parallel, the buildbot system load can be very high. In this case, the system 
load was 1.70:

0:35:49 load avg: 1.70 [255/421/1] test_logging failed (1 failure) (1 min 18 
sec)


AMD64 Arch Linux Asan Debug 3.10:
https://buildbot.python.org/all/#/builders/621/builds/466

==
FAIL: test_post_fork_child_no_deadlock (test.test_logging.HandlerTest)
Ensure child logging locks are not held; bpo-6721 & bpo-36533.
--
Traceback (most recent call last):
  File 
"/buildbot/buildarea/3.10.pablogsal-arch-x86_64.asan_debug/build/Lib/test/test_logging.py",
 line 750, in test_post_fork_child_no_deadlock
support.wait_process(pid, exitcode=0)
  File 
"/buildbot/buildarea/3.10.pablogsal-arch-x86_64.asan_debug/build/Lib/test/support/__init__.py",
 line 1971, in wait_process
raise AssertionError(f"process {pid} is still running "
AssertionError: process 406366 is still running after 52.5 seconds

--
components: Tests
messages: 413000
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_logging: test_post_fork_child_no_deadlock() failed with timeout on 
AMD64 Arch Linux Asan Debug 3.10
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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

With PR 31253 fix, I confirm that it fix my bug explained in msg412992.

commit 012e77eb5c3ba3d411f5967a7f368ebdb42ab88c
Author: Andrew Svetlov 
Date:   Thu Feb 10 14:57:20 2022 +0200

Fix warning: asyncio.events._event_loop_policy was modified by test_asyncio 
(GH-31253)

--

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2022-02-10 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29425
pull_request: https://github.com/python/cpython/pull/31259

___
Python tracker 

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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue46710] Install launcher for all users on the domain

2022-02-10 Thread Steve Dower


Steve Dower  added the comment:

This option may be disabled if you have already installed the launcher 
for only the current user. In this case, we aren't able to replace it 
with an all-users install.

Open Programs and Features and find the Python launcher, uninstall it, 
and then try again.

If it doesn't appear to be installed, you may have another issue. We'd 
need to see the log files created in %TEMP% when you run the installer 
(only up until the checkbox is shown, there should be enough information 
in the log files by then to see what's going on).

--

___
Python tracker 

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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +29424
pull_request: https://github.com/python/cpython/pull/31256

___
Python tracker 

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



[issue46710] Install launcher for all users on the domain

2022-02-10 Thread Marcus Fillipe Groetares Rocha Siqueira

New submission from Marcus Fillipe Groetares Rocha Siqueira 
:

In Python 3.9.6 (64 bits) Windows Installer, the first page show a checkbox for 
"install launcher for all users (recommended)", but i'd like to now why the box 
is not currently allowed to check.

In "customize installation" option, exist other "Install for all users" options 
and its not working also.

I tried to install with my local admin account and with my AD Admin account as 
well.

can somebody help me please?

--
components: Windows
files: Sem título.jpg
messages: 412997
nosy: marcus.siqueira, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Install launcher for all users on the domain
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50617/Sem título.jpg

___
Python tracker 

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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +29423
pull_request: https://github.com/python/cpython/pull/31255

___
Python tracker 

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



[issue46532] Improve efficiency of PRECALL/CALL instructions

2022-02-10 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 2cea8c29cf975a8ad7d8c3ff19d1e836c2d54707 by Mark Shannon in 
branch 'main':
bpo-46532: Reduce number of memory writes to update call_shape.kwnames. 
(GH-31231)
https://github.com/python/cpython/commit/2cea8c29cf975a8ad7d8c3ff19d1e836c2d54707


--

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2022-02-10 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29422
pull_request: https://github.com/python/cpython/pull/31254

___
Python tracker 

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



[issue45490] [C API] PEP 670: Convert macros to functions in the Python C API

2022-02-10 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I made a list of macros that reuse their argument some time around 
February/March 2021. (Each macro is squashed into a single line for some reason 
I can't remember.) See attachment, or check out the gist version:

https://gist.github.com/erlend-aasland/a7ca3cff95b136e272ff5b03447aff21

--
Added file: https://bugs.python.org/file50616/macros-that-reuse-args.txt

___
Python tracker 

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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the report!
Let me make a fix PR in a few minutes

--

___
Python tracker 

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



[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

2022-02-10 Thread STINNER Victor


New submission from STINNER Victor :

test_urllib failed and then passed when re-run on s390x RHEL7 Refleaks 3.x:
https://buildbot.python.org/all/#builders/129/builds/300

I can reproduce the issue on my Linux laptop:

$ ./python -m test -m 
unittest.test.test_break.TestBreakDefaultIntHandler.testInterruptCaught 
test_unittest -F
0:00:00 load avg: 1.52 Run tests sequentially
0:00:00 load avg: 1.52 [  1] test_unittest
0:00:00 load avg: 1.52 [  2] test_unittest
0:00:00 load avg: 1.52 [  3] test_unittest
0:00:00 load avg: 1.52 [  4] test_unittest
0:00:00 load avg: 1.52 [  5] test_unittest
0:00:01 load avg: 1.52 [  6] test_unittest
0:00:01 load avg: 1.52 [  7] test_unittest
0:00:01 load avg: 1.52 [  8] test_unittest
test test_unittest failed -- Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/unittest/test/test_break.py", line 66, 
in testInterruptCaught
test(result)

  File "/home/vstinner/python/main/Lib/unittest/test/test_break.py", line 63, 
in test
self.assertTrue(result.shouldStop)
^^
AssertionError: False is not true

test_unittest failed (1 failure)

== Tests result: FAILURE ==

7 tests OK.

1 test failed:
test_unittest

Total duration: 1.7 sec
Tests result: FAILURE

--
components: Tests
messages: 412993
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_urllib: testInterruptCaught() has a race condition and fails 
randomly
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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread STINNER Victor


STINNER Victor  added the comment:

By default, asyncio.events._event_loop_policy is None:

$ ./python -i
>>> import asyncio; asyncio.events._event_loop_policy is None
True


After running the test, it changes:

vstinner@apu$ ./python -i
Python 3.11.0a5+ (heads/main:46328d8ae6, Feb  9 2022, 21:25:58) [GCC 11.2.1 
20211203 (Red Hat 11.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio; asyncio.events._event_loop_policy is None
True
>>> 
vstinner@apu$ ./python -i -m test test_asyncio -m test_sock_client_fail
(...)
Tests result: SUCCESS
(...)
SystemExit: 0
>>> import asyncio; asyncio.events._event_loop_policy


--

___
Python tracker 

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



[issue46708] test_asyncio: test_sock_client_fail() changes asyncio.events._event_loop_policy

2022-02-10 Thread STINNER Victor


New submission from STINNER Victor :

Seen on s390x RHEL7 Refleaks 3.x:
https://buildbot.python.org/all/#/builders/129/builds/300

== Tests result: FAILURE ==
(...)
3 tests failed:
test_asyncio test_importlib test_unittest
(...)
0:36:44 load avg: 0.50 Re-running test_asyncio in verbose mode (matching: 
test_sock_client_fail)
beginning 6 repetitions
123456
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok
test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) 
... ok
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok

--
Ran 3 tests in 0.062s

OK
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok
test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) 
... ok
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok

--
Ran 3 tests in 0.061s

OK
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok
test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) 
... ok
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok

--
Ran 3 tests in 0.055s

OK
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok
test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) 
... ok
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok

--
Ran 3 tests in 0.053s

OK
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok
test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) 
... ok
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok

--
Ran 3 tests in 0.060s

OK
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.EPollEventLoopTests) ... ok
test_sock_client_fail (test.test_asyncio.test_sock_lowlevel.PollEventLoopTests) 
... ok
test_sock_client_fail 
(test.test_asyncio.test_sock_lowlevel.SelectEventLoopTests) ... ok

--
Ran 3 tests in 0.060s

OK
..
Warning -- asyncio.events._event_loop_policy was modified by test_asyncio
Warning --   Before: None
Warning --   After:  

--
components: Tests, asyncio
messages: 412991
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: test_sock_client_fail() changes 
asyncio.events._event_loop_policy
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



[issue46072] Unify handling of stats in the CPython VM

2022-02-10 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29420
pull_request: https://github.com/python/cpython/pull/31251

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2022-02-10 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29419
pull_request: https://github.com/python/cpython/pull/31250

___
Python tracker 

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



[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-10 Thread Alex Waygood


Alex Waygood  added the comment:

Just so that all the discussion related to this issue can be found in one 
place, here's a summary:

- After opening this ticket, OP opened an issue in the python/typing 
repository, where the idea of deprecating this syntax received many thumbs-up 
reactions, and where there were no dissenting voices: 
https://github.com/python/typing/issues/981
- The initial impetus for this change was this mypy bug report: 
https://github.com/python/mypy/issues/11555
- Mypy's policy since January 2020 has been that it would be more trouble than 
it's worth to attempt to support the kwargs-based syntax: 
https://github.com/python/mypy/issues/2492#issuecomment-579500959

--

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-10 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset db052851a70fd95d047c6263fc16a75e4d47b3ed by Dong-hee Na in branch 
'main':
bpo-46323: Allow alloca(0) for python callback function of ctypes (GH-31249)
https://github.com/python/cpython/commit/db052851a70fd95d047c6263fc16a75e4d47b3ed


--

___
Python tracker 

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



[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Something like:

_unset = ['unset']
class CachedAwaitable:
def __init__(self, awaitable):
self.awaitable = awaitable
self.result = _unset
def __await__(self):
if self.result is _unset:
self.result = yield from self.awaitable.__await__()
return self.result

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-10 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +29418
pull_request: https://github.com/python/cpython/pull/31249

___
Python tracker 

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



[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-10 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

You can return a wrapper from __get__ that awaits the inner function and saves 
the result somewhere.

--

___
Python tracker 

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



[issue46657] Add mimalloc memory allocator

2022-02-10 Thread Christian Heimes


Christian Heimes  added the comment:

ICC 2021 has full support for stdatomic.h and compiles mimalloc just fine:

$ CC="icc" ./configure -C --with-pydebug
$ make
$ ./python
Python 3.11.0a5+ (main, Feb  9 2022, 15:57:40) [GCC Intel(R) C++ gcc 7.5 mode] 
on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys._malloc_info
sys._malloc_info(allocator='mimalloc_debug', with_pymalloc=True, 
with_mimalloc=True, mimalloc_secure=4, mimalloc_debug=2)


AIX xlc is still a problem. It does not support C11 stdatomic.h. But it comes 
with older GCC atomic memory access __sync function family, 
https://www.ibm.com/docs/en/xl-c-and-cpp-aix/13.1.3?topic=cbif-gcc-atomic-memory-access-built-in-functions-extension
 . It might be possible to re-implement mimalloc's atomics with __sync 
functions (e.g. https://gist.github.com/nhatminhle/5181506). The implementation 
would be less efficient, though. The __sync functions don't have memory order, 
atomic_load_explicit(v) becomes __sync_fetch_and_add(v, 0), and 
atomic_store_explicit() requires two full memory barriers.

--

___
Python tracker 

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



[issue46622] Support decorating a coroutine with functools.cached_property

2022-02-10 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

> should not use asyncio directly but 'async def', 'await', and 
> `inspect.iscoroutine()` / `inspect.iscoroutinefunction()` instead.

Hmm, this introduces some difficulties. Since a coroutine can only be awaited 
once, a new coroutine needs to be returned (that simply return the result when 
awaited) each time __get__ is called. But this means we need a way to somehow 
get the result in __get__. If there’s a separate `cached_property_async` it’s 
possible to make __get__ a coroutine function, but personally I’d prefer the 
interface to match the PyPI cached_property.

--

___
Python tracker 

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



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset dee020a6f5bf29f95bec6294da9bcd577114f592 by Nikita Sobolev in 
branch 'main':
Fix sphinx-lint after #31097 and b878b3a (GH-31248)
https://github.com/python/cpython/commit/dee020a6f5bf29f95bec6294da9bcd577114f592


--

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-10 Thread miss-islington


miss-islington  added the comment:


New changeset dee020a6f5bf29f95bec6294da9bcd577114f592 by Nikita Sobolev in 
branch 'main':
Fix sphinx-lint after #31097 and b878b3a (GH-31248)
https://github.com/python/cpython/commit/dee020a6f5bf29f95bec6294da9bcd577114f592


--
nosy: +miss-islington

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-10 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
nosy: +sobolevn
nosy_count: 3.0 -> 4.0
pull_requests: +29417
pull_request: https://github.com/python/cpython/pull/31248

___
Python tracker 

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



[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-10 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
nosy: +sobolevn
nosy_count: 4.0 -> 5.0
pull_requests: +29416
pull_request: https://github.com/python/cpython/pull/31248

___
Python tracker 

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



[issue46705] Memory optimization for set.issubset

2022-02-10 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would not testing len(self.difference(other)) == 0 be more efficient? Making a 
copy of a set and removing elements one by one may be faster than add elements 
one by one, because we only need to allocate a single chunk of memory for a set.

It depends on relative values of len(self), len(other) and len(set(other)). For 
example, the following code may be optimal in some cases:

tmp = set()
it = iter(other)
for item in it:
# if item in self: ?
tmp.add(item)
if len(tmp) >= len(self):
self = self.difference(tmp, it)
if not self:
return True
self.difference_update(other)
return not self
else:
return False  # len(self) > len(set(other))

The disadvantage of such optimizations is that they make the code much more 
bigger. The current code is small and simple, and good enough in most cases.

--

___
Python tracker 

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



[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-10 Thread Dong-hee Na


Dong-hee Na  added the comment:

@hydroflask @vstinner

Okay let's remove if statement, I will send a patch soon.

--

___
Python tracker 

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