[issue46864] Deprecate ob_shash in BytesObject

2022-03-22 Thread Inada Naoki


Inada Naoki  added the comment:

Average RAM capacity doesn't grow as CPU cores grows.
Additionally, L1+L2 cache is really limited resource compared to CPU or RAM.

Bytes object is used for co_code that is hot. So cache efficiency is important.

Would you give us more realistic (or real world) example for caching bytes hash 
is important?

--

___
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-22 Thread Ma Lin


Ma Lin  added the comment:

RAM is now relatively cheaper than CPU.
1 million bytes object additionally use 7.629 MiB RAM for ob_shash. 
(100_*8/1024/1024).
This causes hash() performance regression anyway.

--

___
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-22 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +30157
pull_request: https://github.com/python/cpython/pull/32068

___
Python tracker 

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



[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2022-03-22 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I was close to merging the linked PR but there's some renewed concerns about 
the proposed behavior here: Do we really want to change this behavior and 
potentially force a lot of people to change their working code?

In addition, the current code emits FutureWarning. I don't really understand 
what that warning is supposed to be used for 
(https://docs.python.org/3/library/exceptions.html#FutureWarning), but at least 
it means we plan to change the behavior later. So we should have a plan for how 
we'll do that. And whatever we do, the Python and C versions of the code should 
behave consistently.

Here are two ways forward:

(1) We change both the Python and the C versions of ElementTree to emit a 
DeprecationWarning on using __bool__ in 3.11. In 3.13, we change the behavior 
to make __bool__ always return True. (Or perhaps, make it raise an exception.)

(2) We give up on changing this behavior and remove the existing FutureWarning 
from the Python code. But in that case we should document the gotcha in the 
boolean behavior of nodes.

I don't have enough experience with ElementTree to recommend either option, but 
I'm happy to help implement it once we come to a decision.

--
nosy: +JelleZijlstra
versions: +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



[issue46769] Improve documentation for `typing.TypeVar`

2022-03-22 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +30156
pull_request: https://github.com/python/cpython/pull/32067

___
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-22 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:


New changeset d5ed8a8258eaf7a241978b1b0aeb971108d0f7e0 by Alex Waygood in 
branch '3.10':
[3.10] bpo-46769: Improve documentation for `typing.TypeVar` (GH-31712) 
(GH-31941)
https://github.com/python/cpython/commit/d5ed8a8258eaf7a241978b1b0aeb971108d0f7e0


--

___
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-22 Thread Inada Naoki


Inada Naoki  added the comment:

> * sys.getfilesystemencoding(): Python filesystem encoding, return "UTF-8" if 
> the Python UTF-8 Mode is enabled

Yes, althoguh PYTHONLEGACYWINDOWSFSENCODING takes priority.


> * locale.getencoding(): Get the locale encoding, LC_CTYPE locale encoding or 
> the Windows ANSI code page, *read at Python startup*. Ignore the Python UTF-8 
> Mode.

I proposed `locale.get_encoding()` in the PEP 686. I will remove underscore if 
you don't like it.


> * locale.getencoding(current=True): Get the *current* locale encoding. The 
> difference with locale.getencoding() is that on Unix, it gets the LC_CTYPE 
> locale encoding at each call.

Hmm, I don't add it to the PEP 686 because it is not relating to UTF-8 mode nor 
EncodingWarning.

Since `locale.getencoding()` returns locale encoding on startup, how about this 
idea?

* sys.getlocaleencoding() -- Get the locale encoding read at Python startup.
* locale.getencoding() -- Get the current locale encoding.

Note that we have `sys.getdefaultencoding()` and `sys.getfilesystemencoding()`. 
`sys.getlocaleencoding()` looks consistent with them.

--

___
Python tracker 

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



[issue47088] Implement PEP 675 (LiteralString)

2022-03-22 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue47097] Document PEP 646

2022-03-22 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

https://docs.python.org/3.11/library/typing.html doesn't say anything about 
TypeVarTuple yet.

--
assignee: docs@python
components: Documentation
messages: 415850
nosy: AlexWaygood, JelleZijlstra, docs@python, gvanrossum, kj, mrahtz
priority: deferred blocker
severity: normal
stage: needs patch
status: open
title: Document PEP 646
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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-22 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

After 14 years this bug is finally fixed. Thanks everyone for the patches and 
discussion.

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



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

2022-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In the IDLE Help menu, 'Python Docs', default hotkey 'F1', invokes 
'<>', which is handled by EditorWindow.help_docs.  For Windows, 
line 599, is 'os.startfile(self.help_url)'.  (Otherwise, webbrowser is used.)  
On Windows, help_url is os.path.join(sys.base_prefix, 'Doc','Python%s.chm' % 
_sphinx_version())
if the result is valid, else python.org/...(but '3.1' because only 3 chars are 
grabbed).

How do I use winreg to get the file name from
"HKCU\Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation"?
The winreg doc assumes some knowledge of registry terminology that I do not 
have and has no examples, so my attempts failed.

--

___
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-22 Thread Jack O'Connor


Jack O'Connor  added the comment:

> maintaining a complicated build process in-tree

For what it's worth, if you have any sort of "in a perfect world" vision for 
what the upstream BLAKE3 project could do to make it trivially easy for you to 
integrate, I'd be very interested in getting that done. Making integration easy 
would benefit all callers. We have some issues on the backburner about 
committing CMake build files, but I assume those would be useless for us here. 
Is there anything that would be more useful? If we provided autotools build 
files, could you call into them?

Fundamentally, BLAKE3 wants to build some code on x86 and some other code on 
ARM, and also some code on Unix and some other code on Windows. Currently we 
just ask the caller to do that for us, for lack of a common standard. (And if 
we're building intrinsics rather than assembly, we also need the compiler flags 
that enable our intrinsics.) But maybe we could handle more of that upstream, 
using the preprocessor? If the build instructions said "compile this one giant 
file on all platforms and don't worry about what it does", would that be 
better? Or would that be gross? Is a header-only library the gold standard? Or 
too C++-ish? Has anyone ever done a really good job of this?

--

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


Change by Eric Snow :


--
pull_requests: +30154
pull_request: https://github.com/python/cpython/pull/32063

___
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-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Because I don't think blake3 or blake2 _(though we've shipped it already so 
there's a challenge in making changes https://bugs.python.org/issue47095)_ are 
important enough to be _guaranteed_ present in all builds (our release binaries 
would include them). Depending on an external library for those to exist makes 
sense.

I do not want CPython to get into the business of maintaining a complicated 
build process in-tree for third party architecture specific optimized code for 
non-core functionality purposes.  That is best handled outside of the project & 
on CI and binary release hosts.

I'm okay with blake3 in hashlib if we can avoid gaining another /impl/ tree 
that is a copy of large third party code and our own build system for it.

Q: What benefits does having blake3 builtin vs getting it from PyPI bring?

Q: Should we instead provide a way for third party provided hashes to be 
registered in `hashlib` similar to `codecs.register()`?

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.

--

___
Python tracker 

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



[issue47095] Deprecate blake2's tree hashing feature

2022-03-22 Thread Christian Heimes


Change by Christian Heimes :


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

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


Eric Snow  added the comment:

Here are reasons why PyConfig relates to the runtime and not each interpreter:

* PyConfig was introduced so embedders could dictate how the *runtime*
  should be initialized
* after initialization, it represents how the runtime was initialized
* in the public API, PyConfig relates only to the runtime
* more than a few PyConfig fields are specific to the entire runtime
  and not appropriate on a per-interpreter basis
* such PyConfig fields are only used during runtime init
* currently, every interpreter uses (a copy of) the original PyConfig,
  completely unchanged
* there is no API for creating an interpreter with a different config
* most of the things that one might want to customize on an interpreter
  can already be done right after the interpreter is initialized
* thus far we have had no actual use cases for initializing an interpreter
  with a different config
* for many of the PyConfig fields, allowing different values for each
  interpreter is an attractive nuisance and would invite confusion

This is why PyConfig makes more sense as the global config, not a 
per-interpreter one.  I think it was a mistake to store the config on 
PyInterpreterState.  Keep in mind, though, that PyConfig was added several 
years before _PyRuntimeState existed.  If _PyRuntimeState had been around, I'm 
sure that's where we would have kept the global config.

Thus, it makes sense to move PyInterpreterState.config to 
_PyRuntimeState.config.  If there's a need for a per-interpreter config later, 
we would do the following:

* add a new PyInterpreterConfig with only the fields we need
* add a new PyInterpreterState.config field of that type

In fact, that is exactly what I'm proposing in PEP 684, where there is a need 
for creating an interpreter with various isolation options.  That's what got me 
thinking about why PyConfig isn't good for customizing new interpreters.  Even 
if we didn't move PyInterpreterState.config to _PyRuntimeState.config, PEP 684 
would still not use PyConfig as the config to pass when creating a new 
interpreter.  Using PyConfig would be confusing and an invitation for trouble.  
So I'd use a new PyInterpreterConfig either way.  Consequently, having PyConfig 
on PyInterpreterState would be confusing, with no benefit.

My intention with this BPO issue was to get our internal details aligned with 
what makes sense for a global config and set the stage for adding a proper 
per-interpreter config.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-22 Thread Steve Dower


Steve Dower  added the comment:

Posted my WIP as a draft PR. I'm still adding docs, tests and ironing out minor 
issues, but the core functionality is there (as well as some added bonuses). 
Feel free to review, and importantly to mark anywhere you'd like more 
explanatory comments.

Currently the main known issue is that the "-3-32" (and now-deprecated "-3-64") 
arguments are not supported. But they will be! There are also likely to be a 
range of shebang templates that need better handling, and I'll go through the 
open issues to see what ought to be fixed there compared to today's version.

--

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-22 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue43166] Unused letters in Windows-specific pragma optimize

2022-03-22 Thread Steve Dower


Steve Dower  added the comment:


New changeset cd05d0a423d97be69f9de4650f68f89e99ad68d1 by neonene in branch 
'main':
bpo-43166: Disable ceval.c optimizations for Windows debug builds (GH-32023)
https://github.com/python/cpython/commit/cd05d0a423d97be69f9de4650f68f89e99ad68d1


--

___
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-22 Thread Larry Hastings


Larry Hastings  added the comment:

> Given that I don't want to see us gain new vendored copies of
> significant but non-critical third party hash code in our tree
> (Modules/_blake3/impl/ in PR 31686) for anything but a known
> fixed term need (ex: the sha2 libtomcrypt code is gone from
> our tree as was clearly going to happen from the start),
> the only way I think we should include blake3 support is if
> there is already a plan for that code to leave our tree in
> the future with a high probability of success.

You've said what you want, but not why.  It sounds like you are against merging 
the BLAKE3 PR containing its own impl.  Why?

--

___
Python tracker 

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



[issue672115] Assignment to __bases__ of direct object subclasses

2022-03-22 Thread Géry

Change by Géry :


--
versions: +Python 3.11 -Python 3.6

___
Python tracker 

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



[issue37901] 21 tests fail when run on an IPv6-only host

2022-03-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Here's how I created an IPv6-only host: 
https://gist.github.com/gpshead/f4f394593674e5f7a58e9424b4dba989

--

___
Python tracker 

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



[issue672115] Assignment to __bases__ of direct object subclasses

2022-03-22 Thread Géry

Change by Géry :


--
nosy: +maggyero

___
Python tracker 

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



[issue23743] Python crashes upon exit if importing g++ compiled mod after importing gcc compiled mod

2022-03-22 Thread Irit Katriel


Change by Irit Katriel :


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



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

2022-03-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

SG. Thanks for the advice. I'll dive in and experiment and report back when I 
have progress.

--
status: closed -> open

___
Python tracker 

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



[issue46114] OpenSSL 3.0 uses different version scheme

2022-03-22 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Case in point: https://buildbot.python.org/all/#/builders/355/builds/338

--

___
Python tracker 

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



[issue22608] test_socket fails with sem_init: Too many open files

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

I think this was fixed in issue45212.

--
nosy: +iritkatriel
resolution:  -> duplicate
status: open -> pending
superseder:  -> Dangling threads in skipped tests in test_socket

___
Python tracker 

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



[issue36692] Unexpected stderr output from test_sys_settrace

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

I'm not seeing this output when I run the test. Are you still seeing it?

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

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


Change by Eric Snow :


--
pull_requests: +30151
pull_request: https://github.com/python/cpython/pull/32061

___
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-22 Thread Eryk Sun


Change by Eryk Sun :


--
nosy:  -eryksun

___
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-22 Thread Ned Deily


Ned Deily  added the comment:

This also applies to any other third-party library that a cpython build may 
link to, like the OpenSSL libs. Some legacy tools that depend on them may work 
in Rosetta 2 Intel-64 emulation mode on an Apple Silicon Mac but eventually 
that will go away so it is important to move away from any inadvertent Rosetta 
dependencies.

I don't use Homebrew myself but a quick web search comes up with a number of 
hits on how to proceed. It looks like the general idea is to save your list of 
installed brew packages, reinstall the base homebrew to install Apple Silicon 
native versions, and then reinstall the top-level packages you had and want and 
you should be good to go from there on.

--
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-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Well, I'm using a mac with gettext installed as part of `brew install git` with 
homebrew installed using the standard procedure.

Only after running `brew remove --ignore-dependencies gettext` and re-running 
configure/make did the command build, but doing so also broke features of git 
(I noticed that the branch name disappeared from my shell). I was able to 
reinstall git and gettext, but then configure/make failed.

Do you have any advice on how to "properly install" gettext using homebrew on 
an M1 mac?

--

___
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-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

And indeed, after removing the `grep ERROR` part of the repro, even the repro 
seems to be invalid:

```
cpython main $ ./python.exe -m test.test_importlib -v -k 
test_entry_points_unique
test_entry_points_unique_packages 
(test.test_importlib.test_metadata_api.APITests)
Entry points should only be exposed for the first package ... ERROR
test.test_importlib.test_windows (unittest.loader.ModuleSkipped) ... skipped 
"No module named 'winreg'"

==
ERROR: test_entry_points_unique_packages 
(test.test_importlib.test_metadata_api.APITests)
Entry points should only be exposed for the first package
--
Traceback (most recent call last):
  File 
"/Users/jaraco/code/public/cpython/Lib/test/test_importlib/test_metadata_api.py",
 line 97, in test_entry_points_unique_packages
raise ValueError("Failing on purpose")
^^
ValueError: Failing on purpose

--
Ran 2 tests in 0.006s

FAILED (errors=1, skipped=1)
```

I'm effectively unable to replicate the behavior reported by Brett in the other 
issue (unless `| grep ERROR` is consider an important use-case to support).

At this point, I propose one of two options:

1. Back out PR 30194 and restore the prior behavior with descriptions.
2. Leave PR 30194 to suppress descriptions for the default runner.

And then simply declare that docstrings are acceptable for CPython tests.

Given that descriptions are on by default, I'm slightly inclined toward (1).

Thoughts?

--

___
Python tracker 

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



[issue47095] Deprecate blake2's tree hashing feature

2022-03-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

In the short term we should prefer libb2 linkage when available.

As for deprecation, it'd be useful to research how often the options going away 
are used in code in PyPI packages and in Github repos to understand the 
deprecation impact.

The PyPI landscape for blake2 modules is not great because we've had it in 
hashlib for a while. One of those, or a new one, would need to be created by 
someone who needs the non openssl features.

ultimate goal: simplify what's in Modules/_blake2/impl/ if it cannot be 
removed. Use an external library for the implementation when possible (and in 
all our binary releases. Those are better maintained to take advantage of 
performance or hw features over time.

--

___
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-22 Thread Ned Deily


Ned Deily  added the comment:

There shouldn't be a problem as long as gettext is properly installed on an M1 
Mac, i.e. with an arm64 arch or a universal build that includes arm64.

--

___
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-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I ran into this same issue. I notice that gettext is a dependency of git, so a 
common dependency when developing. Is there perhaps a way that CPython could be 
made to ignore gettext on macos Silicon or to detect an incompatible platform 
and thus ignore it?

--
nosy: +jaraco
status: closed -> open

___
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-22 Thread Ned Deily


Ned Deily  added the comment:

> Do you have any thoughts about distributing the docs in ePub format?

Note that it's *much* easier to manufacture the docs in html format than it is 
in ePub format.

--

___
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-22 Thread Steve Dower


Steve Dower  added the comment:

> Do you have any thoughts about distributing the docs in ePub format?

If Windows includes a reader for all supported versions, and it's easy 
to build, sure. But I don't think the first bit is true.

Most people are going to be fairly comfortable with their default 
browser, and many are going to greatly prefer it. I think loose HTML 
files is a good option from every POV other than being a large number of 
loose files.

--

___
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-22 Thread Ned Deily


Ned Deily  added the comment:

At a minimum, though, Doc/tools/templates/download.html should be changed to 
remove the chm reference.

--

___
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-22 Thread Eryk Sun


Eryk Sun  added the comment:

Do you have any thoughts about distributing the docs in ePub format?

--
nosy: +eryksun

___
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-22 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Inada, you're right. Good catch. I think I missed that behavior from before 
because I used `grep ERROR` and when I ran it this time, I just assumed the 
output would be the same, but it's clear that even _with descriptions enabled_, 
the location of the test is clearly reported in the case of launching with `-m 
unittest`.

I'm now suspicious that my report in 
https://bugs.python.org/issue46126#msg408882 was also flawed as it uses `grep 
ERROR`, which could easily mask lines that adjacent to the error.

I now believe that there are no concerns relating to Terry's concern, and 
likely not Brett's concern despite my best efforts to replicate. I'll bring 
back the original example and see if it in fact has the reported defect.

--
assignee: terry.reedy -> jaraco

___
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-22 Thread Steve Dower


Steve Dower  added the comment:

The key is defined at 
https://github.com/python/cpython/blob/main/Tools/msi/doc/doc.wxs#L17 and is 
not set for a Store install at all. But we don't include the docs in that 
either - go straight to the web.

--

___
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-22 Thread Steve Dower


Steve Dower  added the comment:

For the registry key, reading the default value from key 
"HKCU\Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation" 
(or HKLM - no need to worry about the Wow6432Node bit here) and passing it to 
os.startfile() will work for all active releases.

If the key is missing, so are the local docs, so falling back to the web docs 
is a fine option.

--

___
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-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

correction: our md5/sha1/sha2/sha3 code is not gone yet, but they are simple C 
implementations used as a fallback when the provider of optimal versions are 
unavailable (openssl for those).  That keeps the copies of code in our tree 
simple and most people use the optimal library version.

--

___
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-22 Thread Steve Dower


Steve Dower  added the comment:

Good call on IDLE, I didn't even think to check there (there is a registry key 
that points at the documentation if it was installed, which would be the best 
approach for IDLE to use).

The makefiles don't urgently need to remove those references. If people still 
want to build it, they're welcome to [try]. It gives people with their own 
build processes a chance to adapt - we can remove it all later.

--

___
Python tracker 

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



[issue13670] Increase test coverage for pstats.py

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be reviewed. If the tests are still relevant and increase 
coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be 
closed.

--
keywords: +easy, newcomer friendly -patch
nosy: +iritkatriel

___
Python tracker 

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



[issue27132] New assert method that checks an error message for a list of strings

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

> Personally I'd write multiple asserts rather than regex permutations.

I would too, because then when one of them fails it's clear which of the 
strings is missing.

--
nosy: +iritkatriel

___
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-22 Thread Ned Deily


Ned Deily  added the comment:

If you remove the .chm file from the Windows installer, I believe IDLE needs to 
be updated to look for the installed html files instead (see 
Lib/idlelib/editor.py).

And does this mean we should no longer produce .chm files at all for 3.11+? If 
so, there is work to be done in the Doc section of the repo (Makefile, 
make.bat, README.rst tools/* all have references to .chm and .hhp files). I 
guess other than the references to chm files in the docs, this change would not 
otherwise affect the on-line docs building system.

(Nosying Terry and Julien as subject experts.)

--
nosy: +mdk, ned.deily, terry.reedy

___
Python tracker 

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset f163ad22d3321cb9bb4e6cbaac5a723444641565 by Miss Islington (bot) 
in branch '3.10':
bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932)
https://github.com/python/cpython/commit/f163ad22d3321cb9bb4e6cbaac5a723444641565


--

___
Python tracker 

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset 3c6019035f16b673cf0f0be6918f7d5493e5690e by Miss Islington (bot) 
in branch '3.9':
bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932)
https://github.com/python/cpython/commit/3c6019035f16b673cf0f0be6918f7d5493e5690e


--

___
Python tracker 

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



[issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

See also issue25528.

--

___
Python tracker 

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



[issue25528] Attempt to further increase test coverage of calendar module

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be reviewed. If the tests are still relevant and increase 
coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be 
closed.


See also issue13330.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue13330] Attempt full test coverage of LocaleTextCalendar.formatweekday

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

The patch needs to be reviewed. If the tests are still relevant and increase 
coverage, it needs to be converted to a GitHub PR. Otherwise this issue can be 
closed.

--
keywords: +easy -needs review, patch
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue22260] Rearrange tkinter tests, use test discovery

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

The patch looks very out of date. Let mw know if it's still needed, otherwise 
I'll close.

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

___
Python tracker 

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30150
pull_request: https://github.com/python/cpython/pull/32058

___
Python tracker 

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2022-03-22 Thread Jelle Zijlstra

Jelle Zijlstra  added the comment:


New changeset 7ba7eae50803b11766421cb8aae1780058a57e2b by Daniël van Noord in 
branch 'main':
bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932)
https://github.com/python/cpython/commit/7ba7eae50803b11766421cb8aae1780058a57e2b


--
nosy: +JelleZijlstra

___
Python tracker 

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



[issue17733] Add tests to test__header_value_parser for RFC 2231 parsing code

2022-03-22 Thread Irit Katriel


New submission from Irit Katriel :

I believe this is about smtpd, which is now deprecated under PEP 594. So I 
think we can close it.

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

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


Eric Snow  added the comment:

> After a new `&_Py_ID(__orig_class__)` is added to 
> Objects/genericaliasobject.c, running `make regen-global-objects` starts
>
> gcc -pthread -c [snipped] -DPy_BUILD_CORE -o Objects/genericaliasobject.o 
> Objects/genericaliasobject.c
>
> which fails with a compilation error because that identifier is not yet 
> defined. Is there a good way to convince `make` to regenerate the global 
> objects without this sort of circular dependency? Am I missing a step?

I'm looking into this.  A temporary workaround is to run 
Tools/scripts/generate-global-objects.py directly.

--

___
Python tracker 

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



[issue47090] Make zlib required on all platforms (simplifies code)

2022-03-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Bringing this up on discord, others point out that the windows build requires 
zlib for convenience when we transitioned from having a vendored copy in our 
repo and that smaller "embedded" use cases may not like this if they don't 
already need the dep. But there have been no complaints about it on the Windows 
side.

`binascii.crc32` was one thing that motivated me to look into "just require 
zlib" to get out of carrying our own suboptimal crc32 code.  along those lines, 
we should recommend people choose https://github.com/zlib-ng/zlib-ng rather 
than zlib.net for better performance.

looking over my PR, it can make for some awkward code with zlib right next to 
others that we treat as optionals.  good bad or indifferent?  i'm leaning 
towards indifferent and still enjoying fewer lines of code.

--

___
Python tracker 

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



[issue46788] regrtest fails to start on missing performance counter names

2022-03-22 Thread Eryk Sun


Change by Eryk Sun :


Removed file: https://bugs.python.org/file50695/loadtracker.py

___
Python tracker 

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



[issue46788] regrtest fails to start on missing performance counter names

2022-03-22 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg415781

___
Python tracker 

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



[issue47096] Use the PDH API in WindowsLoadTracker

2022-03-22 Thread Eryk Sun


New submission from Eryk Sun :

In bpo-44336, a new version of WindowsLoadTracker was implemented in 
Lib/test/libregrtest/win_utils.py. This version resolves issues with the 
previous implementation that spawned typeperf.exe. The new implementation uses 
the registry API's HKEY_PERFORMANCE_DATA pseudohandle to access the performance 
counters. This requires hard-coding "2" as the key name of the system object, 
44 as the index of the "Processor Queue Length" counter, and also several 
struct definitions. 

The HKEY_PERFORMANCE_DATA 'key' just wraps the API as an alternate way to 
consume counter data. Instead of taking this detour through a minimalist 
interface just to use the API in a roundabout way, it would be better to 
implement a few of the Performance Data Helper functions in _winapi. I've 
implemented a prototype in ctypes to demonstrate this, which I'm attaching as 
"loadtracker.py". The functions that would need to be implemented are 
PdhOpenQueryW(), PdhAddEnglishCounterW(), PdhCollectQueryData(), 
PdhGetRawCounterValue(), and PdhCloseQuery().

--
components: Windows
files: loadtracker.py
messages: 415808
nosy: eryksun, jkloth, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Use the PDH API in WindowsLoadTracker
type: enhancement
Added file: https://bugs.python.org/file50696/loadtracker.py

___
Python tracker 

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



[issue47095] Deprecate blake2's tree hashing feature

2022-03-22 Thread Christian Heimes


New submission from Christian Heimes :

Python's blake2 implementation provides hashing, MAC (key, salt, 
personalization), variable length output, and tree hashing [1]. All features 
except for tree hashing are provided by OpenSSL 3.0.0 and newer [2]. It is 
unlikely that OpenSSL will get tree hashing any time soon, if all. [3]

I would like to remove our vendored copy of blake2 eventually and just rely on 
OpenSSL. Therefore I propose to deprecate tree hashing feature so we can drop 
it in Python 3.13. The tree hashing parameters are: fanout, depth, leaf_size, 
node_offset, node_depth, inner_size, last_node

Note: OpenSSL 3.0 might impose additional restrictions on the parameter. It 
might be possible that OpenSSL does not support salt and personalization 
(OSSL_MAC_PARAM_CUSTOM) without a MAC key.

Alternatively we could replace our copy of blake2 and depend on libb2 from 
https://blake2.net/. libb2 is available in Fedora.

[1] https://docs.python.org/3/library/hashlib.html#hashlib.blake2b
[2] https://www.openssl.org/docs/manmaster/man7/EVP_MAC-BLAKE2.html
[3] https://github.com/openssl/openssl/issues/980

--
components: Extension Modules
messages: 415807
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
status: open
title: Deprecate blake2's tree hashing feature
type: behavior
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-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

hashlib creator and other maintainer here: I do not think it was a good idea 
for us to add blake2 to hashlib the way we did. So blake3 should not be 
presumed as a given, at least not done in the same manner.

Background:

While OpenSSL gained _some_ blake2 support in 2016, around when we were adding 
it to hashlib (not a coincidence), we made a mistake: We offered an overly 
complex API. OpenSSL's own support for blake2 is a subset, not sufficient to be 
used as a replacement for the API we exposed so we are stuck with our vendored 
copy with no easy way off. https://github.com/openssl/openssl/issues/980

OpenSSL is not going to gain native blake3 support. 
https://github.com/openssl/openssl/issues/11613

Given that I don't want to see us gain new vendored copies of significant but 
non-critical third party hash code in our tree (Modules/_blake3/impl/ in PR 
31686) for anything but a known fixed term need (ex: the sha2 libtomcrypt code 
is gone from our tree as was clearly going to happen from the start), the only 
way I think we should include blake3 support is if there is already a plan for 
that code to leave our tree in the future with a high probability of success.

A `configure.ac` check for an installed blake3 library to build and link 
against would be appropriate.

Along with updating relevant CI systems and Windows and macOS release build 
systems to have that available.  

That'd significantly shrink the PR to reasonable size.

This means blake3 support should be considered optional as anyone doing their 
own CPython build may not have it.  This is primarily a documentation issue: 
list it as such and provide one official documented API to detect its 
availability.  Our binary releases will include it as will most OS distro 
packagers.  It also means implementation details, performance and platform 
tuning are **not our problem** but those of the OS distro or external library 
provider.

Regarding setup.py, what Christian says is true, that is on its way out. Do not 
add new non-trivial statements to it as that just creates more work for those 
working to untangle the mess. Getting rid of the /impl/ build in favor of an 
autoconf detected library gets rid of that mess.

I'll file a separate issue to track moving blake2 in the same direction so we 
can lose it's /impl/.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue47091] Improve performance of list and tuple repeat methods

2022-03-22 Thread Pieter Eendebak


Pieter Eendebak  added the comment:

The special case of a repeat with n=1 does not use memcpy. An implementation 
with it showed no performance improvement.

--

___
Python tracker 

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



[issue35540] dataclasses.asdict breaks with defaultdict fields

2022-03-22 Thread Tiger


Change by Tiger :


--
nosy: +kwsp
nosy_count: 7.0 -> 8.0
pull_requests: +30148
pull_request: https://github.com/python/cpython/pull/32056

___
Python tracker 

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



[issue47094] index doesn't change while looping through same elements in a list

2022-03-22 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The help text says this:

>>> help(list.index)
Help on method_descriptor:

index(self, value, start=0, stop=9223372036854775807, /)
Return first index of value.

Raises ValueError if the value is not present.

Emphasis on *first* index. Example:

>>> L = [0, 10, 20, 33, 0, 10]
>>> L.index(10)
1
>>> L[5]
10
>>> L.index(L[5]) # the same meaning as L.index(10)
1

In your code, when elm has the value 1, it's just the value 1; there's no extra 
information carried along about where that 1 came from. If elm == 1, then 
my_list.index(elm) means the same as my_list.index(1).

I'd suggest taking any further questions to either StackOverflow or 
https://discuss.python.org/c/users/

Thanks for the concern, but I'm closing this as "not a bug". Changing this 
behavior now would be backwards-incompatible and break lots of people's code.

--
nosy: +Dennis Sweeney
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



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

2022-03-22 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset af341ebf00d9a45cadea4c07810564d8e8962b96 by Hugo van Kemenade in 
branch '3.9':
[3.9] bpo-47022: Document asynchat, asyncore and smtpd removals in 3.12 
(GH-31891) (#31998)
https://github.com/python/cpython/commit/af341ebf00d9a45cadea4c07810564d8e8962b96


--

___
Python tracker 

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



[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-42197: Disable automatic update of frame locals during tracing.

--

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-47092: [C API] Add PyFrame_GetVar(frame, name) function.

--

___
Python tracker 

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



[issue42197] Disable automatic update of frame locals during tracing

2022-03-22 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30147
pull_request: https://github.com/python/cpython/pull/32055

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2022-03-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 4aea656d62860e78cd8384f2de375f0d4f1db579 by Christian Heimes in 
branch 'main':
bpo-32033: Finalize WASI configure options (GH-32053)
https://github.com/python/cpython/commit/4aea656d62860e78cd8384f2de375f0d4f1db579


--

___
Python tracker 

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



[issue44336] Windows buildbots hang after fatal exit

2022-03-22 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
pull_requests: +30146
pull_request: https://github.com/python/cpython/pull/32048

___
Python tracker 

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



[issue46788] regrtest fails to start on missing performance counter names

2022-03-22 Thread Steve Dower


Steve Dower  added the comment:

Backports have been merged

--
resolution:  -> fixed
stage: backport needed -> 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



[issue44336] Windows buildbots hang after fatal exit

2022-03-22 Thread Steve Dower


Steve Dower  added the comment:

Thanks!

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



[issue44336] Windows buildbots hang after fatal exit

2022-03-22 Thread Steve Dower


Steve Dower  added the comment:


New changeset 8db7610d1a7b1f90631bac26261338f27bd20727 by Jeremy Kloth in 
branch '3.9':
bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578)
https://github.com/python/cpython/commit/8db7610d1a7b1f90631bac26261338f27bd20727


--

___
Python tracker 

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



[issue44336] Windows buildbots hang after fatal exit

2022-03-22 Thread Steve Dower


Steve Dower  added the comment:


New changeset 8146e6b636905d9872140c990d93308ac20d13f0 by Jeremy Kloth in 
branch '3.10':
bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578)
https://github.com/python/cpython/commit/8146e6b636905d9872140c990d93308ac20d13f0


--

___
Python tracker 

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



[issue42917] Block stack size for frame objects should be dynamically sizable

2022-03-22 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30145
pull_request: https://github.com/python/cpython/pull/32055

___
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-22 Thread Vladimir Matveev


Vladimir Matveev  added the comment:

- introducing dedicated opcodes for each kind of awaited call is definitely an 
option. In fact first implementation used it however as Dino has mentioned it 
was more of a logistical issue (there were several spots that produced .pyc 
files so compiler needed to be up to date across all of them).
- there was some perf win that was coming from rewriting `gather` in C however 
main reason for us to do it was the ability to be await-aware which we made 
only available in C (also returning completed waithandle is not exposed to 
Python either) to reduce the scope. Providing ability to follow await-aware 
protocol (read indicator that call is awaited + return completed waithandle for 
eagerly completed calls) in pure Python is definitely possible
- to provide some context why it was beneficial: typical implementation of 
endpoint in IG is an async function that in turn calls into numerous other 
async functions to generate an output. 
  - `gather` is used all over the place in case if there are no sequential 
dependency between calls
  - amount of unique pieces of data that are ultimately fetched by async calls 
is not very big, i.e. the same fragment of information can be requested by 
different async calls which makes memoization a very attractive strategy to 
reduce I/O and heavyweight computations.
  - memoized pieces of data is represented effectively by completed futures and 
it is very common to have `gather` accept either memoized value or coroutine 
object that will be completed synchronously by awaiting memoized value.

Before making gather await-aware if always have to follow the standard process 
and convert awaitables into tasks that are queued into the event loop for 
execution. In our workload task creation/queueing were adding a noticeable 
overhead. With await-aware gather we can execute coroutine objects eagerly and 
if they were not suspended - bypass task creation entirely.  
```
import asyncio
import time

async def step(i):
if i == 0:
return
await asyncio.gather(*[step(i - 1) for _ in range(6)])

async def main():
t0 = time.perf_counter()
await step(6)
t1 = time.perf_counter()
print(f"{t1 - t0} s")

N = 0
def create_task(loop, coro):
global N
N += 1
return asyncio.Task(coro, loop=loop)

loop = asyncio.get_event_loop()
loop.set_task_factory(create_task)
loop.run_until_complete(main())
print(f"{N} tasks created")

# Cinder
# 0.028410961851477623 s
# 1 tasks created

# Python 3.8
# 1.2157012447714806 s
# 55987 tasks created
```

--

___
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-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30144
pull_request: https://github.com/python/cpython/pull/32054

___
Python tracker 

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



[issue32033] The pwd module implementation incorrectly sets some attributes to None

2022-03-22 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
nosy_count: 5.0 -> 6.0
pull_requests: +30143
pull_request: https://github.com/python/cpython/pull/32053

___
Python tracker 

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



[issue38242] Revert the new asyncio Streams API

2022-03-22 Thread Ian Good


Change by Ian Good :


--
nosy: +icgood
nosy_count: 9.0 -> 10.0
pull_requests: +30142
pull_request: https://github.com/python/cpython/pull/13143

___
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-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30141
pull_request: https://github.com/python/cpython/pull/32052

___
Python tracker 

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



[issue47093] Documentation Fix: Remove .bat when activating venv on windows

2022-03-22 Thread Eryk Sun


Eryk Sun  added the comment:

Running `tutorial-env\Scripts\activate` should suffice. The .bat script is for 
CMD, and the .ps1 script is for PowerShell. The shell should run the right 
script without having to include the extension. 

In Windows 10+, if you use a case-sensitive directory for the virtual 
environment, note that the script name for PowerShell is "Activate.ps1". 
PowerShell 7+ checks the directory for any name that case-insensitively matches 
"activate", but you'll have to run `tutorial-env\Scripts\Activate` in 
PowerShell 5.1.

--
components: +Windows
keywords: +easy
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> needs patch
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



[issue45150] Add a file_digest() function in hashlib

2022-03-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset e03db6d5be7cf2e6b7b55284985c404de98a9420 by Christian Heimes in 
branch 'main':
bpo-45150: Fix testing under FIPS mode (GH-32046)
https://github.com/python/cpython/commit/e03db6d5be7cf2e6b7b55284985c404de98a9420


--

___
Python tracker 

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



[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

If PyFrameStack_GetVar(depth, name) is added, would it make PyFrame_GetVar() 
irrelevant?

--

___
Python tracker 

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



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Issue title: "[C API] Add getter functions for PyFrameObject and maybe move 
PyFrameObject to the internal C API"

bpo-46836 moved PyFrameObject to the internal C API. I update the issue title.

--
title: [C API] Add getter functions for PyFrameObject and maybe move 
PyFrameObject to the internal C API -> [C API] Add public getter functions for 
the internal PyFrameObject structure
versions: +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



[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

See also:

* bpo-46836: [C API] Move PyFrameObject to the internal C API.
* bpo-46836: GH-32051 "Add Doc/c-api/frame.rst"
* bpo-40421: [C API] Add getter functions for PyFrameObject and maybe move 
PyFrameObject to the internal C API.

--

___
Python tracker 

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



[issue42885] Optimize re.search() for \A (and maybe ^)

2022-03-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue40065] py39: remove deprecation note for xml.etree.cElementTree

2022-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

> We are currently debating to bring the module back and warn users that it 
> will be removed in 3.10.


Doesn't look like it was removed in 3.10. Was this an oversight?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42885] Optimize re.search() for \A (and maybe ^)

2022-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 492d4109f4d953c478cb48f17aa32adbb912623b by Serhiy Storchaka in 
branch 'main':
bpo-42885: Optimize search for regular expressions starting with "\A" or "^" 
(GH-32021)
https://github.com/python/cpython/commit/492d4109f4d953c478cb48f17aa32adbb912623b


--

___
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-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30140
pull_request: https://github.com/python/cpython/pull/32051

___
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-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset f47984b560f1dafe4d907cef4edadfb1746bf027 by Andrew Svetlov in 
branch '3.9':
[3.9] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (GH-32049)
https://github.com/python/cpython/commit/f47984b560f1dafe4d907cef4edadfb1746bf027


--

___
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-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 9d59381a5d20157930bae34e5f5a7bc5ef09fa89 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (#32047)
https://github.com/python/cpython/commit/9d59381a5d20157930bae34e5f5a7bc5ef09fa89


--

___
Python tracker 

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



[issue47094] index doesn't change while looping through same elements in a list

2022-03-22 Thread Tk44


New submission from Tk44 :

Let us define a list where there are some duplicate elements. If we loop 
through that list as "for i in my_list" and print the index by 
my_list.index(i); the index doesn't change.

e.g.

my_list = [1,1,1,1,3]
for elm in my_list:
   print(my_list.index(elm))

==output==
0
0
0
0
4

This occurs where elements are of type string as well. Of course this can be 
overcome by using enumerate(); however I think this is a wrong behavior.

--
messages: 415785
nosy: Tugberk
priority: normal
severity: normal
status: open
title: index doesn't change while looping through same elements in a list
type: behavior
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



[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

I'm looking into adding two new APIs.
One to round out the getters for FrameObject and one to introspect the internal 
frame stack.

It would probably make more sense to add this capability to the frame stack 
API, as it would avoid creating the frame object as well as the locals 
dictionary.

E.g. `PyFrameStack_GetVar(int depth, PyObject *name)`

--

___
Python tracker 

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



[issue47093] Documentation Fix: Remove .bat when activating venv on windows

2022-03-22 Thread J Y


New submission from J Y :

https://docs.python.org/3/tutorial/venv.html

For windows, tutorial-env\Scripts\activate.bat doesn't appear to set up venv 
successfully. 

Instead, tutorial-env\Scripts\activate (without .bat) works. This may confuse 
new users if this is not rectified.

--
assignee: docs@python
components: Documentation
messages: 415783
nosy: docs@python, jovinator
priority: normal
severity: normal
status: open
title: Documentation Fix: Remove .bat when activating venv on windows
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



[issue45963] Embed interpreter frame in generator.

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Leak fixed by:

commit 064e53d19aea6d6906fa8f7706a2556a2c293ccd
Author: Mark Shannon 
Date:   Tue Dec 7 18:05:48 2021 +

Fix leak when an exception is raised during generator creation. (GH-29960)

--
nosy: +vstinner

___
Python tracker 

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



[issue46788] regrtest fails to start on missing performance counter names

2022-03-22 Thread Eryk Sun


Eryk Sun  added the comment:

I implemented a ctypes prototype that replaces the registry-based 
implementation with the API calls PdhOpenQueryW(), PdhAddEnglishCounterW(), 
PdhCollectQueryData(), PdhGetRawCounterValue(), and PdhCloseQuery(). I'm 
attaching the script, but here's the class itself without the ctypes 
definitions:

class WindowsLoadTracker():
"""
This class asynchronously reads the system "Processor Queue Length"
counter to calculate the system load on Windows.  A raw thread is
used to avoid interfering with tests of the threading module.
"""

def __init__(self):
self._values = []
self._load = None
self._hrunning = kernel32.CreateEventW(None, True, False, None)
self._hstopped = kernel32.CreateEventW(None, True, False, None)
self._hquery = wintypes.HANDLE()
self._hcounter = wintypes.HANDLE()
pdh.PdhOpenQueryW(None, None, ctypes.byref(self._hquery))
pdh.PdhAddEnglishCounterW(self._hquery,
  r"\System\Processor Queue Length",
  None,
  ctypes.byref(self._hcounter))
pdh.PdhCollectQueryData(self._hquery)
_thread.start_new_thread(self._update_load, (), {})

def _update_load(self,
 # Localize module access to prevent shutdown errors.
 WaitForSingleObject=_winapi.WaitForSingleObject,
 SetEvent=kernel32.SetEvent):
# run until signaled to stop
while WaitForSingleObject(self._hrunning, 1000):
self._calculate_load()
# notify stopped
SetEvent(self._hstopped)

def _calculate_load(self,
# Lcalize module access to prevent shutdown errors.
PdhCollectQueryData=pdh.PdhCollectQueryData,
PdhGetRawCounterValue=pdh.PdhGetRawCounterValue):
counter_type = wintypes.DWORD()
raw = PDH_RAW_COUNTER()
PdhCollectQueryData(self._hquery)
PdhGetRawCounterValue(self._hcounter,
  ctypes.byref(counter_type),
  ctypes.byref(raw))
if raw.CStatus < 0:
return
processor_queue_length = raw.FirstValue

# Use an exponentially weighted moving average, imitating the
# load calculation on Unix systems.
# 
https://en.wikipedia.org/wiki/Load_(computing)#Unix-style_load_calculation
# 
https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
if self._load is not None:
self._load = (self._load * LOAD_FACTOR_1
+ processor_queue_length  * (1.0 - 
LOAD_FACTOR_1))
elif len(self._values) < NVALUE:
self._values.append(processor_queue_length)
else:
self._load = sum(self._values) / len(self._values)

def getloadavg(self):
return self._load

def close(self,
  # Localize module access to prevent shutdown errors.
  WaitForSingleObject=_winapi.WaitForSingleObject,
  INFINITE=_winapi.INFINITE,
  SetEvent=kernel32.SetEvent,
  CloseHandle=_winapi.CloseHandle,
  PdhCloseQuery=pdh.PdhCloseQuery):
if self._hrunning is None:
return
# Tell the update thread to quit.
SetEvent(self._hrunning)
# Wait for the update thread to stop before cleanup.
WaitForSingleObject(self._hstopped, INFINITE)
CloseHandle(self._hrunning)
CloseHandle(self._hstopped)
PdhCloseQuery(self._hquery)
self._hrunning = self._hstopped = None

def __del__(self):
self.close()
return

--
Added file: https://bugs.python.org/file50695/loadtracker.py

___
Python tracker 

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



  1   2   >