[issue47009] Streamline list.append for the common case

2022-03-15 Thread Inada Naoki


Inada Naoki  added the comment:

Thank you. I agree that inlining is worth enough.

But we already inlined too many functions in ceval and there is an issue caused 
by it... (bpo-45116)

--

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf


Aur Saraf  added the comment:

Added an attempt to handle signals. I don't think it's working, because when I 
press Ctrl+C while hashing a long file, it only raises KeyboardInterrupt after 
waiting the amount of time it usually takes the C code to return, but maybe 
that's not a good test?

--

___
Python tracker 

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



[issue46744] installers on ARM64 suggest wrong folders

2022-03-15 Thread conio


conio  added the comment:

I opened a PR for this change (https://github.com/python/cpython/pull/31803). 
I'd appreciate your comments and/or approval.

I didn't add anything to the NEWS.d folder since it seems to me like something 
completely internal to the build process and so minor not worth mentioning 
there.

--

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf


Aur Saraf  added the comment:

Forgot an important warning: this is the first time I write C code against the 
Python API, and I didn't thoroughly read the guide (or at all, to be honest). I 
think I did a good job, but please suspect my code of noob errors.

I'm especially not confident that it's OK to not do any special handling of 
signals. Can read() return 0 if it was interrupted by a signal? This will stop 
the hash calculation midway and behave as if it succeeded. Sounds suspiciously 
like something we don't want. Also, I probably should support signals because 
such a long operation is something the user definitely might want to interrupt?

May I have some guidance please? Would it be enough to copy the code from 
fileutils.c _Py_Read() and addi an outer loop so we can do many reads with the 
GIL released and still call PyErr_CheckSignals when needed with the GIL taken?

--

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I'd advocate for not supporting bytes paths and instead updating the 
documentation to require strings.

--
nosy: +jaraco

___
Python tracker 

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



[issue47033] Build failure on macOS Big Sur

2022-03-15 Thread Ghyslain Leclerc


Ghyslain Leclerc  added the comment:

Thank you for your quick answer.  Your comment about the configure output has 
made me think to look at it more carefully.  No error was reported, so I did 
not think to look at it before.  Looking at it and trying to figure out the 
problems, I figured out the problem and was able to compile.

Just to give more info for anyone running into the same problem, I had a clean 
checkout of the v3.10.2 tag.  The problem was that I actually had a gcc version 
installed from MacPorts and it seems that it was getting picked up.  When I 
removed it from my path, everything started compiling fine.

Sorry for making you waste your time.  This issue can be closed.  Thanks again.

--

___
Python tracker 

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



[issue47033] Build failure on macOS Big Sur

2022-03-15 Thread Ghyslain Leclerc


Change by Ghyslain Leclerc :


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



[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf


Aur Saraf  added the comment:

The rationale behind `from_raw_file()` and the special treatment of 
non-buffered IO is that there is no `read_buffer()` API or other clean way to 
say "I want to read just what's currently in the buffer so that from now on I 
could read directly from the file descriptor without harm".

If you want to read from a buffered file object, sure, just call `from_file()`. 
If you want to ensure you'll get full performance benefits, call 
`from_raw_file()`. If you pass an eligible file object to `from_file()` you'll 
get the benefits anyway, because why not.

--

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Aur Saraf


Aur Saraf  added the comment:

PR contains a draft implementation, would appreciate some review before I 
implement the same interface on all builtin hashes as well as OpenSSL hashes.

--

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset ad6ddd89006b9fa4836a944c99f8076f26faf299 by Steve Dower in branch 
'3.9':
[3.9] bpo-47032: Ensure Windows install builds fail correctly with a non-zero 
exit code when part of the build fails (GH-31921) (GH-31927)
https://github.com/python/cpython/commit/ad6ddd89006b9fa4836a944c99f8076f26faf299


--

___
Python tracker 

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



[issue45150] Add a file_digest() function in hashlib

2022-03-15 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +30019
pull_request: https://github.com/python/cpython/pull/31928

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 04fdbb4f7003a7399f7ba626cf548e2b9dac1045 by Steve Dower in branch 
'3.10':
[3.10] bpo-47032: Ensure Windows install builds fail correctly with a non-zero 
exit code when part of the build fails (GH-31921) (GH-31926)
https://github.com/python/cpython/commit/04fdbb4f7003a7399f7ba626cf548e2b9dac1045


--
nosy: +miss-islington

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:


New changeset 4a1d65fe8528c3a6e0cf2f4f9d4b58249164589d by Miss Islington (bot) 
in branch '3.7':
bpo-46948: Fix launcher installer build failure due to first part of fix 
(GH-31920) (GH-31925)
https://github.com/python/cpython/commit/4a1d65fe8528c3a6e0cf2f4f9d4b58249164589d


--

___
Python tracker 

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



[issue47033] Build failure on macOS Big Sur

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:

You don't say exactly what changeset of the cpython repo you are trying to 
build from. The line numbers in the compiler warnings in your build.out extract 
do not seem to match up with either a current 3.10 branch checkout or a main 
branch checkout. Please make sure your repo is up-to-date with the current 
github version for whatever branch you are trying to build. You shouldn't have 
any problems like shown when building any of the current branches on macOS 
11.6.x with its current Xcode or Command Line Tools installed. The Python 
Developers Guide might be of assistance:

https://devguide.python.org

If you still have problems, please show the output of:

   git show

as well as the exact configure and make commands in use, and the complete 
configure and make output.

--

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30018
pull_request: https://github.com/python/cpython/pull/31927

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30017
pull_request: https://github.com/python/cpython/pull/31926

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:


New changeset 7c776521418676c074a483266339d31c950f516e by Steve Dower in branch 
'main':
bpo-47032: Ensure Windows install builds fail correctly with a non-zero exit 
code when part of the build fails (GH-31921)
https://github.com/python/cpython/commit/7c776521418676c074a483266339d31c950f516e


--

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 70eb9db39817a8f9abef801a2a4a7bb2c7411654 by Miss Islington (bot) 
in branch '3.9':
bpo-46948: Fix launcher installer build failure due to first part of fix 
(GH-31920)
https://github.com/python/cpython/commit/70eb9db39817a8f9abef801a2a4a7bb2c7411654


--

___
Python tracker 

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



[issue47033] Build failure on macOS Big Sur

2022-03-15 Thread Ghyslain Leclerc


Ghyslain Leclerc  added the comment:

Here is a build output.

--
Added file: https://bugs.python.org/file50681/build.out

___
Python tracker 

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



[issue47033] Build failure on macOS Big Sur

2022-03-15 Thread Ghyslain Leclerc


New submission from Ghyslain Leclerc :

I have tried to compile python on macOS and I have failed.

I have cloned the cpython repository, then used ./configure and make.  There 
are build errors on my system.  They seem related to 
https://bugs.python.org/issue42692.

I have tried the __has_builtin(__builtin_available) code in a single main.c 
file and it compiles and has the appropriate behavior.  I have then tried to 
add #warnings in the file posixmodule.c.  It seems that when compiling this 
file, the preprocessor define does not work.

I run macOS version 11.6.4 (20G417).  I have Xcode Version 13.0 (13A233).  The 
compiler version is:
  Apple clang version 13.0.0 (clang-1300.0.29.3)
  Target: x86_64-apple-darwin20.6.0

Thank you.

--
components: macOS
messages: 415312
nosy: Ghyslain Leclerc, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Build failure on macOS Big Sur
type: compile error
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



[issue47013] test_bdb and test_distutils fail on installed Python 3.9, 3.10 and 3.11 (setuptools 60.9.3, pip 22.0.4)

2022-03-15 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

See https://github.com/pypa/setuptools/issues/3007#issuecomment-1068621865 
where I did a brief analysis and probable explanation.

What it boils down to: Setuptools needs to supply its own copy of distutils 
aggressively. It provides an opt out for this behavior and is able to offer 
built in opt out based on whatever signal is available. The default opt out is 
the SETUPTOOLS_USE_DISTUTILS=stdlib env var. for CPython, it also disables the 
behavior when ./pybuilddir.txt is present, but installed Pythons probably don’t 
have this config.

Can those test runners be updated to set this environment variable?

--

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 58d30b992d67c8471f79a7307e4c1cda64311e3b by Miss Islington (bot) 
in branch '3.10':
bpo-46948: Fix launcher installer build failure due to first part of fix 
(GH-31920)
https://github.com/python/cpython/commit/58d30b992d67c8471f79a7307e4c1cda64311e3b


--

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30016
pull_request: https://github.com/python/cpython/pull/31925

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30015
pull_request: https://github.com/python/cpython/pull/31924

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30014
pull_request: https://github.com/python/cpython/pull/31923

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +30013
pull_request: https://github.com/python/cpython/pull/31922

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:


New changeset 708812085355c92f32e547d1f1d1f29aefbbc27e by Steve Dower in branch 
'main':
bpo-46948: Fix launcher installer build failure due to first part of fix 
(GH-31920)
https://github.com/python/cpython/commit/708812085355c92f32e547d1f1d1f29aefbbc27e


--

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue47032] CI does not detect launcher installer build failure

2022-03-15 Thread Steve Dower


New submission from Steve Dower :

When changes are made under the Tools/msi directory, extra tests are run in 
GitHub Actions to build the installer.

Apparently, these tests do not fail when the launcher installer fails to build. 
They need to.

--
assignee: steve.dower
messages: 415308
nosy: steve.dower
priority: normal
severity: normal
stage: needs patch
status: open
title: CI does not detect launcher installer build failure
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30011
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31920

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-15 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 49e1e1e1bd59cac1855b1ef4dec05d649ebcd81a by Mark Shannon in 
branch 'main':
bpo-46841: Don't scan backwards in bytecode (GH-31901)
https://github.com/python/cpython/commit/49e1e1e1bd59cac1855b1ef4dec05d649ebcd81a


--

___
Python tracker 

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



[issue46948] [CVE-2022-26488] Escalation of privilege via Windows Installer

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:

The fix for this regressed the installer for the py.exe launcher, which breaks 
our release builds.

I'm patching it now. It's going under the same issue number because it will be 
needed for anyone applying this patch directly and then building the installer 
themselves.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2022-03-15 Thread Daniël van Noord

Daniël van Noord  added the comment:

I resubmitted the original patch and updated it with documentation and news 
item changes.

This would still be a valuable addition imo, as it can help single out 
expensive calls in your module/script.

--
nosy: +danielnoord

___
Python tracker 

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



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2022-03-15 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 5.0 -> 6.0
pull_requests: +30009
pull_request: https://github.com/python/cpython/pull/31919

___
Python tracker 

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



[issue46404] 3.11a4: a small attrs regression

2022-03-15 Thread Lumír Balhar

Lumír Balhar  added the comment:

We have the same problem reported in attrs here in dataclasses and because it's 
not tested the way to manipulate __closure__ cells changes frequently.

My plan is to implement something similar to this into dataclasses: 
https://github.com/python-attrs/attrs/blob/5c040f30e3e4b3c9c0f27c8ac6ff13d604c1818c/src/attr/_make.py#L895-L916

Basically, when a new dataclass is created (with slots=True), look for 
references to the original class and fix them.

This fixes the problem reported to attrs in dataclasses and when we fix it and 
add some tests for it, the future behavior should be more stable.

What do you think?

--

___
Python tracker 

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



[issue47031] math.nan should note that NANs do not compare equal to anything

2022-03-15 Thread Steven D'Aprano


New submission from Steven D'Aprano :

The IEEE-754 requirement that NANs are never equal to anything, even to 
themselves, is a common stumbling block for those new to the consequences of 
IEEE-754. See for example #47020.

The documentation for math.nan would be a good place to add a note like

"Due to the requirements of the `IEEE-754 standard 
`_, math.nan and float('nan') are never 
equal to any other value, including themselves. Use math.isnan to test for 
NANs."

https://docs.python.org/3.8/library/math.html#math.nan

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 415302
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: math.nan should note that NANs do not compare equal to anything
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



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

2022-03-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

The link 
https://github.com/facebookincubator/cinder/blob/cinder/3.8/Python/ceval.c#L6617
 points to something that I wouldn't associate with the subject. @Dino, could 
you provide a new link (preferably a permalink)?

FWIW rather than dynamically checking what the next opcode is, maybe we could 
use a super-instruction for CALL + GET_AWAITABLE? (Understanding that there are 
a bunch of different CALL opcodes.)

The gather code you link to is all in C. Is rewriting gather in C the only way 
to benefit from this speedup? (I guess you could just add your gather impl to 
the existing _asynciomodule.c, in the same or a separate PR.)

--

___
Python tracker 

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



[issue46404] 3.11a4: a small attrs regression

2022-03-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

@frenzy: I'm not sure what your fix would do. You could either describe it in 
rough terms (if you'd like a pre-PR opinion on the approach), or I'm happy to 
wait to see your PR.

--

___
Python tracker 

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



[issue46963] Deep Lazy Imports - Interpreter-level deferred module loading

2022-03-15 Thread Zsolt Dollenstein


Change by Zsolt Dollenstein :


--
nosy: +zsol

___
Python tracker 

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



[issue25291] better Exception message for certain task termination scenario

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Python 3.7 forbids Task.set_exception() and Task.set_result(), the error 
message is pretty clear.

Nothing to do here

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



[issue46457] test_unittest: TestAsyncCase.test_debug_cleanup_same_loop() hangs with gc.set_threshold(500)

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

#46994 fixed this problem

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset a4674f0194067a801f6c6bdb4fc6448e3a40e069 by Christian Heimes in 
branch 'main':
bpo-40280: Detect presence of time.tzset and thread_time clock (GH-31898)
https://github.com/python/cpython/commit/a4674f0194067a801f6c6bdb4fc6448e3a40e069


--

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


--
priority: release blocker -> normal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e8b72fc7f3937b6b86354110917da161ca36cff7 by Ned Deily in branch 
'3.8':
[3.8] bpo-47024: Update Windows builds and macOS installer build to use OpenSSL 
1.1.1n. (GH-31912)
https://github.com/python/cpython/commit/e8b72fc7f3937b6b86354110917da161ca36cff7


--

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The main branch is clear

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Maybe related: bpo-20891

--

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 513911b359c88df2b32d0bc2776438f52d5e4584 by Christian Heimes in 
branch '3.9':
[3.9] bpo-47024: Update OpenSSL to 1.1.1n (GH-31895) (#31917)
https://github.com/python/cpython/commit/513911b359c88df2b32d0bc2776438f52d5e4584


--

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset a59ac1e7d20713573c15c5259c83e998a73e9094 by Christian Heimes in 
branch '3.10':
[3.10] bpo-47024: Update OpenSSL to 1.1.1n (GH-31895) (GH-31916)
https://github.com/python/cpython/commit/a59ac1e7d20713573c15c5259c83e998a73e9094


--

___
Python tracker 

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



[issue46404] 3.11a4: a small attrs regression

2022-03-15 Thread Lumír Balhar

Lumír Balhar  added the comment:

In my opinion, we should keep it simple for attrs and dataclasses to fix 
closure cells when a class is replaced and therefore it seems to be correct to 
have it mutable as it currently is in 3.11.

My plan is to implement the fix for dataclasses and some tests for these use 
cases so the behavior should not change in the future. For attrs it means one 
more branch in the code now but much simpler code when the support for older 
releases gets dropped.

Any other opinions?

--

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30008
pull_request: https://github.com/python/cpython/pull/31917

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30007
pull_request: https://github.com/python/cpython/pull/31916

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset af0a50de4b77dc774fcfdf5468ec320b08bfb53b by Christian Heimes in 
branch 'main':
bpo-47024: Update OpenSSL to 1.1.1n (GH-31895)
https://github.com/python/cpython/commit/af0a50de4b77dc774fcfdf5468ec320b08bfb53b


--

___
Python tracker 

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



[issue42698] Deadlock in pysqlite_connection_dealloc()

2022-03-15 Thread hydroflask


hydroflask  added the comment:

Closing this issue since sqlite3_close{,_v2}() is no longer called with the GIL 
held in 3.11+

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

So what is causing this bug in 3.10 is the following stack:

thread_entry_point()
  PyGILState_Ensure()
  PyGILState_Release()
...
  PyGILState_Ensure()

The core issue is that PyGILState_Ensure is getting called while the tstate 
itself is in the process of being destroyed. This causes an invalid state and 
eventually results in a segfault or "Fatal Python Error."

I think the most robust fix is to allow re-entrancy to 
PyGILState_Release/PyGILState_Ensure. If that is prohibitively complex and/or 
is not specified to be allowed, I believe the most robust fix is to avoid using 
sqlite3 destructor callbacks to DECREF Python objects.

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI, PyGILState_Ensure may be called by a thread as many times as you want, and 
it has been so for a very long time.

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks, Yuri. 
I'll take a look.

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

If PyGILState_Ensure() has been fixed to become re-entrant during 
PyGILState_Release() in 3.11+ then I believe that change should be backported 
to 3.10. @vstinner would know

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

> All callbacks triggered from external libraries must protect Python C API 
> calls. You may call it offending, but that is the reality; a callback may 
> trigger at any point in time, so we need to make sure the GIL is held before 
> calling any Py API. That is also the case for the destructor.

Sure but I'm suggesting sidestepping and not using the destructor_callback 
entirely. You can DECREF the callbacks manually in connection_close() after 
calling sqlite3_close_v2(). Doing this makes sense to me since the destructor 
may be called under special conditions.

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also Petrs msg400205:

> [...] I recommend that any function passed to SQLite (and only those) should
>  - be named `*_callback`, for clarity
>  - acquire the GIL at the very start
>  - release the GIL at the very end

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also bpo-44304

--
nosy: +pablogsal

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:


New changeset b6204466c1209de5a0794c475096429fdb457a16 by Ned Deily in branch 
'3.7':
bpo-47024: Update Windows builds and macOS installer build to use OpenSSL 
1.1.1n. (GH-31911)
https://github.com/python/cpython/commit/b6204466c1209de5a0794c475096429fdb457a16


--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

All callbacks triggered from external libraries must protect Python C API 
calls. You may call it offending, but that is the reality; a callback may 
trigger at any point in time, so we need to make sure the GIL is held before 
calling any Py API. That is also the case for the destructor.

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

I don't see it immediately but I think it's still possible to happen since all 
the same offending code is in place. There are two reasosn why it probably 
doesn't happen in 3.11+:

1) because something is deferring calling the finalizer for the zero-ref object 
to another thread instead on immediately on the thread that is dying as in 
<=3.10

2) In 3.11+ it is fixed so that PyGILState_Ensure can be called in a sequence 
started by PyGILState_Release. @vstinner is this correct?


If the reason it doesn't happen in 3.11+ is because of 1) then I don't think 
that is specified to happen anywhere and changing the GC in future versions 
could theoretically trigger the same bug. If it is 2) then it is fixed in a 
more robust location.

IMO, the most robust fix is to destroy the function callbacks in 
connection_close() and avoid using the destructor_callback and calling 
PyGILState_Ensure() altogether.

--
nosy: +vstinner

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> If you connect with check_same_thread=False, I believe the issue may still 
> present itself on 3.11+

Nope, works swell on my Mac. Do you see this on Linux with latest 3.11?

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

If you connect with check_same_thread=False, I believe the issue may still 
present itself on 3.11+

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2022-03-15 Thread Yury Selivanov


Yury Selivanov  added the comment:

Andrew, the same problem exists in asyncio.Queue which is also critical. Here's 
how I fixed it in edgedb code base: 
https://github.com/edgedb/edgedb/blob/08e41341024828df22a01cd690b11fcff00bca5e/edb/server/compiler_pool/queue.py#L51-L74

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
resolution:  -> fixed
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

https://bugs.python.org/issue45469 is similar. Thanks for the report, but I'll 
go ahead and close this.

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



[issue47030] singledispatch does not work with positional arguments with default values.

2022-03-15 Thread Randolf Scholz


New submission from Randolf Scholz :

from functools import singledispatch
from typing import Optional

@singledispatch
def load(key: Optional[str] = None, /) -> None:
raise NotImplementedError

@load.register
def _(key: None, /) -> None:
print(f"loaded {key=}") 

@load.register
def _(key: str, /) -> None:
print(f"loaded {key=}")

load()  # TypeError: load requires at least 1 positional argument

--
messages: 415274
nosy: randolf.scholz
priority: normal
severity: normal
status: open
title: singledispatch does not work with positional arguments with default 
values.
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry

Géry  added the comment:

I have attached the following patch: pass a reference to the reader end of the 
queue pipe to the queue thread so that the reader end is not garbage collected 
and closed before the queue thread has sent all the buffered data to the writer 
end.

--

___
Python tracker 

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



[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry

Change by Géry :


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

___
Python tracker 

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



[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry

New submission from Géry :

A `BrokenPipeError` exception is raised when the queue thread of a 
`multiprocessing.Queue` still sends enqueued items to the write end of the 
queue pipe *after* the read end of the queue pipe has been [automatically 
closed during its garbage 
collection](https://docs.python.org/3/library/socket.html#socket.socket.close) 
following the garbage collection of the queue (the write end of the queue pipe 
is not garbage collected because it is also referenced by the queue thread):

```
import multiprocessing

def main():
q = multiprocessing.Queue()
q.put(0)

if __name__ == '__main__':
main()
```

--
components: Library (Lib)
messages: 415272
nosy: maggyero
priority: normal
severity: normal
status: open
title: Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected
type: crash
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +30005
pull_request: https://github.com/python/cpython/pull/31912

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +30004
pull_request: https://github.com/python/cpython/pull/31911

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Closing this tonight, unless someone objects.

--
status: open -> pending

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Erlend E. Aasland

Erlend E. Aasland  added the comment:

Updating to SQLite 3.37 was backported because of a data corruption bug that 
was fixed. AFAIK, there’s nothing like that in 3.38. I would prefer waiting to 
see if more patch releases appear. (That was also my intent, given how many 
patch releases we saw with 3.35; I’ll start using the dont-merge label from now 
on.)

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:

I think we can hold off on deciding whether to backport until at least the next 
round of bugfix releases. I don't know of any pressing reason one way or the 
other, ATM.

--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Carl Meyer


Carl Meyer  added the comment:

Thanks for the extended example.

I think in order for this example to answer the question I asked, a few more 
assumptions should be made explicit:

1) Either `spam_var` and/or `eggs_var` are frequently re-bound to new values in 
a hot code path somewhere. (Given the observations above about module-level 
code, we should assume for a relevant example this takes place in a function 
that uses `global spam_var` or `global eggs_var` to allow such rebinding.)

2) But `spam_var` and `eggs_var` are not _read_ in any hot code path anywhere, 
because if they were, then the adaptive interpreter would be just as likely to 
decide to watch them as it is to watch `EGGS_CONST`, in which case any benefit 
of per-key watching in this example disappears. (Keep in mind that with 
possibly multiple watchers around, "unwatching" anything on the dispatch side 
is never an option, so we can't say that the adaptive interpreter would decide 
to unwatch the frequently-re-bound keys after it observes them being re-bound. 
It can  always "unwatch" them in the sense of no longer being interested in 
them in its callback, though.)

It is certainly possible that this case could occur, where some module contains 
both a frequently-read-but-not-written global and also a global that is 
re-bound using `global` keyword in a hot path, but rarely read. But it doesn't 
seem warranted to pre-emptively add a lot of complexity to the API in order to 
marginally improve the performance of this quite specific case, unsupported by 
any benchmark or sample workload demonstrating it.

> This might not be necessary for us right now

I think it's worth keeping in mind that `PyDict_WatchKey` API can always be 
added later without disturbing or changing semantics of the `PyDict_Watch` API 
added here.

--

___
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-03-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 099f75614100e88ed90b68d20a51a8d9c22f81a7 by Mark Shannon in 
branch 'main':
bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908)
https://github.com/python/cpython/commit/099f75614100e88ed90b68d20a51a8d9c22f81a7


--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:

Was there any reason/need to backport this?

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:


New changeset a8c728b8b742fd8ca5a225f79d99014794b8fdf3 by Mariusz Felisiak in 
branch 'main':
bpo-46907: Update Windows installer to SQLite 3.38.1. (GH-31655)
https://github.com/python/cpython/commit/a8c728b8b742fd8ca5a225f79d99014794b8fdf3


--

___
Python tracker 

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



[issue46817] Add a line-start table to the code object.

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:

sys.settrace line events cannot use the co_lines table. They need additional 
state, as we don't want to trace the same line twice (unless there is a 
backwards jump).

Using the start of a entry in `co_lines` doesn't work when some entries have no 
line number.
E.g.
list(co.co_lines):

(0, 2, 1)
(2, 4, None)
(4, 6, 1)

The instruction @ byte offset 4 starts an entry for line 1, but does not start 
line 1.

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2022-03-15 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +30003
pull_request: https://github.com/python/cpython/pull/31910

___
Python tracker 

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



[issue46817] Add a line-start table to the code object.

2022-03-15 Thread Irit Katriel


Irit Katriel  added the comment:

I can see the linestarts used in trace.py to figure out coverage. But for this 
duplications don't make a difference (they are deduped in _find_lines_from_code 
anyway), right? 

Where else are they used, such that the current scheme may not work?

--

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

There's an FAQ entry here: 
https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result

--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:

Let me give you an example.

#module eggs

eggs_var = 0 # a variable, maybe a counter or similar
EGGS_CONST # a constant

#module spam

import eggs

spam_var # Another variable

def foo():
use(eggs.EGGS_CONST)

-

We will want to treat `eggs.EGGS_CONST` as a constant.
To do that we need to be notified if `spam.eggs` or `eggs.EGGS_CONST` changes, 
but we do not want be notified whenever `spam.spam_var` or `eggs.eggs_var` 
changes.

This might not be necessary for us right now, but we will want to implement 
optimizations over larger regions than a single bytecode in 3.12.

--

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This is because i is not captured by the function definition. `lambda x: x**i` 
always makes the "input to the ith power" function, never the "input to the 3rd 
power" function, even if i happens to be 3 right now.

Consider replacing `lambda x: x**i` with `lambda x, i=i: x**i` to explicitly 
capture the current value of i as a default.

Changing the scoping rules now would be a big backwards-incompatible change.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset b43b9b49be7d42d2826106c719d1e51f0776be0a by Christian Heimes in 
branch 'main':
bpo-40280: Skip wakeup_fd pipe tests on Emscripten (GH-31909)
https://github.com/python/cpython/commit/b43b9b49be7d42d2826106c719d1e51f0776be0a


--

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 32ae9ab55f2cd97b5a28d5398c4820d8bc96f30c by Miss Islington (bot) 
in branch '3.9':
bpo-20392: Fix inconsistency with uppercase file extensions in 
mimetypes.guess_type (GH-30229)
https://github.com/python/cpython/commit/32ae9ab55f2cd97b5a28d5398c4820d8bc96f30c


--

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks!

--
resolution:  -> fixed
status:  -> closed

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30002
pull_request: https://github.com/python/cpython/pull/31909

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread John K.


New submission from John K. :

map(f, itr) is supposed to be the lazy way to do [f(val) for val in itr]. 
However, when unpacking and zipping a list of maps, I get a different result 
from when evaluating eagerly. More precisely:

Python 3.10.2 | packaged by conda-forge | (main, Mar  8 2022, 15:53:57) [GCC 
9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> maps = [map(lambda x: x**i, range(7)) for i in range(5)]
>>> for z in zip(*maps):
... print(z)
...
(0, 0, 0, 0, 0)
(1, 1, 1, 1, 1)
(16, 16, 16, 16, 16)
(81, 81, 81, 81, 81)
(256, 256, 256, 256, 256)
(625, 625, 625, 625, 625)
(1296, 1296, 1296, 1296, 1296)
>>> lists = [[x**i for x in range(7)] for i in range(5)]
>>> for z in zip(*lists):
... print(z)
...
(1, 0, 0, 0, 0)
(1, 1, 1, 1, 1)
(1, 2, 4, 8, 16)
(1, 3, 9, 27, 81)
(1, 4, 16, 64, 256)
(1, 5, 25, 125, 625)
(1, 6, 36, 216, 1296)

--
components: Interpreter Core
messages: 415256
nosy: khoodolphin
priority: normal
severity: normal
status: open
title: Incorrect behaviour when zipping a bunch of maps
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



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

2022-03-15 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30001
pull_request: https://github.com/python/cpython/pull/31908

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 64a68c39cb508b016e5a4486ebb4052f6e65fca0 by Miss Islington (bot) 
in branch '3.9':
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
https://github.com/python/cpython/commit/64a68c39cb508b016e5a4486ebb4052f6e65fca0


--

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 88c243fd8d5a43282ef06bd0872e3b88c68bb856 by Miss Islington (bot) 
in branch '3.10':
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
https://github.com/python/cpython/commit/88c243fd8d5a43282ef06bd0872e3b88c68bb856


--

___
Python tracker 

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



[issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd

2022-03-15 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Carl Meyer


Carl Meyer  added the comment:

> There should not be much of a slowdown for this code when watching `CONST`:

How and when (and based on what data?) would the adaptive interpreter make the 
decision that for this code sample the key `CONST`, but not the key `var`, 
should be watched in the module globals dict? It's easy to contrive an example 
in which it's beneficial to watch one key but not another, but this is 
practically irrelevant unless it's also feasible for an optimizer to 
consistently make the right decision about which key(s) to watch.

The code sample also suggests that the module globals dict for a module is 
being watched while that module's own code object is being executed. In module 
body execution, writing to globals (vs reading them) is relatively much more 
common, compared to any other Python code execution context, and it's much less 
common for the same global to be read many times. Given this, how frequently 
would watching module globals dictionaries during module body execution be a 
net win at all? Certainly cases can be contrived in which it would be, but it 
seems unlikely that it would be a net win overall. And again, unless the 
optimizer can reliably (and in advance, since module bodies are executed only 
once) distinguish the cases where it's a win, it seems the example is not 
practically relevant.

> Another use of this is to add watch points in debuggers.
> To that end, it would better if the callback were a Python object.

It is easy to create a C callback that delegates to a Python callable if 
someone wants to implement this use case, so the vectorcall overhead is paid 
only when needed. The core API doesn't need to be made more complex for this, 
and there's no reason to impose any overhead at all on low-level 
interpreter-optimization use cases.

--

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 3c4f24face4cca9256ae79bf6968663a04daf655 by Miss Islington (bot) 
in branch '3.10':
bpo-20392: Fix inconsistency with uppercase file extensions in 
mimetypes.guess_type (GH-30229)
https://github.com/python/cpython/commit/3c4f24face4cca9256ae79bf6968663a04daf655


--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:


New changeset ea786a882b9ed4261eafabad6011bc7ef3b5bf94 by Mariusz Felisiak in 
branch 'main':
bpo-46907: Update macOS installer to SQLite 3.38.1. (GH-31656)
https://github.com/python/cpython/commit/ea786a882b9ed4261eafabad6011bc7ef3b5bf94


--

___
Python tracker 

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



  1   2   >