[issue20970] [doc] contradictory documentation for prog option of argparse

2022-02-26 Thread Stanley


Change by Stanley :


--
keywords: +patch
nosy: +slateny
nosy_count: 6.0 -> 7.0
pull_requests: +29725
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31602

___
Python tracker 

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



[issue46869] platform.release() and sys returns wrong version on Windows 11

2022-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

platform.release() returns platform.uname().release, which comes from 
platform.win32_ver() in Windows [1]. The issue with Windows 11 is being 
discussed in bpo-45382, but no PR has been submitted yet to resolve the issue.

> >>> sys.getwindowsversion().platform_version
> (10, 0, 22000)

This result is correct [2], but you should use platform.version() instead. The 
major.minor version of Windows 11 is 10.0. The build number for Windows 11 is 
22000 and above. The latest build number for Windows 10, in contrast, is 19044.

The system version number concerns API compatibility, not user-interface 
updates or marketing names. Windows XP, XP Professional x64 Edition, Vista, 7, 
8, and 8.1 correspond respectively to Windows system versions 5.1, 5.2, 6.0, 
6.1, 6.2, and 6.3. System versions 7.x, 8.x, and 9.x were skipped. Version 10.0 
is the first system version with two client workstation releases, Windows 10 
and Windows 11. It's thus the first time that the build number is required to 
differentiate the release name.

The `platform_version` attribute of the sys.getwindowsversion() result is 
supposed to be the true OS version in case the API is using a 
compatibility-mode version. It's based on the product version of the system 
file "kernel32.dll". However, it turns out that this is also not reliably the 
true OS version. The sys documentation was updated with a note that suggests 
using the platform module instead [3].

---

[1] https://docs.python.org/3/library/platform.html#platform.win32_ver
[2] https://en.wikipedia.org/wiki/Windows_11_version_history#Version_history
[3] https://docs.python.org/3/library/sys.html#sys.getwindowsversion

--
nosy: +eryksun
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> platform() is not able to detect windows 11

___
Python tracker 

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



[issue40124] Clearer assertion error

2022-02-26 Thread Maximilian Hils


Maximilian Hils  added the comment:

I'm pretty sure this issue is a duplicate of bpo-issue29930.

--
nosy: +mhils
versions: +Python 3.10

___
Python tracker 

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



Re: One-liner to merge lists?

2022-02-26 Thread Chris Angelico
On Sun, 27 Feb 2022 at 16:35, Dan Stromberg  wrote:
>
>
> On Fri, Feb 25, 2022 at 3:15 PM Chris Angelico  wrote:
>>
>> But ultimately, that's still the same as sum(), and it's no more
>> readable than chain(), so I'd still be inclined to go with chain and
>> then wrap it in a function if you need the clarity.
>
>
> "Need" the clarity?  Please tell me you don't think clarity is for the feeble 
> minded.
>

It's more about whether you consider that list(chain(...)) is a clear
and readable idiom, or you prefer to give a name to it. Not every
two-operation action needs its own name.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28824] os.environ should preserve the case of the OS keys ?

2022-02-26 Thread Eryk Sun


Eryk Sun  added the comment:

> I think there should be a public class like this.

I wrote a basic implementation of _CaseInsensitiveString under the assumption 
that it's hidden behind the __getitem__(), __setitem__(), and __delitem__() 
methods of the _Environ class. I don't want to complicate the implementation.

The problem of case-insensitive names in file/registry paths and environment 
variables should be addressed with ntpath.normcase(). This should be based on 
WinAPI LCMapStringEx() with LOCALE_NAME_INVARIANT and LCMAP_UPPERCASE. The 
current implementation of ntpath.normcase() uses str.lower(), which depends on 
Python's Unicode database. This possibly differs from what Windows considers to 
be lower case in the invariant locale. It's also wrong because Windows uses 
upper case for cases-insensitive comparisons, which matters when sorting names. 
See bpo-42658.

> Right now, it's not a good workaround because it contains the 
> environment at the time the interpreter was started, not the 
> current environment.

Note that in some cases the "current environment" is the process environment, 
which isn't necessarily consistent with os.environ on any platform.

In POSIX, posix.environ is created from C environ, which is kept in sync with 
changes to posix.environ via C putenv() and unsetenv(). However, directly 
calling os.putenv() or os.unsetenv(), or the underlying C functions, modifies 
the process environment without changing posix.environ. If subprocess.Popen() 
is called without overriding env, the child inherits the process environment, 
not posix.environ.

In Windows, os.environ is created from nt.environ, with variables names 
converted to upper case. nt.environ is created from C _wenviron, which is 
created from the process environment, as returned by WinAPI 
GetEnvironmentStringsW(), except with variable names that begin with "=" 
filtered out. os.putenv() and os.unsetenv() are based on C _wputenv(), which 
updates C _wenviron and also updates the process environment via WinAPI 
SetEnvironmentVariableW(). If either os.putenv() or os.unsetenv() is called 
directly, or _wputenv() at a lower level, then the variables in C _wenviron 
(not just the letter case of the names) will be out of sync with os.environ. 
Additionally, if SetEnvironmentVariableW() is called directly to set or unset a 
variable, then both os.environ and C _wenviron will be out of sync with the 
process environment. If subprocess.Popen() is called without overriding env, 
the child inherits the process environment, not os.environ or C _wenviron.

--

___
Python tracker 

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



Re: One-liner to merge lists?

2022-02-26 Thread Dan Stromberg
On Fri, Feb 25, 2022 at 3:15 PM Chris Angelico  wrote:

> But ultimately, that's still the same as sum(), and it's no more
> readable than chain(), so I'd still be inclined to go with chain and
> then wrap it in a function if you need the clarity.
>

"Need" the clarity?  Please tell me you don't think clarity is for the
feeble minded.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29251] [doc] Class __dict__ is only a mapping proxy

2022-02-26 Thread Stanley


Stanley  added the comment:

>From what I can see, the original patch changed

... and the *dict* dictionary is the namespace containing definitions for class 
body and is copied to a standard dictionary to become the __dict__ attribute

into this

... and the *dict* dictionary is copied to the namespace containing definitions 
for the class body, which is referenced by the __dict__ attribute

so that the documentation avoids saying that the attribute is a dictionary, 
instead saying it just references a dictionary. However, current documentation 
says that

... it may be copied or wrapped before becoming the __dict__ attribute

which implies some sort of change already. In this case, is the patch for the 
functions page still applicable?

--
nosy: +slateny

___
Python tracker 

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



[issue46871] BaseManager.register no longer supports lambda callable 3.8.12+

2022-02-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Works for me in Python 3.10.0 on Linux.

After running your code, I get shared_dict is a DictProxy:

>>> shared_dict

>>> list(shared_dict.items())
[('number', 0), ('text', 'Hello World')]

and shared_lock an AcquirerProxy object.

Please double-check that the code you posted is the actual code that is 
failing, and copy and paste the full traceback you receive, not just a one-line 
summary.

Even if the error is reproducible, I doubt that the cause is what you state in 
the title of this issue:

BaseManager.register no longer supports lambda callable

Lambdas are just functions, they aren't a different type of callable. So the 
register method cannot distinguish between a lambda argument written directly 
in place, and a named def defined earlier then passed by name. So whatever 
error might be happening on your system, I doubt it has anything to do with the 
use of lambda syntax

--
nosy: +steven.daprano

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-26 Thread Tim Peters


Tim Peters  added the comment:

I don't know that there's a good use case for this. For floating addition, 
tree-based summation can greatly reduce total roundoff error, but that's not 
true of floating multiplication.

The advantage for prod(range(2, 50001)) doesn't really stem from turning it 
into a tree reduction, but instead for that specific input sequence "the tree" 
happens to do a decent job of keeping multiplicands more-or-less balanced in 
size (bit length), which eventually allows Karatsuba multiplication to come 
into play. If CPython didn't implement Karatsuba multiplication, tree reduction 
wouldn't improve speed: if the inputs are in sequence xs, regardless how 
school-book multiplication is grouped, or rearranged, the time needed is 
proportional to

sum(a * b for a, b in combinations([x.bit_length() for x in xs], 2))

So if the real point is to speed large products of integers, a different 
approach is wanted: keep track of intermediate products' bit lengths, and at 
each step strive to multiply partial products near the same length. This will 
reliably get Karatsuba into play if possible, and caters too to that Karatsuba 
is most valuable on multiplicands of the same bit length. When any of that 
happens from blind tree reduction, it's down to luck.

I've seen decent results from doing that with a fixed, small array A, which 
(very roughly speaking) combines "the next" integer `i` to multiply with the 
array entry A[i.bit_length().bit_length()] (and continues that with the new 
partial product, & so on, until hitting an array slot containing 1).

--

___
Python tracker 

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



[issue46871] BaseManager.register no longer supports lambda callable 3.8.12+

2022-02-26 Thread Kyle Smith


New submission from Kyle Smith :

The below code works on versions 3.5.2 to 3.8.10. Higher versions tested, such 
as 3.9.12 and 3.10.2 result in the error:
 "AttributeError: Can't pickle local object".


from multiprocessing import Lock
from multiprocessing.managers import AcquirerProxy, BaseManager, DictProxy

def get_shared_state(host, port, key):
shared_dict = {}
shared_lock = Lock()
manager = BaseManager((host, port), key)
manager.register("get_dict", lambda: shared_dict, DictProxy)
manager.register("get_lock", lambda: shared_lock, AcquirerProxy)
try:
manager.get_server()
manager.start()
except OSError:  # Address already in use
manager.connect()
return manager.get_dict(), manager.get_lock()

HOST = "127.0.0.1"
PORT = 35791
KEY = b"secret"
shared_dict, shared_lock = get_shared_state(HOST, PORT, KEY)

shared_dict["number"] = 0
shared_dict["text"] = "Hello World"


This code was pulled from this article: 
https://stackoverflow.com/questions/57734298/how-can-i-provide-shared-state-to-my-flask-app-with-multiple-workers-without-dep/57810915#57810915


I looked around and couldn't find any open or closed bugs for this, so I'm 
sorry in advance if this is new expected behavior.

--
components: Interpreter Core
messages: 414137
nosy: kyle.smith
priority: normal
severity: normal
status: open
title: BaseManager.register no longer supports lambda callable 3.8.12+
type: behavior
versions: Python 3.8

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


Inada Naoki  added the comment:

When removed shash:

```
## small key
$ ./python -m pyperf timeit --compare-to ../cpython/python -s 'd={b"foo":1, 
b"bar":2, b"buzz":3}' -- 'b"key" in d'
/home/inada-n/work/python/cpython/python: . 23.2 ns +- 1.7 
ns
/home/inada-n/work/python/remove-bytes-hash/python: . 40.0 
ns +- 1.5 ns

Mean +- std dev: [/home/inada-n/work/python/cpython/python] 23.2 ns +- 1.7 ns 
-> [/home/inada-n/work/python/remove-bytes-hash/python] 40.0 ns +- 1.5 ns: 
1.73x slower

## large key
$ ./python -m pyperf timeit --compare-to ../cpython/python -s 'd={b"foo":1, 
b"bar":2, b"buzz":3};k=b"key"*100' -- 'k in d'
/home/inada-n/work/python/cpython/python: . 22.3 ns +- 1.2 
ns
/home/inada-n/work/python/remove-bytes-hash/python: . 108 
ns +- 2 ns

Mean +- std dev: [/home/inada-n/work/python/cpython/python] 22.3 ns +- 1.2 ns 
-> [/home/inada-n/work/python/remove-bytes-hash/python] 108 ns +- 2 ns: 4.84x 
slower
```


I will reconsider the removal before remove the cache.
We changed code object too often. If Python 3.13 don't use so much bytes 
objects, we don't need to remove the hash to save some RAM.

--
Added file: https://bugs.python.org/file50649/remove-bytes-hash.patch

___
Python tracker 

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



Re: How to solve the given problem?

2022-02-26 Thread Dennis Lee Bieber
On Sat, 26 Feb 2022 02:49:15 -0800 (PST), NArshad 
declaimed the following:

>Its better to adjust the feed in the coming next two feeds that is the third 
>and fourth one. Thirty or thirty one units in the third feed and the remaining 
>units which are nine or ten in the fourth feed.  

Is there a question in that?

It's your assignment -- you will have to justify your design to whoever
gave you that assignment. So far all you have is a statement with no
justification.

And you really do need to justify the part where you seem to ignore
"distribute the remaining 40 unit in the rest of the day" and "Try to keep
the distribution similar to the current feeding pattern."

If you really wanted to provide a /generalized/ solution then "40
units" will never appear IN THE CODE. A generalized solution would accept
two lines of input: the original/planned schedule (for the whole day) and,
the implemented schedule up to when the mistake was detected. It would then
generate a new schedule for the rest of the day taking into account what
had already been done. (PLANNED and ACTUAL are input, ADJUSTED is output)

PLANNED:15010030303020201055
ACTUAL: 15060

ADJUSTED:   

Note that a generalized solution would handle

PLANNED:15010030303020201055
ACTUAL: 15060  30

ADJUSTED:   

where the mistake was on the second feed, but not discovered until after
the third feed.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: C is it always faster than nump?

2022-02-26 Thread Dennis Lee Bieber
On Fri, 25 Feb 2022 21:44:14 -0800, Dan Stromberg 
declaimed the following:

>Fortran, (still last I heard) did not support pointers, which gives Fortran
>compilers the chance to exploit a very nice class of optimizations you
>can't use nearly as well in languages with pointers.
>
Haven't looked much at Fortran-90/95 then... 

Variable declaration gained a POINTER qualifier, and there is an
ALLOCATE intrinsic to obtain memory.

And with difficulty one could get the result in DEC/VMS FORTRAN-77
since DEC implemented (across all their language compilers) intrinsics
controlling how arguments are passed -- overriding the language native
passing: 
CALL XYZ(%val(M))
would actually pass the value of M, not Fortran default address-of, with
the result that XYZ would use that value /as/ the address of the actual
argument. (Others were %ref() and %descr() -- descriptor being a small
structure with the address reference along with, say, upper/lower bounds;
often used for strings).



-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46845] dict: Use smaller entry for Unicode-key only dict.

2022-02-26 Thread Inada Naoki


Inada Naoki  added the comment:

I added _PyDict_FromItems() to the PR.
It checks that all keys are Unicode or not before creating dict.
_PyDict_NewPresized() just returns general-purpose dict. But it isn't used from 
CPython core. It is just kept for compatibility (for Cython).

```
$ ./python -m pyperf timeit --compare-to ../cpython/python -- '{"k1":1, "k2":2, 
"k3":3, "k4":4, "k5":5, "k6":6}'
/home/inada-n/work/python/cpython/python: . 198 ns +- 5 ns
/home/inada-n/work/python/dict-compact/python: . 213 ns +- 
6 ns

Mean +- std dev: [/home/inada-n/work/python/cpython/python] 198 ns +- 5 ns -> 
[/home/inada-n/work/python/dict-compact/python] 213 ns +- 6 ns: 1.07x slower
```

Overhead of checking keys types is not so large.
Additionally, we can reduce some code from ceval.c.

--

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


Inada Naoki  added the comment:

> But some programs can still work with encoded bytes instead of strings. In 
> particular os.environ and os.environb are implemented as dict of bytes on 
> non-Windows.

This change doesn't affect to os.environ.

os.environ[key] does `key.encode(sys.getfilesystemencoding(), 
"surrogateescape")` internally. So the encoded key doesn't have cached hash.
On the other hand, dict (`self._data`) has own hash cache. So it don't use hash 
cached in the bytes objects.

On the other hand, this change will affect `os.environb[key]` if key is used 
repeatedly.

--

___
Python tracker 

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



[issue46870] Improper Input Validation in urlparse

2022-02-26 Thread Pocas


Pocas  added the comment:

>>> print(urlparse('https:\\google.com'))
ParseResult(scheme='https', netloc='', path='\\google.com', params='', 
query='', fragment='')
>>> print(urlparse('https://google.com@localhost'))
ParseResult(scheme='https', netloc='google.com@localhost', path='', params='', 
query='', fragment='')
>>>

Perhaps this parser is not able to parse the URL normally.

--

___
Python tracker 

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



[issue46870] Improper Input Validation in urlparse

2022-02-26 Thread Pocas


Change by Pocas :


--
type: performance -> security

___
Python tracker 

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



[issue46870] Improper Input Validation in urlparse

2022-02-26 Thread Pocas


New submission from Pocas :

If http:@localhost url is entered as an argument value of the urlpasre() 
function, the parser cannot parse it properly. Since http:@localhost is a valid 
URL, the character after the @ character must be parsed as a hostname.

Python 3.9.10 (main, Jan 15 2022, 11:48:04)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlparse
>>> print(urlparse('http:@localhost'))
ParseResult(scheme='http', netloc='', path='@localhost', params='', query='', 
fragment='')
>>>

--
messages: 414132
nosy: P0cas
priority: normal
severity: normal
status: open
title: Improper Input Validation in urlparse
type: performance
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



[issue46852] Remove the float.__setformat__() method

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5a1c637ec6264790d3cfeef46815c62c32b510f3 by Victor Stinner in 
branch 'main':
bpo-46852: Restore test_getformat() test (GH-31601)
https://github.com/python/cpython/commit/5a1c637ec6264790d3cfeef46815c62c32b510f3


--

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


STINNER Victor  added the comment:

Ah, with PYTHONDUMPREFS=1 (and without -I), I get a negative ref count:

$ PYTHONDUMPREFS=1 ./python -X showrefcount -c pass
[-10 refs, 0 blocks]

I don't plan to investigate this issue. I'm not using PYTHONDUMPREFS=1 anymore.

--

___
Python tracker 

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



[issue46869] platform.release() and sys returns wrong version on Windows 11

2022-02-26 Thread Evernow


New submission from Evernow :

Hello.

On Windows 11 the platform module returns Windows 10 instead of Windows 11, 
same for the sys module. 

Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.release()
'10'
>>> import sys
>>> sys.getwindowsversion().platform_version
(10, 0, 22000)

--
components: Windows
messages: 414129
nosy: Evernow, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: platform.release() and sys returns wrong version on Windows 11
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-26 Thread Ned Deily


Change by Ned Deily :


--
nosy: +mark.dickinson, rhettinger, tim.peters

___
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-02-26 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Did you also modify initconfig.c?  That part is required as the usual
processing of the environment variable PYTHONDUMPREFS needed to enable
tracing output is ignored with -I

--

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

> PEP 587 introduced PyStatus to Python startup code which let the 
> Py_Initialize() caller to decide how to handle errors ;-) For example, you 
> can open a graphical popup rather than killing the process with SIGABRT 
> (Py_FatalError() behavior) which might be more user friendly :-D Or just log 
> the error.

That's up to pycore_interp_init() in pylifecycle.c now. Kumar called 
_PyStatus_ERR() there, so I think nothing more needs to be done.

--

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-26 Thread benrg


New submission from benrg :

math.prod is slow at multiplying arbitrary-precision numbers. E.g., compare the 
run time of factorial(5) to prod(range(2, 50001)).

factorial has some special-case optimizations, but the bulk of the difference 
is due to prod evaluating an expression tree of depth n. If you re-parenthesize 
the product so that the tree has depth log n, as factorial does, it's much 
faster. The evaluation order of prod isn't documented, so I think the change 
would be safe.

factorial uses recursion to build the tree, but it can be done iteratively with 
no advance knowledge of the total number of nodes.

This trick is widely useful for turning a way of combining two things into a 
way of combining many things, so I wouldn't mind seeing a generic version of it 
in the standard library, e.g. reduce(..., order='mid'). For many specific cases 
there are more efficient alternatives (''.join, itertools.chain, set.unions, 
heapq.merge), but it's nice to have a recipe that saves you the trouble of 
writing special-case algorithms at the cost of a log factor that's often 
ignorable.

--
components: Library (Lib)
messages: 414126
nosy: benrg
priority: normal
severity: normal
status: open
title: Improve performance of math.prod with bignums (and functools.reduce?)
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



[issue46857] Python leaks one reference at exit on Windows

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:

I just built Python with --with-trace-refs. On Linux, it works as expected:

$ ./python -I -X showrefcount -c pass 
[0 refs, 0 blocks]

--

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


STINNER Victor  added the comment:

> Initially, I modified Py_INCREF to dump the object (addr & tp_name) on
> initial inc (ob_refcnt == 1) and Py_DECREF to dump on final dec
> (ob_refcnt == 0). Then filter that list (~65K) to find objects not
> dealloc'ed.  Given those names (~200), cross-check with source files
> containing 'ifdef MS_WINDOWS' (and related spellings).

That's smart! Thanks for sharing. It may help to identify future leaks.


> Even using that change, I still have negative refs (but I still have
Py_TRACE_REFS defined)

Ah, maybe testing with Py_TRACE_REFS shows more bugs. I didn't try 
Py_TRACE_REFS recently. Well, if someone finds why it's becoming negative, a 
fix would be welcomed :-)

--

___
Python tracker 

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



[issue46867] difference of work

2022-02-26 Thread grifonice99


Change by grifonice99 :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue46857] Python leaks one reference at exit on Windows

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ad56919c5ed54523f866e6605a2573ab7b7d5235 by Victor Stinner in 
branch 'main':
bpo-46857: Fix refleak in OSError INIT_ALIAS() (GH-31594)
https://github.com/python/cpython/commit/ad56919c5ed54523f866e6605a2573ab7b7d5235


--

___
Python tracker 

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



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

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:

https://docs.python.org/dev/whatsnew/3.11.html#c-api-changes documents the 
addition of the "is_package" member to the _frozen structure, but it doesn't 
mention the new "get_code" member. Can it be also documented?

--
nosy: +vstinner

___
Python tracker 

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



[issue46748] Python.h includes stdbool.h

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e182c660b63bc23420fb9f0593d77a3fa3b7f1c7 by Kumar Aditya in 
branch 'main':
bpo-46748: Fix ctypes test_frozentable() (GH-31600)
https://github.com/python/cpython/commit/e182c660b63bc23420fb9f0593d77a3fa3b7f1c7


--

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:

> The other functions you are calling *do* return errors. You should not ignore 
> those. If any errors are reported the caller can decide what to do (e.g. call 
> Py_FatalError().

PEP 587 introduced PyStatus to Python startup code which let the 
Py_Initialize() caller to decide how to handle errors ;-) For example, you can 
open a graphical popup rather than killing the process with SIGABRT 
(Py_FatalError() behavior) which might be more user friendly :-D Or just log 
the error.

--

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:

commit 0d9b565e62a5fc8c3e9b8c64cce764fe084ccb2b
Author: Kumar Aditya <59607654+kumaraditya...@users.noreply.github.com>
Date:   Sat Feb 26 22:05:03 2022 +0530

Propagate errors (however unlikely) from _Py_Deepfreeze_Init() (GH-31596)

--

___
Python tracker 

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



[issue46867] difference of work

2022-02-26 Thread grifonice99


New submission from grifonice99 :

I was developing a ThreadPool with priority on windows, once done all the tests 
on windows I moved to linux and once I moved it didn't work anymore, because in 
the thread_start function there is the self that doesn't "update", thing that 
it does on windows

--
files: ThreadPool.py
messages: 414118
nosy: grifonice99
priority: normal
severity: normal
status: open
title: difference of work
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file50648/ThreadPool.py

___
Python tracker 

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



[issue46606] Large C stack usage of os.getgroups() and os.setgroups()

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:

> NGROUPS_MAX is 65536 and sizeof(gid_t) is 4 on Ubuntu 20.04, so grouplist is 
> 262144bytes.

Oops, that's a lot! Nicely spotted! Yeah, it's perfectly fine to allocate a 
temporary array on the heap memory. There is no need to micro-optimize this 
function.

Maybe the code was written when NGROUPS_MAX was way smaller (64?).

--

___
Python tracker 

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



[issue46606] Large C stack usage of os.getgroups() and os.setgroups()

2022-02-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e02c47528b31f513d5f5d6eb91b8c9714134cea2 by Victor Stinner in 
branch 'main':
bpo-46606: os.getgroups() doesn't overallocate (GH-31569)
https://github.com/python/cpython/commit/e02c47528b31f513d5f5d6eb91b8c9714134cea2


--

___
Python tracker 

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



[issue46852] Remove the float.__setformat__() method

2022-02-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29724
pull_request: https://github.com/python/cpython/pull/31601

___
Python tracker 

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



[issue28824] os.environ should preserve the case of the OS keys ?

2022-02-26 Thread benrg


benrg  added the comment:

This issue should be marked dependent on issue 43702 or issue 46862, since 
fixing it could break third-party code unless they're fixed first.


> Given 'nt.environ' is available without case remapping, I think that's the 
> best workaround.

Right now, it's not a good workaround because it contains the environment at 
the time the interpreter was started, not the current environment. On Posix, 
_Environ takes a reference to posix.environ and uses it directly, so it does 
get updated. On Windows, _Environ gets a rewritten dictionary and nt.environ is 
just a space-wasting attractive nuisance. I think it should be replaced with 
getenviron() which builds a dict from the environment block each time it's 
called. But posix.environ is documented (though nt.environ isn't), so maybe not.


> class _CaseInsensitiveString(str):

I think there should be a public class like this. It could be useful to 
email.message.Message and its clients like urllib. They currently store headers 
in a list and every operation is O(n).

The semantics are tricky. As written, it violates the requirement that equal 
objects have equal hashes. To fix that, you'd have to make every CIS compare 
unequal to every str. At that point, it probably shouldn't be a str subclass, 
which also has the advantage that it's not limited to strings. It can be a 
generic compare-by-key wrapper.

--
nosy: +benrg

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2022-02-26 Thread Brett Cannon


Brett Cannon  added the comment:

For me it took `docker run -v (pwd):/src quay.io/tiran/cpython_autoconf` (on 
fish and didn't run `docker pull` ahead of time).

@tiran are you  okay if we document your image and how to run it at 
https://devguide.python.org/setup/?highlight=autoconf#regenerate-configure ?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue46849] Memory problems detected using Valgrind

2022-02-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Posting a thousand line message makes following a discussion extremely 
difficult.  Move it into an attachment, if you did not do that already, and 
delete the message by 'editing' it.  As I said, I cannot otherwise respond to 
this.

--

___
Python tracker 

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



[issue13821] [doc] misleading return from isidentifier

2022-02-26 Thread Stanley


Stanley  added the comment:

For clarification then, would it be accurate to add a sentence like this in the 
documentation?

"Note that isidentifier() still returns True even if the string may not be 
normalized."

--
nosy: +slateny

___
Python tracker 

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



[issue46430] intern strings in deepfrozen modules

2022-02-26 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue42760] inspect.iscoroutine returns False for asynchronous generator methods

2022-02-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be a duplicate of https://bugs.python.org/issue37190

--
nosy: +xtreak

___
Python tracker 

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



[issue46777] Fix incorrect use of directives in asyncio documentation

2022-02-26 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue46661] Duplicate deprecation warnings in docs for asyncio

2022-02-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks! Marking as duplicate.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Fix incorrect use of directives in asyncio documentation

___
Python tracker 

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



[issue46847] functools.update_wrapper doesn't understand partial objects and annotations

2022-02-26 Thread Éric Araujo

Change by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue46748] Python.h includes stdbool.h

2022-02-26 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303
nosy_count: 5.0 -> 6.0
pull_requests: +29723
pull_request: https://github.com/python/cpython/pull/31600

___
Python tracker 

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



[issue46833] Windows installer is unclear and has redundant settings

2022-02-26 Thread Éric Araujo

Change by Éric Araujo :


Removed file: https://bugs.python.org/file50645/タイピング練習 
(日本語編)|Benesseの大学・短期大学・専門学校の受験、進学情報.pdf

___
Python tracker 

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



[issue46833] Windows installer is unclear and has redundant settings

2022-02-26 Thread Éric Araujo

Change by Éric Araujo :


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

___
Python tracker 

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



Re: C is it always faster than nump?

2022-02-26 Thread Neil
Dan Stromberg  wrote:
> On Fri, Feb 25, 2022 at 8:12 AM BELAHCENE Abdelkader <
> abdelkader.belahc...@enst.dz> wrote:
> 
>> Hi,
>> a lot of people think that C (or C++) is faster than python, yes I agree,
>> but I think that's not the case with numpy, I believe numpy is faster than
>> C, at least in some cases.
>>
> 
> This is all "last time I heard".
> 
> numpy is written, in significant part, in Fortran.
> 
> Fortran, especially for matrix math with variable dimensions, can be faster
> than C.
> 
> Fortran, (still last I heard) did not support pointers, which gives Fortran
> compilers the chance to exploit a very nice class of optimizations you
> can't use nearly as well in languages with pointers.
> 
> I used to code C to be built with the "noalias" optimization, to get much
> of the speed of Fortran in C.  But it required using an error prone subset
> of C without good error detection.

Pointers were introduced in Fortran 90.

Neil.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to check if there is internet?

2022-02-26 Thread Robert Latest via Python-list
Chris Angelico wrote:
> Every language learns from every other.

Except Visual Basic, which didn't learn anything from anywhere, and all that
can be learned from it is how not to do it. Ugh.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42760] inspect.iscoroutine returns False for asynchronous generator methods

2022-02-26 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303

___
Python tracker 

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



[issue45159] data_received called on protocol after call to pause_reading on ssl transport

2022-02-26 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue46318] asyncio and ssl: ResourceWarning: unclosed transport

2022-02-26 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions:  -Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue46318] asyncio and ssl: ResourceWarning: unclosed transport

2022-02-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Awesome!

--

___
Python tracker 

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



Re: PYT - The expressions described in the Python language reference yield only boolean values

2022-02-26 Thread Peter J. Holzer
On 2022-02-19 23:28:28 +0100, vanyp wrote:
> *I am trying to learn Python from the grammar given in the Python language
> reference and I am surprised.*
> 
> *Lets start here:*
> 
> *"*
> *6.3.4. Calls*
> 
> A call calls a callable object (e.g., a function
> ) with a possibly
> empty series of arguments
> :
> 
> *call *::= |primary 
> |"("
> [|argument_list 
> |[","]
> | |comprehension 
> |]

With all those links this is very hard to read. Please try to format
your mails in a way that makes them easy to follow.

[...][

> *The first or_test is strange, I assume it should be replaced by expression.*

Nope.

> *But even so I think that the only ways out of the recursion are the or_test
> or the lambda_expr.*
> 
> *And by the grammar, those evaluate to booleans as follows:*

No. A grammar specifies how to parse the text, it doesn't say anything
about the types of these expressions (especially not in a dynamically
typed language like python). 

> *Where did I, or the language reference, go wrong?*

First, you neglected the difference between parsing an expression and
evaluating it.

Secondly, you didn't see the way out. 

For example, let's parse the expression

«f(1+2, 3)»

Can this be a call?

To confirm this, is has to match 

call ::=  primary "(" [argument_list [","] | comprehension] 
")"

which looks plausible, so let's dive in:

primary ::=  atom | attributeref | subscription | slicing | call

atom  ::=  identifier | literal | enclosure

identifier   ::=  xid_start xid_continue*

«f» is an identier which is an atom which is a primary.

Good so far. Now for the argument-list:

argument_list::=  positional_arguments ["," starred_and_keywords] 
...

positional_arguments ::=  positional_item ("," positional_item)*

We have two comma-separated items, good so far. Check «1+2» first

positional_item  ::=  assignment_expression | "*" expression

assignment_expression ::=  [identifier ":="] expression

expression ::=  conditional_expression | lambda_expr

conditional_expression ::=  or_test ["if" or_test "else" expression]

or_test  ::=  and_test | or_test "or" and_test

and_test ::=  not_test | and_test "and" not_test

not_test ::=  comparison | "not" not_test

comparison::=  or_expr (comp_operator or_expr)*

or_expr  ::=  xor_expr | or_expr "|" xor_expr

xor_expr ::=  and_expr | xor_expr "^" and_expr

and_expr ::=  shift_expr | and_expr "&" shift_expr

shift_expr ::=  a_expr | shift_expr ("<<" | ">>") a_expr

a_expr ::=  m_expr | a_expr "+" m_expr | a_expr "-" m_expr

Oof. That was a deep recursion, but we finally found a «+». 
So 1 must be an a_expr and 2 an m_expr. Actually recursing once more reveals
that both can be m_expr:

m_expr ::=  u_expr | m_expr "*" u_expr | m_expr "@" m_expr | ...

u_expr ::=  power | "-" u_expr | "+" u_expr | "~" u_expr

power ::=  (await_expr | primary) ["**" u_expr]

primary ::=  atom | attributeref | subscription | slicing | call

atom  ::=  identifier | literal | enclosure

literal ::=  stringliteral | bytesliteral | integer | floatnumber | 
imagnumber

Ok, they are both integer. 

Then we do basically the same for the second argument and we arrive at
the parse tree:

[warning: fixed width font required]

call
  |
   ---+--
  //  |   \
  ||argument_list  |
  ||positional_arguments   |
  ||   /  | \  |
  ||   positional_item| positional_item|
  ||   assignment_expression  | assignment_expression  |
  ||   expression | expression |
  ||   conditional_expression | conditional_expression |
  ||   or_test| or_test|
  ||   and_test   | and_test   |
  ||   not_test   | not_test   |
  ||   comparison | comparison |
  ||   or_expr| or_expr|
  ||   xor_expr   | xor_expr   |
  ||   and_expr   | and_expr   |
  ||   shift_expr | shift_expr |
  |  

[issue46855] printing a string with strange characters loops forever

2022-02-26 Thread Éric Araujo

Éric Araujo  added the comment:

Note that the original issue seems to be that you had bytes but pasted it as a 
unicode string.  This works:

>>> b = b'Betrag gr\xc3\xb6\xc3\x9fer als Betrag der Original-Transaktion'
>>> s = b.decode('utf-8')
>>> print(s)
Betrag größer als Betrag der Original-Transaktion

--
nosy: +eric.araujo

___
Python tracker 

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



[issue45533] loop.sock_connect doesn't resolve the address parameter on Windows

2022-02-26 Thread Kumar Aditya


Kumar Aditya  added the comment:

Can you provide a minimal reproducer otherwise it is hard to know if there is 
any bug.

--
nosy: +kumaraditya303

___
Python tracker 

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



[issue45159] data_received called on protocol after call to pause_reading on ssl transport

2022-02-26 Thread Kumar Aditya


Kumar Aditya  added the comment:

Since https://bugs.python.org/issue44011 is fixed, this can be closed now.

--
nosy: +kumaraditya303

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-26 Thread Adam

Adam  added the comment:

Yes agreed, it may well be a Pyenv issue. Interestingly we can demonstrate that 
the global OpenSSL crypto policies is respected with the 3.9.10 version, 
through adjusting the policy. The ssl error occurs with the default policy 
setting and is resolved with the legacy policy setting. With 3.10.2 this is no 
longer the case. I can’t see any obvious changes to the build recipe that would 
cause this.

--

___
Python tracker 

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



[issue46661] Duplicate deprecation warnings in docs for asyncio

2022-02-26 Thread Kumar Aditya


Kumar Aditya  added the comment:

This was fixed in https://github.com/python/cpython/pull/31388, so this can be 
closed now.

--
nosy: +kumaraditya303

___
Python tracker 

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



[issue46318] asyncio and ssl: ResourceWarning: unclosed transport

2022-02-26 Thread Kumar Aditya


Kumar Aditya  added the comment:

@asvetlov I tested it on main branch and indeed it is fixed on main branch with 
https://bugs.python.org/issue44011.

--

___
Python tracker 

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



[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 41ddcd3f40f8171a396e57b841a74fcc83884eab by Kumar Aditya in 
branch 'main':
bpo-44011: Document ssl_shutdown_timeout added by revisited asyncio SSL 
implementation  (GH-31597)
https://github.com/python/cpython/commit/41ddcd3f40f8171a396e57b841a74fcc83884eab


--

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-26 Thread Christian Heimes


Christian Heimes  added the comment:

This is a pyenv issue, not a Python issue. Custom builds of OpenSSL typically 
do not and cannot use global settings like crypto policies. They are missing 
distro downstream patches and use different config files.

--

___
Python tracker 

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



[issue46849] Memory problems detected using Valgrind

2022-02-26 Thread tongxiaoge

tongxiaoge  added the comment:

I also installed Python3.7.9、Python3. 8.5 tested and found no problems.

--

___
Python tracker 

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



[issue46849] Memory problems detected using Valgrind

2022-02-26 Thread tongxiaoge


tongxiaoge  added the comment:

The latest version is also problematic (Python 3.11.0a5). The above is the 
output stack information. Here are the steps to reproduce:

1. iotop -b -n 10 &

2. valgrind --leak-check=full /usr/sbin/iotop -b -n 5 > iotop_ test

--
Added file: 
https://bugs.python.org/file50647/stack-information_python3.11.0a5.txt

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-26 Thread Adam


Adam  added the comment:

I found the Python build recipes and Pyenv does appear to install OpenSSL from 
source. The only difference I can see, aside from the Python version, is an 
update on the OpenSSL versions; openssl-1.1.1l (3.9.10) to openssl-1.1.1k 
(3.10.2). The OpenSSL release notes do not appear to suggest anything relevant.

https://github.com/pyenv/pyenv/blob/master/plugins/python-build/share/python-build/3.10.2

https://github.com/pyenv/pyenv/blob/master/plugins/python-build/share/python-build/3.9.10

https://github.com/pyenv/pyenv/blob/master/plugins/python-build/bin/python-build

https://www.openssl.org/news/openssl-1.1.1-notes.html

--

___
Python tracker 

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



Re: PYT - How can I subscribe to a topic in the mailing list?

2022-02-26 Thread Peter J. Holzer
On 2022-02-21 12:19:36 +0100, vanyp wrote:
> The option to filter by topic is offered in the mailing list subscription
> customization page, although no option list is given. Topics may have been a
> project that was never implemented.

Topics are a rarely used feature of the mailman mailing list software.
The administrator can configure topics and regular expression to
recognize them. Then mailman will scan each message it received to
assign one or more topics to it. As far as I know I have never been on a
mailinglist where the administrator had configured topics. It seems like
one of those features that seemed like a good idea to the developers but
aren't really used by anyone in practice.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46864] Deprecate ob_shash in BytesObject

2022-02-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it is a legacy of Python 2. Attributes and variable names are Unicode 
strings in Python 3, so the main reason of this optimization is no longer 
relevant.

But some programs can still work with encoded bytes instead of strings. In 
particular os.environ and os.environb are implemented as dict of bytes on 
non-Windows.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: Best way to check if there is internet?

2022-02-26 Thread Peter J. Holzer
On 2022-02-22 12:31:42 +0400, Abdur-Rahmaan Janhangeer wrote:
> A front end eng sent me this for how to check for the internet in JS
> 
> https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-online
> 
> But it also says:
> 
> "This attribute is inherently unreliable. A computer can be connected to a
> network without having Internet access."

That actually checks whether the browser is in offline mode. You can set
this mode (in Firefox at least) via File -> Work offline. The browser
will also monitor network interfaces and switch to offline mode if none
(except loopback) are up. But fundamentally it's about the state of the
browser ("... must return false if the user agent will not contact the
network ...") not about whether your computer has "internet access" in
any meaningful sense.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue46866] bytes class extension with slices

2022-02-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it is consistent with all of builtin types. If you want to return a 
different type, override __getitem__().

--
nosy: +serhiy.storchaka
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



[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2022-02-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b57dbe5d1be925b99f16fe5893e339f92fc05888 by Thomas Grainger in 
branch 'main':
bpo-38415: Remove redundant AsyncContextDecorator.__call__ override from 
_AsyncGeneratorContextManager (GH-30233)
https://github.com/python/cpython/commit/b57dbe5d1be925b99f16fe5893e339f92fc05888


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-26 Thread Adam

Adam  added the comment:

Thanks for the quick reply. On both Ubuntu and Centos, I’m installing Python 
using Pyenv, testing with 3.9.10 and 3.10.2. Pyenv provides a verbose install 
flag, I can rebuild the Python versions and review the build commands, if 
helpful? I’m testing with clean Linux distributions and I believe there is only 
one OpenSSL installed and available. I don’t know if it’s possible to gain more 
details from the Python ssl module to confirm? I did confirm the OpenSSL 
versions aligns using ssl.OPENSSL_VERSION.

Command: pyenv install 3.10.2 --verbose

https://github.com/pyenv/pyenv

--

___
Python tracker 

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



[issue46866] bytes class extension with slices

2022-02-26 Thread Sec


New submission from Sec :

When trying to extend the builtin bytes class, slices fall back to the builtin 
class.

```
class my_bytes(bytes):
  def dummy(self):
print("dummy called")


x=my_bytes.fromhex("c0de c0de")
print(x.__class__)

print(x[1:].__class__)

```

x.__class__ returns  as expected.

But x[1:].__class__ returns 

--
components: Interpreter Core
files: bytes_test.py
messages: 414092
nosy: Sec42
priority: normal
severity: normal
status: open
title: bytes class extension with slices
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50646/bytes_test.py

___
Python tracker 

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



[issue46845] dict: Use smaller entry for Unicode-key only dict.

2022-02-26 Thread Inada Naoki


Inada Naoki  added the comment:

In most case, first PyDict_SetItem decides which format should be used.

But _PyDict_NewPresized() can be a problem. It creates a hash table before 
inserting the first key, when 5 < (expected size) < 87382.

In CPython code base, _PyDict_NewPresized() is called from three places:

1. call.c: Building kwargs dict -- all key should be Unicode.
2. ceval.c: BUILD_MAP and BUILD_CONST_KEY_MAP -- there is no guarantee that all 
keys are Unicode.


Current pull request assumes the dict keys are unicode-only key. So building 
dict from non-Unicode keys become slower.

```
$ ./python -m pyperf timeit --compare-to ../cpython/python -- '{(1,2):3, 
(4,5):6, (7,8):9, (10,11):12, (13,14):15, (16,17):18}'
/home/inada-n/work/python/cpython/python: . 233 ns +- 1 ns
/home/inada-n/work/python/dict-compact/python: . 328 ns +- 
6 ns

Mean +- std dev: [/home/inada-n/work/python/cpython/python] 233 ns +- 1 ns -> 
[/home/inada-n/work/python/dict-compact/python] 328 ns +- 6 ns: 1.41x slower
```

There are some approaches to fix this problem:

1. Don't use _PyDict_NewPresized() in BUILD_MAP, BUILD_CONST_KEY_MAP

```
$ ./python -m pyperf timeit --compare-to ../cpython/python -- '{(1,2):3, 
(4,5):6, (7,8):9, (10,11):12, (13,14):15, (16,17):18}'
/home/inada-n/work/python/cpython/python: . 233 ns +- 1 ns
/home/inada-n/work/python/dict-compact/python: . 276 ns +- 
1 ns

Mean +- std dev: [/home/inada-n/work/python/cpython/python] 233 ns +- 1 ns -> 
[/home/inada-n/work/python/dict-compact/python] 276 ns +- 1 ns: 1.18x slower
```

I think this performance regression is acceptable level.

2. Add an argument `unicode` to _PyDict_NewPresized(). -- Breaks some 3rd party 
codes using internal APIs.
3. Add a new internal C API such that _PyDict_NewPresizedUnicodeKey(). -- Most 
conservative.
4. Add a new internal C API that creates dict form keys and values for extreme 
performance, like this:

// Create a new dict from keys and values.
// Items are received as `{keys[i*keys_offset]: values[i*values_offset] for i 
in range(length)}`.
// When distinct=1, this function skips checking duplicated keys.
// So pass distinct=1 unless you can guarantee that there is no duplicated keys.
PyObject *
PyDict_FromKeysAndValues(PyObject **keys, Py_ssize_t keys_offset, PyObject 
**values, Py_ssize_t values_offset, Py_ssize_t lenghh, int distincit)
{
}

--

___
Python tracker 

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-26 Thread Norman Fung


Norman Fung  added the comment:

I think this will work, i need to test further but it seems to work on
python 3.8.5. I think the prev fix didnt really fix it. And the core of the
problem was " _done_callback" fired before "outer" was defined by "
_GatheringFuture" .  Have a look at "Look here" below.
Let me know if you agree, or otherwise. Thanks

def gather(*coros_or_futures, loop=None, return_exceptions=False):
if not coros_or_futures:
if loop is None:
loop = events.get_event_loop()
else:
warnings.warn("The loop argument is deprecated since Python
3.8, "
  "and scheduled for removal in Python 3.10.",
  DeprecationWarning, stacklevel=2)
outer = loop.create_future()
outer.set_result([])
return outer

def _done_callback(fut):
while not outer: < Look here
print(f"scream ... you can't just return")

nonlocal nfinished
nfinished += 1

if outer.done():
if not fut.cancelled():
# Mark exception retrieved.
fut.exception()
return

if not return_exceptions:
if fut.cancelled():
# Check if 'fut' is cancelled first, as
# 'fut.exception()' will *raise* a CancelledError
# instead of returning it.
exc = exceptions.CancelledError()
outer.set_exception(exc)
return
else:
exc = fut.exception()
if exc is not None:
outer.set_exception(exc)
return

if nfinished == nfuts:
# All futures are done; create a list of results
# and set it to the 'outer' future.
results = []

for fut in children:
if fut.cancelled():
# Check if 'fut' is cancelled first, as
# 'fut.exception()' will *raise* a CancelledError
# instead of returning it.
res = exceptions.CancelledError()
else:
res = fut.exception()
if res is None:
res = fut.result()
results.append(res)

if outer._cancel_requested:
# If gather is being cancelled we must propagate the
# cancellation regardless of *return_exceptions* argument.
# See issue 32684.
outer.set_exception(exceptions.CancelledError())
else:
outer.set_result(results)

arg_to_fut = {}
children = []
nfuts = 0
nfinished = 0
outer = None < Look here, need at least define the variable
for arg in coros_or_futures:
if arg not in arg_to_fut:
fut = ensure_future(arg, loop=loop)
if loop is None:
loop = futures._get_loop(fut)
if fut is not arg:
# 'arg' was not a Future, therefore, 'fut' is a new
# Future created specifically for 'arg'.  Since the caller
# can't control it, disable the "destroy pending task"
# warning.
fut._log_destroy_pending = False

nfuts += 1
arg_to_fut[arg] = fut
fut.add_done_callback(_done_callback) < Look here,
_done_callback fired before _GatheringFuture got a chance to return
"outer"!?

else:
# There's a duplicate Future object in coros_or_futures.
fut = arg_to_fut[arg]

children.append(fut)

outer = _GatheringFuture(children, loop=loop)   < Look here,
"outer" defined only here.
return outer

On Sat, Feb 26, 2022 at 4:56 PM Norman Fung  wrote:

>
> Norman Fung  added the comment:
>
> I tried hacking tasks.py (After revert back to Python 3.8.5), it
> didn't work: Error disappeared, but essentially the program execution
> freezed.
>
> def _done_callback(fut):
> ... more ...
>
> try: outer
> except NameError: outer = None
> if outer is None or outer.done():
> if not fut.cancelled():
> # Mark exception retrieved.
> fut.exception()
> return
> ... more code here ...
>
> arg_to_fut = {}
> children = []
> nfuts = 0
> nfinished = 0
> outer = None=> added
> for arg in coros_or_futures:
> if arg not in arg_to_fut:
> fut = ensure_future(arg, loop=loop)
>
> Reference: https://github.com/python/cpython/pull/31441/files
>
> On Sat, Feb 26, 2022 at 3:44 PM Norman Fung 
> wrote:
>
> >
> > Norman Fung  added the comment:
> >
> > Also, i reverted back to python 3.8.5 and overwrote task.py as
> recommended.
> > I think that version we dont already have "GenericAlias".
> >
> > import asyncio
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\__init__.py", 

[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-26 Thread Christian Heimes


Christian Heimes  added the comment:

How did you build Python 3.10? Neither CentOS 8 nor Ubuntu 20.04 come with 
Python 3.10. Does your build of Python use system's OpenSSL build?

--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See the grammar. 
https://docs.python.org/3/reference/expressions.html#conditional-expressions


conditional_expression ::=  or_test ["if" or_test "else" expression]
expression ::=  conditional_expression | lambda_expr

`*()` is not an expression. It is either a starred_item (which can be a part of 
starred_list or a starred_expression), or a positional_item or a 
starred_and_keywords which are parts of an argument_list. None of them are 
expressions.

`foo(*(stri,) if stri else x)` is interpreted as `foo(*((stri,) if stri else 
x))` if x is an expression. But `*()` is not an expression, thus a syntax error.

--

___
Python tracker 

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



[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Robert Spralja


Robert Spralja  added the comment:

I understand that it's invalid synatax, but not why.

On Sat, 26 Feb 2022 at 10:07, Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> It is an invalid syntax. Write foo(*((stri,) if stri else ())).
>
> --
> nosy: +serhiy.storchaka
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is an invalid syntax. Write foo(*((stri,) if stri else ())).

--
nosy: +serhiy.storchaka
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



[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Robert Spralja


New submission from Robert Spralja :

`
>>> def foo(num=1):
... return num
...
>>> foo(*(bool,) is bool else *())
  File "", line 1
foo(*(bool,) is bool else *())
 ^
SyntaxError: invalid syntax
>>> foo(*(bool,) if bool else *())
  File "", line 1
foo(*(bool,) if bool else *())
  ^
SyntaxError: invalid syntax
>>> def foo(num=1):
... return num
...
>>> stri = ''
>>> foo(*(stri,) if stri else *())
  File "", line 1
foo(*(stri,) if stri else *())
  ^
SyntaxError: invalid syntax
>>> foo(*((stri,) if stri else ()))
1
>>>
`

Iterable unpacking of empty tuple seems to not work in one example but does in 
another.

--
messages: 414085
nosy: spralja
priority: normal
severity: normal
status: open
title: *() Invalid Syntax: iterable unpacking of empty tuple
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



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

2022-02-26 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +29722
pull_request: https://github.com/python/cpython/pull/31599

___
Python tracker 

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



[issue28824] os.environ should preserve the case of the OS keys ?

2022-02-26 Thread Larry Hastings


Change by Larry Hastings :


--
nosy:  -larry, loewis

___
Python tracker 

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



[issue46859] NameError: free variable 'outer' referenced before assignment in enclosing scope

2022-02-26 Thread Norman Fung


Norman Fung  added the comment:

I tried hacking tasks.py (After revert back to Python 3.8.5), it
didn't work: Error disappeared, but essentially the program execution
freezed.

def _done_callback(fut):
... more ...

try: outer
except NameError: outer = None
if outer is None or outer.done():
if not fut.cancelled():
# Mark exception retrieved.
fut.exception()
return
... more code here ...

arg_to_fut = {}
children = []
nfuts = 0
nfinished = 0
outer = None=> added
for arg in coros_or_futures:
if arg not in arg_to_fut:
fut = ensure_future(arg, loop=loop)

Reference: https://github.com/python/cpython/pull/31441/files

On Sat, Feb 26, 2022 at 3:44 PM Norman Fung  wrote:

>
> Norman Fung  added the comment:
>
> Also, i reverted back to python 3.8.5 and overwrote task.py as recommended.
> I think that version we dont already have "GenericAlias".
>
> import asyncio
>   File "C:\ProgramData\Anaconda3\lib\asyncio\__init__.py", line 8, in
> 
> from .base_events import *
>   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 45, in
> 
> from . import staggered
>   File "C:\ProgramData\Anaconda3\lib\asyncio\staggered.py", line 11, in
> 
> from . import tasks
>   File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 20, in
> 
> from types import GenericAlias
> ImportError: cannot import name 'GenericAlias' from 'types'
> (C:\ProgramData\Anaconda3\lib\types.py)
>
> On Sat, Feb 26, 2022 at 3:20 PM Norman Fung 
> wrote:
>
> >
> > Norman Fung  added the comment:
> >
> > Thanks Andrew for heads up.
> >
> > *1. My laptop (Windows 10) *with no changes runs happily with no error
> from
> > here.
> > python 3.8.5
> > asyncio 3.4.3
> >
> > 2. *My Windows VM (AWS EC2)* is where the whole mess is happening. I
> > *upgraded
> > *from Python 3.8.5 to 3.9.7. Asynio stayed 3.4.3, no change.
> >
> > I manually overwrite C:\ProgramData\Anaconda3\Lib\asyncio\task.py with
> > what's here https://github.com/python/cpython/pull/31441/files
> > (Only
> >
> >
> https://github.com/asvetlov/cpython/blob/150ef068c77abc6a5e7ba97397ac65113dba355a/Lib/asyncio/tasks.py
> > )
> >
> > Before I made this change, the error was:
> >   File "src\xxx\xxx.py", line 37, in _invoke_runners
> > one_loop.run_until_complete(runner.xxx(xxx, xxx))
> >   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> > 90, in run_until_complete
> > self._run_once()
> >   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> > 127, in _run_once
> > handle._run()
> >   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> > 196, in run
> > ctx.run(self._callback, *self._args)
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 356, in
> > _set_state
> > _copy_future_state(other, future)
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 335, in
> > _copy_future_state
> > dest.set_result(result)
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 237, in
> > set_result
> > self.__schedule_callbacks()
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\futures.py", line 149, in
> > __schedule_callbacks
> > self._loop.call_soon(callback, self, context=ctx)
> > Traceback (most recent call last):
> >   File "C:\ProgramData\Anaconda3\lib\site-packages\nest_asyncio.py", line
> > 196, in run
> > ctx.run(self._callback, *self._args)
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 762, in
> > _done_callback
> > if outer.done():
> > NameError: free variable 'outer' referenced before assignment in
> enclosing
> > scope
> >
> > After I upgraded python to 3.9.7 and overwrite task.py, a different error
> > (but also in asyncio stack):
> >
> > 2022-02-26 06:48:27,047 casin0: @slack algo_order.id: 13 #8 Algo tick
> > level
> > error casin0 uat  Non-thread-safe operation invoked
> > on an event loop other than the current one Traceback (most recent call
> > last):
> >   File "C:\dev\xxx.py", line 547, in xxx
> > await asyncio.sleep(algo.param.interval_ms / 1000)
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 651, in
> sleep
> > h = loop.call_later(delay,
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 714,
> in
> > call_later
> > timer = self.call_at(self.time() + delay, callback, *args,
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 727,
> in
> > call_at
> > self._check_thread()
> >   File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 785,
> in
> > _check_thread
> > raise RuntimeError(
> > RuntimeError: Non-thread-safe operation invoked on an event loop other
> than
> > the current one
> >
> > On Sat, Feb 26, 2022 at 2:36 PM Andrew Svetlov 
> > wrote:
> >
> > >
> > > Andrew Svetlov  added the comment:
> > >
> > > Also, fix is 1 week old. 

[issue46864] Deprecate ob_shash in BytesObject

2022-02-26 Thread Inada Naoki


Change by Inada Naoki :


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

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


New submission from Inada Naoki :

Code objects have more and more bytes attributes for now.
To reduce the RAM by code, I want to remove ob_shash (cached hash value) from 
bytes object.

Sets and dicts have own hash cache.
Unless checking same bytes object against dicts/sets many times, this don't 
cause big performance loss.

--
components: Interpreter Core
messages: 414083
nosy: methane
priority: normal
severity: normal
status: open
title: Deprecate ob_shash in BytesObject
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



[issue46833] Windows installer is unclear and has redundant settings

2022-02-26 Thread 各務優汰

各務優汰  added the comment:

bっっっhbhyh

--
nosy: +h30-04213
Added file: https://bugs.python.org/file50645/タイピング練習 
(日本語編)|Benesseの大学・短期大学・専門学校の受験、進学情報.pdf

___
Python tracker 

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



[issue46833] Windows installer is unclear and has redundant settings

2022-02-26 Thread Christian Buhtz


Christian Buhtz  added the comment:

Dear Steve,
thanks for your feedback. I did not understand all details of your design 
decisions but I am OK with that.

Variant A is fine for me, too. The important to points of A for me are 1) that 
the checkboxes on page 1 are moved up directly under the "Install Now" to make 
clear where they belong to and 2) the (easier to understand) separation between 
interpreter- (page2) and launcher-settings (page3).

My apologize but I am not able to create PRs/patches. I am not familiar with 
your development environment and not able to invest time to learn it because in 
the feature it does not seems like I will create more patches for something 
because I do not have the expertise for a python interpreter.

But I understand that is a question of resources. If there are currently now 
resources I would recommend to keep this ticket open.

--

___
Python tracker 

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



[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2022-02-26 Thread Kumar Aditya


Change by Kumar Aditya :


--
type:  -> enhancement
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2022-02-26 Thread Kumar Aditya


Kumar Aditya  added the comment:

This has been fixed in the main branch since 
https://github.com/python/cpython/pull/31275, this can be closed now.

--
nosy: +kumaraditya303

___
Python tracker 

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