[issue46864] Deprecate ob_shash in BytesObject

2022-03-22 Thread Ma Lin


Ma Lin  added the comment:

Since hash() is a public function, maybe some users use hash value to manage 
bytes objects in their own way, then there may be a performance regression.

For a rough example, dispatch data to 16 servers.

h = hash(b)
sendto(server_number=h & 0xF, data=b)

--

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


Inada Naoki  added the comment:

Since the hash is randomized, using hash(bytes) for such use case is not 
recommended. User should use stable hash functions instead.

I agree that there is few use cases this change cause performance regression. 
But it is really few compared to overhead of adding 8bytes for all bytes 
instances.

--

___
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


New submission from Gregory P. Smith :

We have a pile of conditionals and extra code in CPython to deal with building 
on systems that do not have zlib.  The zlib C library has been around forever 
at this point and should be present on every system in the world.

zlib is already required on Windows to build CPython.

Proposal: simplify our code by removing the conditionals around zlib being 
optional.  I'm attaching a draft PR to show what this would look like.

--
assignee: gregory.p.smith
components: Build, Extension Modules, Library (Lib)
messages: 415750
nosy: gregory.p.smith
priority: normal
severity: normal
stage: patch review
status: open
title: Make zlib required on all platforms (simplifies code)
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



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

2022-03-22 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +30133
pull_request: https://github.com/python/cpython/pull/32043

___
Python tracker 

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



[issue47043] Argparse can't parse subparsers with parse_known_args

2022-03-22 Thread rive_n


rive_n  added the comment:

Long time no updates here. Another fix. In past version more than 1 argument 
could not be parsed. Fix (finally with unittests):

```python3
def __call__(self, parser, namespace, values, option_string=None, 
arg_strings_pattern:list =None):
o_amount = arg_strings_pattern.count("O")
if not o_amount:
raise ValueError("No Os found")
o_start, o_stop, indexes = arg_strings_pattern.index('O'), 
len(arg_strings_pattern), []
print(parser)
try:
while arg_strings_pattern.index('O', o_start, o_stop):
indexes.append(arg_strings_pattern.index('O', o_start, o_stop))
o_start = arg_strings_pattern.index('O', o_start + 1, o_stop)
except ValueError:
pass

used_indexes = []
known_args = {}
for i, index in enumerate(indexes):
parser_name = values[index - 1]
if not known_args.get(parser_name):
known_args[parser_name] = []
known_args[parser_name] += values[index: indexes[i + 1] - 1] if 
i + 1 < len(indexes) else values[index:]
if index not in used_indexes:
for s, subindex in enumerate(indexes[1:]):
subparser_name = values[subindex - 1]
if parser_name == subparser_name:
used_indexes.append(index)
used_indexes.append(subindex)
subparser_args = values[subindex: indexes[s + 2] - 1] 
if s + 2 < len(indexes) else values[subindex:]
known_args[parser_name] += subparser_args

for parser_name, args in known_args.items():
self._create_parser(namespace, parser_name, args)

def _create_parser(self, namespace, parser_name, arg_strings):

# set the parser name if requested
if self.dest is not SUPPRESS:
setattr(namespace, self.dest, parser_name)

# select the parser
try:
parser = self._name_parser_map[parser_name]
except KeyError:
args = {'parser_name': parser_name,
'choices': ', '.join(self._name_parser_map)}
msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % 
args
raise ArgumentError(self, msg)

# parse all the remaining options into the namespace
# store any unrecognized options on the object, so that the top
# level parser can decide what to do with them

# In case this subparser defines new defaults, we parse them
# in a new namespace object and then update the original
# namespace for the relevant parts.
subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
for key, value in vars(subnamespace).items():
setattr(namespace, key, value)

if arg_strings:
vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])
getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings)

```

Unittests:
```python3
import unittest
import argfork as argparse
from argfork import Namespace


class argparseTest(unittest.TestCase):

def setUp(self) -> None:
self.parser = argparse.ArgumentParser(prog='PROG')
subparsers = self.parser.add_subparsers(help='sub-command help')

# create the parser for the "a" command
parser_a = subparsers.add_parser('a', help='a help')
parser_a.add_argument('-a', help='bar help')

# create the parser for the "b" command
parser_b = subparsers.add_parser('b', help='b help')
parser_b.add_argument('-b', help='baz help')
parser_b.add_argument('-q', help='baz help')

# create the parser for the "c" command
parser_b = subparsers.add_parser('c', help='b help')
parser_b.add_argument('-c', help='baz help')
parser_b.add_argument('-k', help='baz help')

# create the parser for the "c" command
parser_b = subparsers.add_parser('d', help='b help')
parser_b.add_argument('-d', help='baz help')
parser_b.add_argument('-D', help='baz help')
parser_b.add_argument('-R', help='baz help')

def testSimple(self):
case = ['a', '-a', 'test']
res_obj = Namespace(a='test').__dict__
rest_obj = self.parser.parse_known_args(case)[0].__dict__

res_k, res_v = res_obj.keys(), list(res_obj.values())
test_k, test_v = rest_obj.keys(), list(rest_obj.values())

self.assertEqual(res_v, test_v)
self.assertEqual(res_k, test_k)

def testMany(self):
case = ['d', '-d', '1234', 'd', '-D', '12345', 'd', '-R', '1', 'c', 
'-c', '123', 'c', '-k', '555', 'b', '-q', 'test']
res_obj = Namespace(d='1234', D='12345', R='1', c='123', k='555', 
b=None, q='test').__dict__
rest_obj = self.parser.parse_known_args(case)[0].__dict__

res_k, res_v = res_obj.keys(), list(res_obj.values())
  

[issue47006] PEP 646: Decide on substitution behavior

2022-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Alias = C[T, *Ts]
> Alias2 = Alias[*tuple[int, ...]]
> # Alias2 should be C[int, *tuple[int, ...]]

tuple[int, ...] includes also an empty tuple, and in this case there is no 
value for T.

> Oh, also interesting - I didn't know about this one either. Could you give an 
> example?

If __origin__, __parameters__, __args__ are a mess, it will definitely break a 
code which use them.


> We actually deliberately chose not to unpack concrete tuple types - see the 
> description of https://github.com/python/cpython/pull/30398, under the 
> heading 'Starred tuple types'. (If you see another way around it, though, let 
> me know.)

You assumed that *tuple[str, bool] in def foo(*args: *tuple[str, bool]) should 
give foo.__annotations__['args'] = tuple[str, bool], but it should rather give 
(str, bool). No confusion with tuple[str, bool].

And one of PEP 646 options is to implement star-syntax only in subscription, 
not in var-parameter type annotations.

> I'm also not sure about this one; disallowing unpacked TypeVarTuples in 
> argument lists to generic aliases completely (if I've understood right?)

No, it will only be disallowed in substitution of a VarType. Tuple[T][*Ts] -- 
error. Tuple[*Ts][*Ts2] -- ok.

I propose to implement simple and strict rules, and later add support of new 
cases where it makes sense.

--

___
Python tracker 

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



[issue47006] PEP 646: Decide on substitution behavior

2022-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> 1. Some edge case seems to be that if *tuple[...] is involved on either side 
> we will never simplify. Or perhaps a better rule is that *tuple[...] is never 
> simplified away (but fixed items before and after it may be).

I do not understand this. Do you forbid simplifying of tuple[*Ts, float][str, 
*tuple[int, ...]] to tuple[str, *tuple[int, ...], float]?

I think that the rule should be that *tuple[X, ...] cannot split between 
different variables. Or that it cannot substitute a TypeVar. A more strong 
variant of rule 4.

> 5. ... but we cannot flag it as an error either.

I think that it will better to flag it as an error now. Later, after all code 
be merged and all edge cases be handled we can return here and reconsider this.

There are workarounds for this.

* You should not use Generic[*Ts] if you require at least one item, but 
Generic[*Ts, T].
* Instead of `def foo(*args: *Ts)` use `def foo(*args: *tuple[*Ts, T])`.

These tricks are common in functional programming.

The rest of the rules match my implementations more or less.

--

___
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 miss-islington


miss-islington  added the comment:


New changeset 4f97d64c831c94660ceb01f34d51fa236ad968b0 by Christian Heimes in 
branch 'main':
bpo-45150: Add hashlib.file_digest() for efficient file hashing (GH-31930)
https://github.com/python/cpython/commit/4f97d64c831c94660ceb01f34d51fa236ad968b0


--
nosy: +miss-islington

___
Python tracker 

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



[issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation

2022-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c6cd3cc93c40363ce704d34a70e6fb73ea1d97a3 by Serhiy Storchaka in 
branch 'main':
bpo-47081: Replace "qualifiers" with "quantifiers" in the re module 
documentation (GH-32028)
https://github.com/python/cpython/commit/c6cd3cc93c40363ce704d34a70e6fb73ea1d97a3


--

___
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-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a25a985535ccbb7df8caddc0017550ff4eae5855 by Serhiy Storchaka in 
branch 'main':
bpo-28080: Add support for the fallback encoding in ZIP files (GH-32007)
https://github.com/python/cpython/commit/a25a985535ccbb7df8caddc0017550ff4eae5855


--

___
Python tracker 

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



[issue47081] Replace "qualifiers" with "quantifiers" in the re module documentation

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



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

2022-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset deeaac49e267285158264643799624623f4a7b29 by Christian Heimes in 
branch 'main':
bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)
https://github.com/python/cpython/commit/deeaac49e267285158264643799624623f4a7b29


--

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Thomas Grainger


Change by Thomas Grainger :


--
keywords: +patch
nosy: +graingert
nosy_count: 4.0 -> 5.0
pull_requests: +30134
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/32044

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

You are on own if you create code objects by calling `types.CodeType`.
The docs could be a lot clearer about that, though.

--

___
Python tracker 

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



[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

The `JUMP_ABSOLUTE` doesn't have a line number, as it doesn't correspond to any 
source.

The jump back to the top could follow either the `if i >= 0:` or the `pass`, so 
cannot have a line number.

Don't expect every bytecode to map directly back to the source, especially if 
it cannot raise an exception.

Per-line tracing is well defined by PEP 626. Per-opcode tracing is not.

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



[issue46838] Parameters and arguments parser syntax error improvments

2022-03-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 7d810b6a4eab6eba689acc5bb05f85515478d690 by Pablo Galindo Salgado 
in branch 'main':
bpo-46838: Syntax error improvements for function definitions (GH-31590)
https://github.com/python/cpython/commit/7d810b6a4eab6eba689acc5bb05f85515478d690


--

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

Jack: I've updated the PR, improving compatibility with the "blake3" package on 
PyPI.  I took your notes, and also looked at the C module you wrote.

The resulting commit is here:

https://github.com/python/cpython/pull/31686/commits/37ce72b0444ad63fd1989ad36be5f7790e51f4f1

Specifically:

* derive_key_context is now a string, which I internally encode into UTF-8.

* I added the AUTO member to the module, set to -1.

* max_threads may not be zero; it can be >= 1 or AUTO.

* I added the reset() method.


Some additional thoughts, both on what I did and on what you did:

* In your new() method, your error string says "keys must be 32 bytes".  I went 
with "key must be exactly 32 bytes"; the name of the parameter is "key", and I 
think "exactly" makes the message clearer.

* In my new() method, I complain if the derive_key_context is zero-length.  In 
your opinion, is that a good idea, or is that overly fussy?

* In your copy() method, you hard-code Blake3Type.  It's considered good form 
to use type(self) here, in case the user is calling copy on a user-created 
subclass of Blake3Type.

* In your copy() method, if the original has a lock created, you create a lock 
in the copy too.  I'm not sure why you bother; I leave the lock member 
uninitialized, and let the existing logic create the lock in the copy on demand.

* In the Blake3_methods array, you list the "update" method twice.  I suspect 
this is totally harmless, but it's unnecessary.

--

___
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


New submission from Pieter Eendebak :

Approach is similar to https://github.com/python/cpython/pull/31856 and 
https://github.com/python/cpython/pull/31999

--
components: Interpreter Core
messages: 415762
nosy: pieter.eendebak
priority: normal
severity: normal
status: open
title: Improve performance of list and tuple repeat methods
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



[issue47091] Improve performance of list and tuple repeat methods

2022-03-22 Thread Pieter Eendebak


Change by Pieter Eendebak :


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

___
Python tracker 

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



[issue47084] Statically allocated Unicode objects leak cached representations

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 88872a29f19092d2fde27365af230abd6d301941 by Jeremy Kloth in 
branch 'main':
bpo-47084: Clear Unicode cached representations on finalization (GH-32032)
https://github.com/python/cpython/commit/88872a29f19092d2fde27365af230abd6d301941


--

___
Python tracker 

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



[issue47084] Statically allocated Unicode objects leak cached representations

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

> The newly implemented statically allocated Unicode objects do not clear their 
> cached representations (wstr and utf-8) at exit causing leaked blocks at exit 
> (see also issue46857).

Good job to discover this single leaking memory allocation!!!

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



[issue46857] Python leaks one reference at exit on Windows

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

The last leak of a memory block on Windows was fixed by:

New changeset 88872a29f19092d2fde27365af230abd6d301941 by Jeremy Kloth in 
branch 'main':
bpo-47084: Clear Unicode cached representations on finalization (GH-32032)
https://github.com/python/cpython/commit/88872a29f19092d2fde27365af230abd6d301941

--

___
Python tracker 

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



[issue47045] Remove the RESUME instruction

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 49daf6dba8178c5ae5d4d65408b20566d39c36a8 by Mark Shannon in 
branch 'main':
bpo-47045: Remove `f_state` field (GH-31963)
https://github.com/python/cpython/commit/49daf6dba8178c5ae5d4d65408b20566d39c36a8


--

___
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


Change by Christian Heimes :


--
pull_requests: +30136
pull_request: https://github.com/python/cpython/pull/32046

___
Python tracker 

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



[issue25489] sys.exit() caught in async event loop exception handler

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



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

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

> Is it safe to use `locale.getlocale(locale.LC_CTYPE)[1] or "UTF-8"`?

I would like to deprecate getlocale(), see bpo-43557.

--

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


STINNER Victor  added the comment:

> But some user want to use UTF-8 mode to change default encoding in their 
> Python environments without waiting Python default encoding changed.

IMO it's a different use case and it should be a different thing. Changing 
encoding="locale" today is too late, since it's already shipped in Python 3.10 
(PEP 597).

I proposed the "current locale" name to distinguish it from the existing 
"locale":

* "current locale": LC_CTYPE locale encoding or ANSI code page
* "locale": "UTF-8" in UTF-8 Mode, or the current locale

The unclear part to me is if "current locale" must change if the LC_CTYPE 
locale is changed, or if it should be read once at startup and then never 
change.

There *are* use case to really read the *current* LC_CTYPE locale encoding. 
There is already C API for that:

* PyUnicode_EncodeLocale()
* PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()

See also the "current_locale" parameter of the private API _Py_EncodeLocaleEx() 
and _Py_DecodeLocaleEx().

--

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


STINNER Victor  added the comment:

I propose:

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

  * Implementation: PyConfig.filesystem_encoding
  * https://docs.python.org/dev/library/sys.html#sys.getfilesystemencoding
  * 
https://docs.python.org/dev/glossary.html#term-filesystem-encoding-and-error-handler
  * 
https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.filesystem_encoding

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

  * https://docs.python.org/dev/glossary.html#term-locale-encoding
  * Implementation: _Py_GetLocaleEncoding()
  * Existing *private* function: _locale._get_locale_encoding()

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

  * Implementation: _Py_GetLocaleEncoding() modified to ignore the UTF-8 mode.

None of these functions do locale.setlocale(locale.LC_CTYPE, "") to get the 
user preferred encoding.

Only the locale.getpreferredencoding() function uses 
locale.setlocale(locale.LC_CTYPE, "").

Usage of locale.getpreferredencoding() should be discouraged in the 
documentation, but I don't think that it can be deprecated and scheduled for 
removal right now: too much code rely on it :-(

---

So we have 3 encodings:

* Python filesystem encoding
* Locale encoding
* Current locale encoding

Examples of usage:

* Python filesystem encoding:

  * os.fsdecode() / os.fsencode()
  * C: PyUnicode_EncodeFSDefault() / PyUnicode_DecodeFSDefault()

* Locale encoding

  * _locale._get_locale_encoding()
  * On Unix, os.device_encoding()
  * To initialize PyConfig.stdio_encoding and PyConfig.filesystem_encoding

* Current locale encoding

  * PyUnicode_EncodeLocale() / PyUnicode_DecodeLocale()
  * "current_locale" parameter of private _Py_EncodeLocaleEx() / 
_Py_DecodeLocaleEx()

--

___
Python tracker 

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



[issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x

2022-03-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 673755bfbac46b3cd2c84d7e0d68c2c488e039c3 by Andrew Svetlov in 
branch 'main':
bpo-47076: Make asyncio.Queue stable on slow test boxes (GH-32040)
https://github.com/python/cpython/commit/673755bfbac46b3cd2c84d7e0d68c2c488e039c3


--

___
Python tracker 

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



[issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x

2022-03-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Fixed.

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



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

2022-03-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 32e77154ddfc514a3144d5912bffdd957246fd6c by Andrew Svetlov in 
branch 'main':
bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910)
https://github.com/python/cpython/commit/32e77154ddfc514a3144d5912bffdd957246fd6c


--

___
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 miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46724] Odd Bytecode Generation in 3.10

2022-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

I think this is fixed (for 3.11 at least) by 
https://github.com/python/cpython/pull/31888

--

___
Python tracker 

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



[issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Thank you Andrew!

--

___
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


Change by Andrew Svetlov :


--
pull_requests: +30138
pull_request: https://github.com/python/cpython/pull/32049

___
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: +30139
pull_request: https://github.com/python/cpython/pull/32050

___
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 Jeremy Kloth


Jeremy Kloth  added the comment:

Backports state that they are ready...  I'm just a little uneasy as I've never 
used cherry_picker before.  3.10 went smooth, but 3.9 required manual merging.

--

___
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


New submission from STINNER Victor :

In Python 3.10, it's possible to call PyFrame_FastToLocalsWithError() on a 
frame to get all variables as a dictionary. In Python, getting frame.f_locals 
calls PyFrame_FastToLocalsWithError(). It's used by the pdb module for example:

self.curframe_locals = self.curframe.f_locals

The PyFrame_FastToLocalsWithError() function has multiple issues:

* It's inefficient.
* It may create a Python dictionary.
* It can fail to add items to the dictionary.
* Allocating memory can fail with memory allocation failure.

The problem is that a debugger or profiler should not modify a process when it 
inspects it. It should avoid allocation memory for example. I propose adding a 
new API to prevent that.

In Python 3.11, the PyFrameObject structure became opaque and changed deeply. 
There are differend kinds of variables stored differently:

* Free variables: maybe in frame->f_func->func_closure[index], maybe in 
frame->localsplus[index]
* Fast variable: frame->f_frame->localsplus[index]
* Cell variable: also need to call PyCell_GET()

Well... Look at _PyFrame_FastToLocalsWithError(), it's quite complicated ;-)

I propose to add a new public C API just to get a single variable value:

  PyObject* PyFrame_GetVar(PyFrameObject *frame, PyObject *name)

I prefer to use a PyObject* for the name. You can use PyUnicode_FromString() to 
get a PyObject* from a const char*.

This function would get the value where the variable is stored, it doesn't have 
a to create a dictionary. Return NULL if the variable doesn't exist.

If I understand correctly, it should be possible to ensure that this function 
would never raise an exception (never "fail"). So it should be possible to call 
it even if an exception is raised, which is convenient for a debugger.

--

I plan to implement this API, but first I would like to make sure that there is 
an agreement that such API is needed and helpful ;-)

--

See also draft PEP 558 and PEP 667 which propose API to *modify* variables and 
make sure that they remain consistent when they are set and then get. The scope 
of these PEPs is way wider than the simple propose PyFrame_GetVar() which would 
be simpler implementation than PyFrame_FastToLocalsWithError().

--
components: C API
messages: 415776
nosy: Mark.Shannon, ncoghlan, vstinner
priority: normal
severity: normal
status: open
title: [C API] Add PyFrame_GetVar(frame, name) function
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



[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

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



[issue47076] test_asyncio: test_get_cancelled() fails randomly on x86-64 macOS 3.x

2022-03-22 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Welcome!

--

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

> In Python 3.10, it's possible to call PyFrame_FastToLocalsWithError() on a 
> frame to get all variables as a dictionary.

In 2018, it was decided to *not* document this function: see bpo-19431.

In C, It is possible to call PyObject_GetAttrString(frame, "f_locals") to call 
indirectly _PyFrame_FastToLocalsWithError() and get the dictionary.

--

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

Currently, Tools/gdb/libpython.py uses PyFramePtr.iter_locals() which iterates 
on PyFrameObject.f_frame.localsplus.

There is a PyFramePtr.get_var_by_name() function which only checks for frame 
variables in PyFrameObject.f_frame.localsplus, or look up in globals and 
builtins. So it only supports some kinds of variables.

--

___
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



[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



[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



[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



[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



[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



[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



[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



[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



[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


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



[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



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

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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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

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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



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

See also issue25528.

--

___
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



[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



[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



[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



[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



[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



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

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



  1   2   >