[issue47105] [Doc] grp cites pwd.h instead of grp.h

2022-03-23 Thread Alex Hedges


Change by Alex Hedges :


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

___
Python tracker 

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



[issue47105] [Doc] grp cites pwd.h instead of grp.h

2022-03-23 Thread Alex Hedges


New submission from Alex Hedges :

The documentation page for the grp module says to "see ", even though 
the source code 
(https://github.com/python/cpython/blob/v3.11.0a6/Modules/grpmodule.c) uses 
grp.h.

I plan to release a PR for this shortly.

--
assignee: docs@python
components: Documentation
messages: 415924
nosy: aphedges, docs@python
priority: normal
severity: normal
status: open
title: [Doc] grp cites pwd.h instead of grp.h
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



[issue18241] Add unique option to heapq functions

2022-03-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue46864] Deprecate ob_shash in BytesObject

2022-03-23 Thread Inada Naoki


Inada Naoki  added the comment:

First of all, this is just deprecating direct access of `ob_shash`. This makes 
users need to use `PyObject_Hash()`.
We don't make the final decision about removing it. We just make we can remove 
it in Python 3.13.

RAM and CACHE efficiency is not the only motivation for this.
There is a discussion about (1) increasing CoW efficiency, and (2) sharing data 
between subinterpreters after per-interpreter GIL.
Removing ob_shash will help them, especially about the (2).

But if we stop using bytes objects in code objects by Python 3.13, there is no 
need to remove ob_shash.


> If put a bytes object into multiple dicts/sets, the hash need to be computed 
> multiple times. This seems a common usage.

Doesn't it lose only some milliseconds?
I posted remove-bytes-hash.patch in this issue. Would you measure how this 
affects whole application performance rather than micro benchmarks?

--

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-23 Thread Inada Naoki


Inada Naoki  added the comment:

I am not sure about we really need "locale encoding at Python startup".

For this issue, I don't want to change `encoding="locale"` behavior except 
ignore UTF-8 mode. So what I want is "current locale encoding" or 
 ANSI codepage on Windows.

On the other hand, I know Eryk wants to support locale on Windows. So 
`locale.get_encoding()` might return current locale encoding (not ANSI 
codepage) even on Windows.
If so, I will use `sys.getlocaleencoding()` to implement `encoding="locale"` to 
keep using ANSI codepage, instead of adding yet another "get locale encoding" 
function.

--
nosy: +eryksun

___
Python tracker 

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



[issue46480] Implement typing.assert_type

2022-03-23 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset 3354245daf89ca2c760c2c3e5b69a571f25073ed by Shantanu in branch 
'main':
bpo-46480: rephrase typing.assert_type docs (GH-32069)
https://github.com/python/cpython/commit/3354245daf89ca2c760c2c3e5b69a571f25073ed


--

___
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-03-23 Thread h-vetinari


Change by h-vetinari :


--
nosy: +h-vetinari

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Larry Hastings


Larry Hastings  added the comment:

> Performance wise... The SHA series have hardware acceleration on
> modern CPUs and SoCs.  External libraries such as OpenSSL are in a
> position to provide implementations that make use of that. Same with
> the Linux Kernel CryptoAPI (https://bugs.python.org/issue47102).
>
> Hardware accelerated SHAs are likely faster than blake3 single core.
> And certainly more efficient in terms of watt-secs/byte.

I don't know if OpenSSL currently uses the Intel SHA1 extensions.
A quick google suggests they added support in 2017.  And:

* I'm using a recent CPU that AFAICT supports those extensions.
  (AMD 5950X)
* My Python build with BLAKE3 support is using the OpenSSL implementation
  of SHA1 (_hashlib.openssl_sha1), which I believe is using the OpenSSL
  provided by the OS.  (I haven't built my own OpenSSL or anything.)
* I'm using a recent operating system release (Pop!_OS 21.10), which
  currently has OpenSSL version 1.1.1l-1ubuntu1.1 installed.
* My Python build with BLAKE3 doesn't support multithreaded hashing.
* In that Python build, BLAKE3 is roughly twice as fast as SHA1 for
  non-trivial workloads.

--

___
Python tracker 

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



[issue27165] Skip callables when displaying exception fields in cgitb

2022-03-23 Thread Irit Katriel


Irit Katriel  added the comment:

cgi/cgitb are deprecated as per PEP 594, so there won't be further enhancements 
to them.

--
nosy: +iritkatriel
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue29067] Source archive: wrong directory attributes

2022-03-23 Thread Irit Katriel


Irit Katriel  added the comment:

In 3.11 it is drwxr-xr-x.

--
nosy: +iritkatriel
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



[issue28080] Allow reading member names with bogus encodings in zipfile

2022-03-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Thanks Serhiy!

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue23578] struct.pack error messages do not indicate which argument was invalid

2022-03-23 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 3.7

___
Python tracker 

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



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-23 Thread Aaron Gallagher


Aaron Gallagher <_...@habnab.it> added the comment:

sigh.. adding myself to nosy here too in the hope that this gets any traction

--
nosy: +habnabit

___
Python tracker 

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



[issue45098] asyncio.CancelledError should contain more information on cancellations

2022-03-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

#46829 deprecates cancellation messages.
#46771 implements timeout context manager based on previously added 
cancellation counter and task.uncancel()

I think this issue should be closed.

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



[issue46771] Implement asyncio.timeout() context manager

2022-03-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
title: Add some form of cancel scopes -> Implement asyncio.timeout() context 
manager

___
Python tracker 

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



[issue47014] ProactorEventLoop ignores Ctrl+C after closing unrelated loop

2022-03-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread miss-islington


miss-islington  added the comment:


New changeset 9e1bfd8ce79b947dc0c1cfb4644e5afe337c2d07 by Miss Islington (bot) 
in branch '3.10':
bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase 
(GH-32086)
https://github.com/python/cpython/commit/9e1bfd8ce79b947dc0c1cfb4644e5afe337c2d07


--

___
Python tracker 

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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30175
pull_request: https://github.com/python/cpython/pull/32088

___
Python tracker 

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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +30174
pull_request: https://github.com/python/cpython/pull/32087

___
Python tracker 

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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread Andrew Svetlov


New submission from Andrew Svetlov :


New changeset ff619c7dfe8dcb0e4c8dc655abc3acc7dc586d0d by Andrew Svetlov in 
branch 'main':
bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase 
(GH-32086)
https://github.com/python/cpython/commit/ff619c7dfe8dcb0e4c8dc655abc3acc7dc586d0d


--

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 1b6acaad9a18b2498386c60f24351ab749061e3a by Christian Heimes in 
branch '3.10':
[3.10] bpo-47101: list only activated algorithms in 
hashlib.algorithms_available (GH-32076) (GH-32085)
https://github.com/python/cpython/commit/1b6acaad9a18b2498386c60f24351ab749061e3a


--

___
Python tracker 

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



[issue44306] asyncio.from_thread

2022-03-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

How is it better than passing the loop instance explicitly?
What is the real use case?

--

___
Python tracker 

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



[issue40320] Add ability to specify instance of contextvars context to Task() & asyncio.create_task()

2022-03-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Duplicate of #46994

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Accept explicit contextvars.Context in asyncio create_task() API

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread miss-islington


miss-islington  added the comment:


New changeset ec3589f59d2c8456591f33656639bcc303eb7bd5 by Miss Islington (bot) 
in branch '3.9':
bpo-47101: list only activated algorithms in hashlib.algorithms_available 
(GH-32076)
https://github.com/python/cpython/commit/ec3589f59d2c8456591f33656639bcc303eb7bd5


--

___
Python tracker 

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



[issue34014] loop.run_in_executor should propagate current contextvars

2022-03-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

contextvars and run_in_executor() cannot be used together with process executor.

asyncio.to_thread() runs with a copy of the current context.
Available since Python 3.9

https://docs.python.org/3/library/asyncio-task.html?highlight=to_thread#asyncio.to_thread

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

___
Python tracker 

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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-03-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
components: Tests, asyncio
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30172
pull_request: https://github.com/python/cpython/pull/32085

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30171
pull_request: https://github.com/python/cpython/pull/32084

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread miss-islington


miss-islington  added the comment:


New changeset 48e2010d92076b472922fa632fffc98ee150004f by Christian Heimes in 
branch 'main':
bpo-47101: list only activated algorithms in hashlib.algorithms_available 
(GH-32076)
https://github.com/python/cpython/commit/48e2010d92076b472922fa632fffc98ee150004f


--
nosy: +miss-islington

___
Python tracker 

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



[issue47061] Deprecate modules listed in PEP 594

2022-03-23 Thread miss-islington


miss-islington  added the comment:


New changeset e513b8188af4d2f43ab2b96b51bc45bd4f6fd5b6 by Hugo van Kemenade in 
branch '3.9':
[3.9] bpo-47061: document module deprecations due to PEP 594 (GH-31984) 
(GH-32082)
https://github.com/python/cpython/commit/e513b8188af4d2f43ab2b96b51bc45bd4f6fd5b6


--

___
Python tracker 

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



[issue47103] Copy pgort140.dll when building for PGO

2022-03-23 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue47103] Copy pgort140.dll when building for PGO

2022-03-23 Thread Steve Dower


New submission from Steve Dower :

Rather than trying to set up PATH properly, we should just copy pgort140.dll 
into the build directory when building instrumented version.

This becomes more important for those (i.e. me) building and then manually 
running the profile stage on a different machine.

--
assignee: steve.dower
components: Build, Windows
messages: 415905
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Copy pgort140.dll when building for PGO
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-23 Thread Christian Heimes


Christian Heimes  added the comment:

And sendfile() is zero-copy. Data does not have to leave Kernel space.

--

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-23 Thread Christian Heimes


Christian Heimes  added the comment:

test_socket has examples for HMAC, AES-CBC, and AES-GCM.

with self.create_alg('hash', 'hmac(sha1)') as algo:
algo.setsockopt(socket.SOL_ALG, socket.ALG_SET_KEY, b"Jefe")
op, _ = algo.accept()
with op:
op.sendall(b"what do ya want for nothing?")
self.assertEqual(op.recv(512), expected)

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Rust based anything comes with a baseline level of Rust code overhead. 
https://stackoverflow.com/questions/29008127/why-are-rust-executables-so-huge

That seems expected.

--

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Neat. I've never used the API, just filing a breadcrumb suggesting we see if it 
makes sense. Being I/O based, that even takes care of GIL releasing from 
Python. :)

--

___
Python tracker 

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



[issue47061] Deprecate modules listed in PEP 594

2022-03-23 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
pull_requests: +30169
pull_request: https://github.com/python/cpython/pull/32082

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Here's a wheel which only includes the portable code (I disabled
all the special cases as you suggested).

Archive:  dist/blake3_experimental_c-0.0.1-cp310-cp310-linux_x86_64.whl
  Length  DateTimeName
-  -- -   
   297680  2022-03-23 19:26   blake3.cpython-310-x86_64-linux-gnu.so
 3183  2022-03-23 19:26   blake3_experimental_c-0.0.1.dist-info/METADATA
  105  2022-03-23 19:26   blake3_experimental_c-0.0.1.dist-info/WHEEL
7  2022-03-23 19:26   
blake3_experimental_c-0.0.1.dist-info/top_level.txt
  451  2022-03-23 19:26   blake3_experimental_c-0.0.1.dist-info/RECORD
- ---
   301426 5 files

I didn't run any benchmarks, but it's clear that the SIMD code was
used in my initial build and this adds some 50kB to the .so file.
This is on a older Linux x64 box with Intel i7-4770k CPU.

Could be that the Rust version adds several such SIMD variants and
then branches based on the platform running the code.

In any case, the C extension is indeed very easy to build and
install with a standard compiler setup.

--

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-23 Thread Christian Heimes


Christian Heimes  added the comment:

We don't need libkcapi. I added AF_ALG support a while ago:

import binascii
import os
import socket

with socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0) as cfgsock:
cfgsock.bind(("hash", "sha256"))
opsock, _ = cfgsock.accept()
with opsock:
with open("/etc/os-release") as f:
st = os.fstat(f.fileno())
# blindly assumes that sendfile() exhausts the fd.
os.sendfile(
opsock.fileno(), f.fileno(), offset=0, count=st.st_size
)
res = opsock.recv(512)
print(binascii.hexlify(res))

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Performance wise... The SHA series have hardware acceleration on modern CPUs 
and SoCs.  External libraries such as OpenSSL are in a position to provide 
implementations that make use of that. Same with the Linux Kernel CryptoAPI 
(https://bugs.python.org/issue47102).

Hardware accelerated SHAs are likely faster than blake3 single core. And 
certainly more efficient in terms of watt-secs/byte.

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

To anyone else who comes along with motivation:

I'm fine with blake3 being in hashlib, but I don't want us to guarantee it by 
carrying the implementation of the algorithm in the CPython codebase itself 
unless it gains wide industry standard-like adoption status.

We should feel free to link to both the Rust blake3 and C blake3-py packages 
from the hashlib docs regardless.

--

___
Python tracker 

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



[issue47102] explore hashlib use of the Linux Kernel CryptoAPI

2022-03-23 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Linux kernels provide a CryptoAPI. This is a common place for platform specific 
hardware accelerated hash algorithms to be exposed to the user (especially on 
SoCs which often have non-standard hardware).

https://www.kernel.org/doc/html/v4.10/crypto/userspace-if.html
https://www.kernel.org/doc/html/v5.17/crypto/userspace-if.html
https://www.chronox.de/libkcapi.html

hashlib currently uses OpenSSL when possible for performance.  We could also 
look at querying the kernel API.  How to decide between the two implementations 
when both are present is something TBD.

This would probably be best done via a configure time check for libkcapi?

--
messages: 415896
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
status: open
title: explore hashlib use of the Linux Kernel CryptoAPI
type: enhancement

___
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-03-23 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
pull_requests: +30168
pull_request: https://github.com/python/cpython/pull/32081

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Larry Hastings


Larry Hastings  added the comment:

I can't answer why the Rust one is so much larger--that's a question for Jack.  
But the blake3-py you built might (should?) have support for SIMD extensions.  
See the setup.py for how that works; it appears to at least try to use the SIMD 
extensions on x86 POSIX (32- and 64-bit), x86_64 Windows, and 64-bit ARM POSIX.

If you were really curious, you could run some quick benchmarks, then hack your 
local setup.py to not attempt adding support for those (see "portable code 
only" in setup.py) and do a build, and run your benchmarks again.  If BLAKE3 
got a lot slower, yup, you (initially) built it with SIMD extension support.

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

With "lean" I meant: doesn't use much code and is easy to compile
and install.

I built a wheel from Jack's experimental package and it comes out to
just under 100kB on Linux x64, compared to around the 1.1MB the
Rust wheel needs:

Archive:  blake3_experimental_c-0.0.1-cp310-cp310-linux_x86_64.whl
  Length  DateTimeName
-  -- -   
   348528  2022-03-23 18:38   blake3.cpython-310-x86_64-linux-gnu.so
 3183  2022-03-23 18:38   blake3_experimental_c-0.0.1.dist-info/METADATA
  105  2022-03-23 18:38   blake3_experimental_c-0.0.1.dist-info/WHEEL
7  2022-03-23 18:38   
blake3_experimental_c-0.0.1.dist-info/top_level.txt
  451  2022-03-23 18:38   blake3_experimental_c-0.0.1.dist-info/RECORD
- ---
   352274 5 files

Archive:  blake3-0.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  Length  DateTimeName
-  -- -   
 3800  2022-01-13 01:26   blake3-0.3.1.dist-info/METADATA
  133  2022-01-13 01:26   blake3-0.3.1.dist-info/WHEEL
   48  2022-01-13 01:26   blake3/__init__.py
  4195392  2022-01-13 01:26   blake3/blake3.cpython-310-x86_64-linux-gnu.so
  382  2022-01-13 01:26   blake3-0.3.1.dist-info/RECORD
- ---
  4199755 5 files

I don't know why there is such a significant difference in size. Perhaps
the Rust version includes multiple variants for different CPU
optimizations ?!

--

___
Python tracker 

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



[issue46769] Improve documentation for `typing.TypeVar`

2022-03-23 Thread Alex Waygood

Alex Waygood  added the comment:

Thanks Guido for your insight, and Jelle/Łukasz for the reviews and backports!

I'm on holiday right now, but when I'm back, I'll take a look at maybe 
proposing some minor revisions to PEP 484 as well, as Guido suggests.

--

___
Python tracker 

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



[issue46769] Improve documentation for `typing.TypeVar`

2022-03-23 Thread Jelle Zijlstra

Jelle Zijlstra  added the comment:

Thanks Alex for the PR and Łukasz for merging the last backport!

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



[issue46964] The global config should not be stored on each interpreter

2022-03-23 Thread STINNER Victor


STINNER Victor  added the comment:

> thus far we have had no actual use cases for initializing an interpreter
>  with a different config

I don't think that sub-interpreters should have 
config.install_signal_handlers=1. Same for config.configure_c_stdio=1. Only the 
main interpreter should handle signals and the configuration of C streams 
(stdio, stderr, stdio).

I added _PyInterpreterState_SetConfig() to experiment changing 
config.bytes_warning. But this is no strong need to have an API to change it, 
so right now, there is still no API for that. If we allow to change it, it 
would be surprising to change all interpreters at once.

I don't see why config.argv (sys.argv) must be the same in all interpreters. 
Same for config.module_search_paths (sys.path).

For me, it makes sense to have a per-interpreter value for most PyConfig 
options.

> * there is no API for creating an interpreter with a different config

There is _Py_NewInterpreter(int isolated_subinterpreter) to set 
config.config._isolated_interpreter. But since the feature is not "official", 
it remains a private API.


> currently, every interpreter uses (a copy of) the original PyConfig,
> completely unchanged

Currently, it's possible to call Py_InitializeFromConfig() (or Py_Initialize()) 
multiple times and it changes the PyConfig of the current interpreter. See the 
pyinit_core_reconfigure() function. _testembed has an unit test for that: I had 
to implement this feature. Once, calling the function multiple times and it 
broke an application. See bpo-34008.

--

___
Python tracker 

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



[issue46769] Improve documentation for `typing.TypeVar`

2022-03-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 0bbb6956f83ef457872b8f04242bb02b6898350d by Jelle Zijlstra in 
branch '3.9':
[3.9] bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712) 
(GH-31941) (GH-32067)
https://github.com/python/cpython/commit/0bbb6956f83ef457872b8f04242bb02b6898350d


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Larry Hastings


Larry Hastings  added the comment:

The Rust version is already quite "lean".  And it can be much faster than the C 
version, because it supports internal multithreading.  Even without 
multithreading I bet it's at least a hair faster.

Also, Jack has independently written a Python package based around the C 
version:

  https://github.com/oconnor663/blake3-py/tree/master/c_impl

so my making one would be redundant.

I have no interest in building standalone BLAKE3 PyPI packages for Raspberry Pi 
or Android.  My goal was for BLAKE3 to be one of the "included batteries" in 
Python--which would have meant it would, eventually, be available on the 
Raspberry Pi and Android builds that way.

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 23.03.2022 17:53, Larry Hastings wrote:
> 
> Ok, I give up.

Sorry to spoil the fun, but there's no need to throw
everything in the bin ;-)

A lean and fast blake3 C package would still be a great thing
to have on PyPI, e.g. provide support for platforms, which
Jack's blake3 Rust package doesn't cover, e.g.

Raspis:
https://www.piwheels.org/project/blake3/

Android (e.g. via termux):
https://wiki.termux.com/wiki/Main_Page
https://wiki.termux.com/wiki/Python

etc.

--

___
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-03-23 Thread Jeremy Kloth


Change by Jeremy Kloth :


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

___
Python tracker 

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



[issue31582] Add _pth breadcrumb to sys.path documentation

2022-03-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset c62b944dfc98911a5050389fa6ac753e283fee1f by Russel Webber in 
branch 'main':
bpo-31582: Created a new documentation section describing sys.path 
initialization (GH-31082)
https://github.com/python/cpython/commit/c62b944dfc98911a5050389fa6ac753e283fee1f


--

___
Python tracker 

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



[issue33028] [doc] tempfile.TemporaryDirectory documentation improvements

2022-03-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-23 Thread Géry

Géry  added the comment:

Apologies for the long delay.

> Do we have any meaningful examples to show that this is desired and useful?

A use case of `super()` in a `classmethod` that comes to mind is for 
parameterized factory methods. It is a variation of the classic factory method 
design pattern that lets the factory method of a creator creates *multiple* 
products according to a parameter identifying the product to create. Overriding 
the factory method lets you change or extend the products that are created, by 
mapping existing identifiers to different products or introducing new 
identifiers for new products (cf. GoF’s book *Design Patterns*, section 
‘Factory Method’, subsection ‘Implementation’, paragraph 2):

```
>>> class MyCreator:
... @classmethod
... def make(cls, product_id):
... if product_id == 'mine': return MyProduct(creator=cls)
... if product_id == 'yours': return YourProduct(creator=cls)
... if product_id == 'theirs': return TheirProduct(creator=cls)
... raise ValueError('product_id {!r} not supported'.format(product_id))
... 
>>> class YourCreator(MyCreator):
... @classmethod
... def make(cls, product_id):
... if product_id == 'mine': return YourProduct(creator=cls)
... if product_id == 'yours': return MyProduct(creator=cls)
... return super(YourCreator, cls).make(product_id)
... 
>>> class BaseProduct:
... def __init__(self, creator): self._creator = creator
... def __repr__(self):
... return '{}(creator={})'.format(
... type(self).__name__, self._creator.__name__)
... 
>>> class MyProduct(BaseProduct): pass
... 
>>> class YourProduct(BaseProduct): pass
... 
>>> class TheirProduct(BaseProduct): pass
... 
>>> MyCreator.make('mine')
MyProduct(creator=MyCreator)
>>> YourCreator.make('mine')
YourProduct(creator=YourCreator)
```

--

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Larry Hastings


Larry Hastings  added the comment:

Ok, I give up.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-03-23 Thread Itamar Ostricher


Change by Itamar Ostricher :


--
nosy: +itamaro

___
Python tracker 

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



[issue33028] [doc] tempfile.TemporaryDirectory documentation improvements

2022-03-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +30166
pull_request: https://github.com/python/cpython/pull/32077

___
Python tracker 

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



[issue47086] Include HTML docs with Windows installer instead of CHM

2022-03-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset fe010605f87f988ef1053e372d1c3898d2633d96 by Steve Dower in branch 
'main':
bpo-47086: Remove dead link to old CHM documentation (GH-32075)
https://github.com/python/cpython/commit/fe010605f87f988ef1053e372d1c3898d2633d96


--

___
Python tracker 

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



[issue33028] [doc] tempfile.TemporaryDirectory documentation improvements

2022-03-23 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel
nosy_count: 5.0 -> 6.0
pull_requests: +30165
pull_request: https://github.com/python/cpython/pull/32078

___
Python tracker 

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



[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-03-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

Fixed by deprecating the message argument to cancel(). It will be removed in 
3.13.

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



[issue46712] Share global string identifiers in deepfreeze

2022-03-23 Thread Eric Snow


Eric Snow  added the comment:


New changeset febf54bcf3fdc45ad84b4073e24bbaaee0ac8b2a by Eric Snow in branch 
'main':
bpo-46712: Do not Regen Deep-Frozen Modules before Generating Global Objects 
(gh-32061)
https://github.com/python/cpython/commit/febf54bcf3fdc45ad84b4073e24bbaaee0ac8b2a


--

___
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-03-23 Thread Eric Snow


Eric Snow  added the comment:


New changeset 21412d037b07c08266e96dfd0c0e44a1b7693bc1 by Eric Snow in branch 
'main':
bpo-46541: Add a Comment About When to Use _Py_DECLARE_STR(). (gh-32063)
https://github.com/python/cpython/commit/21412d037b07c08266e96dfd0c0e44a1b7693bc1


--

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread Christian Heimes


Christian Heimes  added the comment:

$ ./python Tools/ssl/multissltests.py --openssl 3.0.2 --steps modules
$ ./python -c "import hashlib; print(hashlib.algorithms_available)"
{'blake2b', 'sha512', 'sm3', 'shake_128', 'md5', 'sha3_256', 'sha224', 
'sha512_224', 'sha3_384', 'sha384', 'md5-sha1', 'sha3_224', 'shake_256', 
'sha3_512', 'sha512_256', 'sha1', 'sha256', 'blake2s'}

--

___
Python tracker 

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



[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-03-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 0360e9f34659e7d7f3dae021b82f78452db8c714 by Andrew Svetlov in 
branch 'main':
bpo-46829: Deprecate passing a message into Future.cancel() and Task.cancel() 
(GH-31840)
https://github.com/python/cpython/commit/0360e9f34659e7d7f3dae021b82f78452db8c714


--

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread Christian Heimes


Christian Heimes  added the comment:

Hubert's suggested solution EVP_MD_do_all_provided() worked almost straight 
forward. The function signature is a bit different and I got "undefined" in the 
result set. Filtering out NID_undef got right of it.

--

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue47101] hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider

2022-03-23 Thread Christian Heimes


New submission from Christian Heimes :

Hubert Kario wrote in https://bugzilla.redhat.com/show_bug.cgi?id=2054702

Description of problem:
The hashlib.algorithms_available set includes algorithms like ripemd160 and 
whirlpool, those algorithms are not usable unless openssl legacy provider is 
loaded. Since it's not loaded, and the hashlib module won't load it, any 
attempt to use them fails.

Version-Release number of selected component (if applicable):
python3-3.9.10-1.el9.x86_64
openssl-3.0.1-5.el9.x86_64

How reproducible:
always

Steps to Reproduce:
0. start python3
1. from hashlib import algorithms_available 
2. algorithms_available
3. import hashlib
4. a = {(name, hashlib.new(name).digest_size) for name in algorithms_available}

Actual results:
{'sha3_384', 'blake2s', 'sha384', 'sha512_224', 'md5', 'sha3_512', 'md5-sha1', 
'sha3_256', 'shake_128', 'sm3', 'sha256', 'sha512', 'sha1', 'shake_256', 
'blake2b', 'whirlpool', 'sha512_256', 'sha3_224', 'sha224', 'ripemd160', 'md4'}

Traceback (most recent call last):
  File "/usr/lib64/python3.9/hashlib.py", line 164, in __hash_new
return _hashlib.new(name, data, **kwargs)
ValueError: [digital envelope routines] unsupported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
  File "/usr/lib64/python3.9/hashlib.py", line 170, in __hash_new
return __get_builtin_constructor(name)(data)
  File "/usr/lib64/python3.9/hashlib.py", line 127, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type whirlpool


Expected results:
{'sha3_384', 'blake2s', 'sha384', 'sha512_224', 'md5', 'sha3_512', 'md5-sha1', 
'sha3_256', 'shake_128', 'sm3', 'sha256', 'sha512', 'sha1', 'shake_256', 
'blake2b', 'sha512_256', 'sha3_224', 'sha224'}

{('blake2b', 64), ('sha512', 64), ('md5-sha1', 36), ('sha3_512', 64), ('md5', 
16), ('sha224', 28), ('shake_128', 0), ('sm3', 32), ('blake2s', 32), ('sha1', 
20), ('shake_256', 0), ('sha512_256', 32), ('sha3_224', 28), ('sha3_256', 32), 
('sha3_384', 48), ('sha384', 48), ('sha256', 32), ('sha512_224', 28)}

Additional info:
If the legacy provider is loaded, then the algorithms should be listed and 
should work.

It may be caused by Python using the deprecated EVP_MD_do_all() method instead 
of the EVP_MD_do_all_provided() method

--
components: Extension Modules, Library (Lib)
messages: 415877
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: hashlib.algorithms_available lists algorithms that are not available in 
OpenSSL 3.0 default provider
type: behavior
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



[issue28080] Allow reading member names with bogus encodings in zipfile

2022-03-23 Thread Stephen J. Turnbull


Stephen J. Turnbull  added the comment:

I'm not going to have time to look at the PR for a couple days.

I don't understand what the use case is for writing or appending with filenames 
in a non-UTF-8 encoding.  At least in my experience, reading such files is 
rare, but I have never been asked to write one.  The correspondents who send me 
zipfiles with the directory encoded in shift_jisx0213 are perfectly happy to 
read zipfiles with the directory encoded in UTF-8.

If that is true for other users, then unzipping the file to a temporary 
directory with the appropriate --metadata-encoding, adding the required paths 
there, and zipping a new archive seems perfectly workable.  In that case making 
this feature read-only makes the most sense to me.

--

___
Python tracker 

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



[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

It's possible my bad experience may have been avoided through issue35905.

--

___
Python tracker 

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



[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Aha. If I configure/make without LDFLAGS or CPPFLAGS set, compilation works. 
Then I noticed for `LDFLAGS`, some users were using `-L`. I thought it was 
slightly odd that my recipe was using `-I` for both flags. How is it that [this 
mistake](https://github.com/jaraco/jaraco.develop/commit/6469c7a61e7349b93f191df38eed6cd020dd79be)
 hasn't caused me any grief until M1 build?  No matter - correcting for that 
mistake and passing the correct LDFLAGS flag (-L) corrects for the issue.

--
status: open -> closed

___
Python tracker 

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



[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

As suggested, I uninstalled and reinstalled everything in homebrew:

$ brew list | xargs brew remove
$ brew install python@3.10 python-launcher python@3.9 python@3.8 gh git

Even after following those steps and setting LDFLAGS and CPPFLAGS to point to 
`brew --prefix`, the errors continue when running `./configure; make` in a 
clean checkout.

--

___
Python tracker 

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



[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-23 Thread Irit Katriel


Irit Katriel  added the comment:

You don't need sys.exc_info() for the traceback anymore.

except Exception as e:
raise OSError('blah').with_traceback(e.__traceback__)

--
nosy: +iritkatriel

___
Python tracker 

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



[issue46975] clang: error: linker command failed with exit code 1 (use -v to see invocation) on m1 mac

2022-03-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I did [this 
search](https://www.google.com/search?q=gittext+homebrew+"ld%3A+symbol(s)+not+found+for+architecture+arm64"),
 which surfaced a few related results.

[This 
article](https://lifesaver.codes/answer/pyenv-arm64-builds-confused-by-x86-64-libintl-in-usr-local-1877)
 seemed promising, but the symptoms there are different than mine. I don't have 
any gettext libs showing up in /usr/local (only in /opt/homebrew as expected).

I noticed [this 
comment](https://github.com/pyenv/pyenv/issues/1877#issuecomment-976583556) 
reports the same issue I have, but no solution is present.

I saw a suggestion to [set 
FLAGS](https://github.com/pyenv/pyenv/issues/1877#issuecomment-836115970), but 
I do that [as a matter of 
course](https://github.com/jaraco/jaraco.develop/blob/d3e524362ba15f87790f4c6279b1f92c06901387/jaraco/develop/macos-build-python.py#L38-L42).

I don't have an x86 install of homebrew. This machine is less than a month old 
and has had ARM-based homebrew installed from the beginning.

I'll keep investigating.

--

___
Python tracker 

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



[issue46126] Unittest output drives developers to avoid docstrings

2022-03-23 Thread Éric Araujo

Éric Araujo  added the comment:

I think the situation and the discussion should be summarized on python-dev!

--

___
Python tracker 

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



[issue47100] Help text for Store Python shows "null" under usage

2022-03-23 Thread Steve Dower


New submission from Steve Dower :

C:\> python3.11 -h 
usage: (null) [option] ... [-c cmd | -m mod | file | -] [arg] ...  
Options and arguments (and corresponding environment variables):   
...

Should not show "(null)" there

--
components: Windows
messages: 415869
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Help text for Store Python shows "null" under usage
type: behavior
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



[issue46836] [C API] Move PyFrameObject to the internal C API

2022-03-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b0f886d1bca499db1118a60b707923fa8e157073 by Victor Stinner in 
branch 'main':
bpo-46836: Add Doc/c-api/frame.rst (GH-32051)
https://github.com/python/cpython/commit/b0f886d1bca499db1118a60b707923fa8e157073


--

___
Python tracker 

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



[issue47095] Prefer libb2 over vendored copy of blake2

2022-03-23 Thread Christian Heimes


Change by Christian Heimes :


--
title: Deprecate blake2's tree hashing feature -> Prefer libb2 over vendored 
copy of blake2

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-23 Thread STINNER Victor


STINNER Victor  added the comment:

sys.getlocaleencoding() versus locale.getencoding().

For me, the Python locale module should use the C API to access the Unix 
locales like LC_CTYPE, nl_langinfo(CODESET), etc.

The sys module are more for things specific to Python, like 
sys.getfilesystemencoding().

Since sys.getlocaleencoding() would be a fixed value for the whole process life 
time, I agree that the sys module is a better place.

I can write a PR adding sys.getlocaleencoding() if we agree on the API.

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-03-23 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue47086] Include HTML docs with Windows installer instead of CHM

2022-03-23 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30163
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/32075

___
Python tracker 

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



[issue47086] Include HTML docs with Windows installer instead of CHM

2022-03-23 Thread Steve Dower


Steve Dower  added the comment:

This should work for you (luckily, this is about the simplest possible case):

import sys
import winreg

def get_help():
KEY = rf"Software\Python\PythonCore\{sys.winver}\Help\Main Python 
Documentation"
try:
return winreg.QueryValue(winreg.HKEY_CURRENT_USER, KEY)
except FileNotFoundError:
pass
try:
return winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, KEY)
except FileNotFoundError:
pass
return 
f"https://docs.python.org/{sys.version_info.major}.{sys.version_info.minor}/;

--

___
Python tracker 

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



[issue46864] Deprecate ob_shash in BytesObject

2022-03-23 Thread Ma Lin


Ma Lin  added the comment:

If put a bytes object into multiple dicts/sets, the hash need to be computed 
multiple times. This seems a common usage.

bytes is a very basic type, users may use it in various ways. And unskilled 
users may checking the same bytes object against dicts/sets many times.

FYI, 1 GiB data:

function seconds
hash()   0.40
binascii.crc32() 1.66   (Gregory P. Smith is trying to improve this)
zlib.crc32() 0.65

--

___
Python tracker 

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



[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-23 Thread Oleg Iarygin


Change by Oleg Iarygin :


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

___
Python tracker 

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



[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-23 Thread Oleg Iarygin


New submission from Oleg Iarygin :

Currently, exception chaining in Lib/ modules is implemented with pre-3.11 
`raise Foo(...).with_traceback(sys.exc_info()[2])`. However, this approach can 
be simplified:

1. PEP 3134 introduced a proper `raise Foo(...) from bar` construction that 
takes a parent exception instead of its stack traceback

2. Without the traceback required, we partially get rid of `sys.exc_info` thus 
reducing active tapping into global internals

A report printed into a console remains the same except a line:

> During handling of the above exception, another exception occurred

replaced with:

> The above exception was the direct cause of the following exception

--
components: Library (Lib)
messages: 415864
nosy: arhadthedev
priority: normal
severity: normal
status: open
title: Replace with_traceback() with exception chaining and reraising
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue39298] add BLAKE3 to hashlib

2022-03-23 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 23.03.2022 02:12, Gregory P. Smith wrote:
> 
> I view the NIST standard hashes as important enough to attempt to guarantee 
> as present (all the SHAs and MD5) as built-in. Others should really 
> demonstrate practical application popularity to gain included battery status 
> rather than just using PyPI.

+1 on this. I also think the topic deserves a wider discussion.

IMO, Python's stdlib should only provide a basic set of hash algorithms
and not try to add every single new algorithm out there.

PyPI is a much better way to add support for new hash algorithms,
can move much faster than the stdlib, provide specialized builds for
added performance and also add exotic features, which are not always
needed.

Here's the list of Python 3.10 algos on a typical Linux system:

>>> hashlib.algorithms_available
{'sha512_256', 'mdc2', 'md5-sha1', 'md4', 'ripemd160', 'shake_128', 'sha3_384',
'blake2s', 'sha3_512', 'sha3_256', 'sha256', 'sha1', 'sm3', 'sha512_224',
'whirlpool', 'sha384', 'shake_256', 'sha224', 'sha512', 'sha3_224', 'md5',
'blake2b'}

This already is more than enough. Since we're using OpenSSL in Python
anyway, exposing some of the often used algos from OpenSSL is fine,
since it doesn't add much extra bloat. The above list already goes
way beyond this, IMO.

The longer the list gets, the more confusion it causes among users,
since Python's stdlib doesn't provide any guidance on
basic questions such as "Which hash algo should I use for my
application".

Most applications today will only need these basic hash algos:

{'ripemd160', 'sha3_512', 'sha3_256', 'sha256', 'sha1', 'sha512', 'md5'}

--
nosy: +lemburg

___
Python tracker 

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



[issue13011] Frozen programs require the original build directory in order to run.

2022-03-23 Thread Irit Katriel


Irit Katriel  added the comment:

Closing, please reopen or create a new issue if this is still a problem after 
all these years.

--
stage: needs patch -> 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



[issue47098] sha3: Replace Keccak Code Package with tiny_sha3

2022-03-23 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs

2022-03-23 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +30160
pull_request: https://github.com/python/cpython/pull/32073

___
Python tracker 

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



[issue47098] sha3: Replace Keccak Code Package with tiny_sha3

2022-03-23 Thread Christian Heimes


New submission from Christian Heimes :

The Keccak Code Package (kcp) provides the reference implementation for SHA3 
and SHAKE hashing algorithms. CPython has vendored a copy of KCP since I added 
SHA3 in 3.6.

CPython 3.10 and newer require OpenSSL >= 1.1.1, which provide an optimized 
implementation of SHA3 and SHAKE on all platforms. The vast majority of users 
now use SHA3 from OpenSSL instead our _sha3 module with KCP. Both the KCP and 
_sha3 module are large. The KCP has 230kB of code. The _sha3 shared library is 
390kB on Linux X86_64, stripped 90kB.

I would like to reduce the size of our bundled code. Since SHA3 and SHAKE are 
listed in hashlib.algorithms_guaranteed and OpenSSL is optional, we cannot just 
drop the _sha3 module. Instead I propose to replace the implementation with 
tiny_sha3 https://github.com/mjosaarinen/tiny_sha3 . The tiny implementation is 
13 kB of code. The resulting _sha3 shared library is 69 kB (stripped 25 kB).

A Python build without OpenSSL bindings will have a working but slower SHA3 
implementation.

--
assignee: christian.heimes
components: Extension Modules
messages: 415861
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
status: open
title: sha3: Replace Keccak Code Package with tiny_sha3
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-03-23 Thread Julien Palard


Julien Palard  added the comment:


New changeset ec8906fb5930b1f078e2a2170cdf445e6c6faf57 by Julien Palard in 
branch 'main':
bpo-42238: [doc] Some lines moved in rst, but had hardcoded lineno in 
susp-ignored.csv. (GH-32070)
https://github.com/python/cpython/commit/ec8906fb5930b1f078e2a2170cdf445e6c6faf57


--

___
Python tracker 

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



[issue47012] Speed up iteration of bytes and bytearray

2022-03-23 Thread Kumar Aditya


Change by Kumar Aditya :


--
components: +Interpreter Core
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs

2022-03-23 Thread Kumar Aditya


Kumar Aditya  added the comment:

@asvetlov Do you have any insight for this issue?

--

___
Python tracker 

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



[issue47012] Speed up iteration of bytes and bytearray

2022-03-23 Thread Dennis Sweeney


Dennis Sweeney  added the comment:


New changeset bd1cf6ecee76bcdce87b4f69567b95756ecf5a4c by Kumar Aditya in 
branch 'main':
bpo-47012: speed up iteration of bytes and bytearray (GH-31867)
https://github.com/python/cpython/commit/bd1cf6ecee76bcdce87b4f69567b95756ecf5a4c


--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue46864] Deprecate ob_shash in BytesObject

2022-03-23 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 894d0ea5afa822c23286e9e68ed80bb1122b402d by Inada Naoki in branch 
'main':
bpo-46864: Suppress deprecation warnings for ob_shash. (GH-32042)
https://github.com/python/cpython/commit/894d0ea5afa822c23286e9e68ed80bb1122b402d


--

___
Python tracker 

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



[issue34861] Improve cProfile standard output

2022-03-23 Thread Daniël van Noord

Daniël van Noord  added the comment:

I have resubmitted the patch that changes the default sorting order in 
https://github.com/python/cpython/pull/31929 as it was asked to separate that 
from the original patch by Anders.

I also added documentation changes that follow from changing the default 
sorting order.

--
nosy: +danielnoord

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2022-03-23 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +30159
pull_request: https://github.com/python/cpython/pull/32070

___
Python tracker 

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



  1   2   >