[issue45889] pathlib: Path.match does not work on paths

2021-11-23 Thread Nick Papior


New submission from Nick Papior :

The documentation of Path.match only says it will match a pattern.

But quite often this pattern may be desirable to have as a Path as well.

import pathlib as pl

path = pl.Path("foo/bar")
print(path.match("bar"))
print(path.match(pl.Path("bar")))

However, the last one fails and one has to resort to 

print(path.match(str(pl.Path("bar"

which in my opinion is a little misleading.

I couldn't find any other bug/enhancement report of this. Also, this probably 
also targets later versions.

--
components: Library (Lib)
messages: 406910
nosy: nickpapior
priority: normal
severity: normal
status: open
title: pathlib: Path.match does not work on paths
type: enhancement
versions: Python 3.6, 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



[issue45514] Deprecate legacy functions from importlib.resources (importlib_resources 5.3)

2021-11-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

See 
https://discuss.python.org/t/deprecating-importlib-resources-legacy-api/11386 
for some lively discussion on this deprecation.

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



[issue45514] Deprecate legacy functions from importlib.resources (importlib_resources 5.3)

2021-11-23 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset d5cd2effa69551c6bc7edfef8a414d545dea9117 by Jason R. Coombs in 
branch 'main':
bpo-45514: Deprecate importlib resources legacy functions. (GH-29036)
https://github.com/python/cpython/commit/d5cd2effa69551c6bc7edfef8a414d545dea9117


--

___
Python tracker 

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



[issue22045] Python make issue

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +twouters

___
Python tracker 

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



[issue45879] Access violation

2021-11-23 Thread vladexl


vladexl  added the comment:

Sorry i can't provide simple example, but will describe steps. And also i found 
reason of such behavior.
It was a function from pythonwin: PyWinObject_FromHANDLE.  When i removed it 
from code - issue gone.

So, in order to start 2 python scripts simultaneously:
1. 2 interpreters was created (Py_NewInterpreter)
2. 2 windows threads started and 2 python scripts inside 
(PyRun_AnyFileExFlags(hFile, filePath, true, nullptr);
3. Python scripts like this:  (i started additional thread inside python 
script, it's necessary)
@entry
def main():
import time
i = 100
while i < 103 :
print("iter {0} ".format(i))
time.sleep(1)
i = i +1
def entry(function):
def entry_decorator():
import threading
thread = threading.Thread(target=_threadmain, args=(function,))
thread.start()
return entry_decorator
def _threadmain(function):
# call entry point from primary script
function()
myevent = __mymodule.GetStopEvent()
while True:
rc = win32event.MsgWaitForMultipleObjects((myevent,), 1, 1000, 
win32event.QS_ALLINPUT);
if rc == win32event.WAIT_OBJECT_0:
break
pythoncom.PumpWaitingMessages()
pythoncom.CoUninitialize() 
4. GetStopEvent like this:
PyObject* GetStopEvent(PyObject *self, PyObject *args)
{
 HANDLE hEvent = CreateEvent(...);
 return PyWinObject_FromHANDLE(hEvent);
}
5. Exception appears after starting/stopping(firing event) 3..4 times. It works 
fine in case of single starting.

--

___
Python tracker 

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



[issue45888] Revisit: start_tls() difficult when using asyncio.start_server()

2021-11-23 Thread Rob Blackbourn


New submission from Rob Blackbourn :

The issue 34975 "start_tls() difficult when using asyncio.start_server()" was 
closed because streams was being re-written, but it's still a useful 
enhancement, and a fairly simple change.

Could this be revisited?

I've done a proof of concept here: 
https://github.com/rob-blackbourn/asyncio-upgradeable-streams

--
assignee: christian.heimes
components: Library (Lib), SSL
messages: 406906
nosy: christian.heimes, rob-blackbourn
priority: normal
severity: normal
status: open
title: Revisit: start_tls() difficult when using asyncio.start_server()
type: enhancement
versions: Python 3.10, Python 3.11, 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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 324527012fa1078428a6207918640cf860e28c81 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45847: Port _posixshmem to PY_STDLIB_MOD (GH-29738)
https://github.com/python/cpython/commit/324527012fa1078428a6207918640cf860e28c81


--

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset dd8ce9ea8d7e45224a348ea7962b5f50cbf86dc5 by Christian Heimes in 
branch 'main':
bpo-45886: Allow overriding freeze command for cross compiling (GH-29735)
https://github.com/python/cpython/commit/dd8ce9ea8d7e45224a348ea7962b5f50cbf86dc5


--

___
Python tracker 

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



[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

There are 3 policy settings that are also being passed as parameters to 
Generator/BytesGenerator:

- mangle_from_
- linesep
- maxheaderlen

Both linesep and maxheaderlen are being inserted into policy after self.policy 
(if there is one) overrides message policy.

The docs for both linesep and maxheaderlen match the code.

So this only leaves us the buggy `mangle_from_`.

I think it makes sense to fix it in `send_message()` rather than in 
BytesGenerator because:

- less backwards compatibility breakage
- there's already a workaround for BytesGenerator (provide the parameter)
- there were no reports from users of BytesGenerator

We have two ways to fix it in send_message() --
- provide policy as an arg
- provide mangle_from_ as an arg

I think the 2nd choice is better because it's more direct and easier to 
understand. If we use msg.policy as an arg, it looks like we're using 
msg.policy to override msg.policy, which wouldn't make any sense except that 
mangle_from_ is being set from policy arg rather than msg.policy.

If there's code out there that relies on this bug in send_message(), I would 
guess it's more likely to be test suites that compare output to version where 
*from* is mangled.

Docs for BytesGenerator should be fixed to warn about this issue.

--

___
Python tracker 

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



[issue45616] Python Launcher Matches 3.10 instead of 3.1

2021-11-23 Thread miss-islington


miss-islington  added the comment:


New changeset ae065f83625f3abcf75d928f405e05582fc035b4 by Miss Islington (bot) 
in branch '3.10':
bpo-45616: Let py.exe distinguish between v3.1 and v3.10 (GH-29731)
https://github.com/python/cpython/commit/ae065f83625f3abcf75d928f405e05582fc035b4


--

___
Python tracker 

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



[issue45616] Python Launcher Matches 3.10 instead of 3.1

2021-11-23 Thread Zachary Ware


Zachary Ware  added the comment:


New changeset f9de97aae5fe9dafb58a8099171f4a09c449f4e8 by Zachary Ware in 
branch 'main':
bpo-45616: Let py.exe distinguish between v3.1 and v3.10 (GH-29731)
https://github.com/python/cpython/commit/f9de97aae5fe9dafb58a8099171f4a09c449f4e8


--

___
Python tracker 

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



[issue45616] Python Launcher Matches 3.10 instead of 3.1

2021-11-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +27978
pull_request: https://github.com/python/cpython/pull/29740

___
Python tracker 

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



[issue32731] getpass.getuser() raises an unspecified exceptions (ImportError, OSError, etc)

2021-11-23 Thread Jacob Walls


Change by Jacob Walls :


--
nosy: +jacobtylerwalls
nosy_count: 4.0 -> 5.0
pull_requests: +27977
pull_request: https://github.com/python/cpython/pull/29739

___
Python tracker 

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



[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-23 Thread R. David Murray


R. David Murray  added the comment:

In this case the docs are correct and the code has a bug.  The intent was that 
if the message passed in to BytesGenerator has a policy, that policy should be 
followed.  If it is not being followed, that's a bug in BytesGenerator.  The 
tricky part of course is backward compatibility.  Is there code out there 
depending on this bug?  Anyone want to hazard a guess?

Are there things other than mangle_from_ that are being ignored? 

If we decide it is too risky to fix in BytesGenerator (or maybe only to fix it 
in a feature release), then I'd pass the whole policy in the else clause, with 
a comment about what bug it is working around.

--

___
Python tracker 

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



[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-23 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Seems like a reasonable request to me.

I can make the PR+test.

To minimize backwards-incompatible change, we can pass 
`_mangle_from=policy._mangle_from` argument instead of passing the entire 
policy. Is that a good idea or passing the policy argument should be fine too?

--
nosy: +andrei.avk, r.david.murray
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2021-11-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

To the question "why does _freeze_module need to be a (C) binary" (IOW, why 
can't it be replaced by a Python script that is run with PYTHON_FOR_REGEN, 
which always runs on the build host), the reason is that it uses the bytecode 
compiler to generate correct output. The bytecode compiler is written in C and 
depends on many other parts of the runtime. Bytecode is not compatible between 
versions (and in 3.11 it is an especially moving target) so we absolutely must 
use the bytecode compiler from the current source tree.

Fortunately bytecode *is* portable across OS and CPU versions, so there is no 
problem with taking a _freeze_module binary compiled for the build host and 
running it there (on the build host). It *is* complicated to build a binary for 
the build host in a tree configured for cross compilation though -- you'd have 
to do an out-of-tree build configured for the build host platform. Rather than 
solving *that* problem, Christian proposes to let the user solve that, and 
allowing the user to pass in the path to the host platform _freeze_module 
binary.

--
nosy: +eric.snow, gvanrossum

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +27976
pull_request: https://github.com/python/cpython/pull/29738

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

As a side effect of inlining the variance code, we also get to fix the error 
messages which were variance specific.

--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I've opened a PR to make this easy to experiment with.

It also worked with my frac_sqrt() and deci_sqrt(), but having all integer 
arithmetic and always correct rounding are nice wins.  

The only downside is that I completely understood the first two variants but am 
still studying the new one.  Perhaps Tim will have a look as well.

--
nosy: +tim.peters

___
Python tracker 

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



[issue45887] [subinterpreters] Pull all interpreter-global objects into one place.

2021-11-23 Thread Eric Snow


Change by Eric Snow :


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

___
Python tracker 

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



[issue45887] [subinterpreters] Pull all interpreter-global objects into one place.

2021-11-23 Thread Eric Snow


New submission from Eric Snow :

Currently there are still a bunch of PyObject static variables in the code that 
need to become per-interpreter.  This includes quite a few static types (e.g. 
in Objects/*.c), as well as freelists and caches.  To make the transition 
easier I'd like to move all those objects under a single struct.

When I started consolidating globals a few years back, my plan was to turn 
static variables into fields on the _PyRuntimeState struct, where they can 
later be moved down into PyInterpreterState and become per-interpreter.  That 
has worked fine but the mental indirection in that process is clunky.  
Consequently, in practice we've ended up just moving things directly to 
PyInterpreterState, even in cases where making something per-interpreter is 
premature.

So at this point I'm planning on a slightly different approach.  We'll move the 
objects (and other state) to PyInterpreterState as pointer fields, and then use 
the main interpreter's pointers in the corresponding fields in all 
subinterpreters.  Thus it will be equivalent to having a single global state.  
However, it will go smoother down the road when we make all that state unique 
to each interpreter.

--
assignee: eric.snow
components: Interpreter Core
messages: 406894
nosy: Mark.Shannon, eric.snow, ncoghlan, vstinner
priority: normal
severity: normal
status: open
title: [subinterpreters] Pull all interpreter-global objects into one place.
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



[issue45839] python3 executable is able to install pandas

2021-11-23 Thread Muhammad Irfan Asghar


Muhammad Irfan Asghar  added the comment:

Great, thanks!

On Tue, Nov 23, 2021 at 10:01 PM Muhammad Irfan Asghar <
rep...@bugs.python.org> wrote:

>
> Muhammad Irfan Asghar  added the comment:
>
> Hi
>
> The issue is finally solved by using the command
>
> pip3 install --trusted-host pypi.org --trusted-host pypi.python.org
> --trusted-host files.pythonhosted.org pandas
>
> Thanks to all who helped.
>
> regards
> Irfan
>
> On Tue, Nov 23, 2021 at 10:03 AM Ronald Oussoren 
> wrote:
>
> >
> > Ronald Oussoren  added the comment:
> >
> > Could you check with "curl -k https://pypi.org/ >/dev/null" what
> > certificate is used by PyPI?
> >
> > On my system I get (amongst other output):
> >
> > ...
> > * SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
> > * ALPN, server accepted to use h2
> > * Server certificate:
> > *  subject: CN=pypi.org
> > *  start date: Oct 22 18:55:44 2021 GMT
> > *  expire date: Nov 23 18:55:43 2022 GMT
> > *  subjectAltName: host "pypi.org" matched cert's "pypi.org"
> > *  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Atlas R3 DV TLS CA H2
> > 2021
> > *  SSL certificate verify ok.
> > ...
> >
> > Note how the issuer is GlobalSign. If you see some other certificate
> > authority, or get an error from curl due to the same certificate
> > verification problem, you have something on the path between you and PyPI
> > that intercepts the connection, such as a corporate proxy.
> >
> > Pip appears to have a way to override certificate verification, you'll
> > have to (a) read pip's manual for that and (b) be *very* sure you know
> > what's going on before you start trusting some other CA that's not in the
> > global trust root used by pip and certify.
> >
> > --
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2021-11-23 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2021-11-23 Thread Christian Heimes


New submission from Christian Heimes :

The build process creates the binary Program/_freeze_module, which is used to 
create frozen modules. The program takes a Python file, compiles it, and stores 
its marshalled output in a header file.

The approach does not work when cross compiling Python. In cross building case 
Program/_freeze_module cannot be executed on the build host. For example a 
cross build with build host "x86_64" and target host "aarch64" would create a 
aarch64 Program/_freeze_module. The current x86_64 host cannot executed binary 
(unless you use qemu and binfmt, which I'm deliberately ignoring here).

To unblock cross building and until we find a better solution, I propose that 
we allow developers to override the freeze module command on the command line. 
This allows developers to use a freeze_module program from a non-cross build:

   ../../configure -C --host=aarch64-linux-gnu-gcc --build=x86_64-pc-linux-gnu
   make FREEZE_MODULE=../x86_64/Program/_freeze_module

--
assignee: christian.heimes
components: Build
messages: 406893
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Fix Program/_freeze_module for cross compiling Python
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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 9cf5646bb465b7d3d68bfe6d4711feb43d565051 by Christian Heimes in 
branch 'main':
bpo-45847: Port _gdbm to PY_STDLIB_MOD (GH-29720)
https://github.com/python/cpython/commit/9cf5646bb465b7d3d68bfe6d4711feb43d565051


--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset b9e9292d75fdea621e05e39b8629e6935d282d0d by Christian Heimes in 
branch 'main':
bpo-45847: Port _ssl and _hashlib to PY_STDLIB_MOD (GH-29727)
https://github.com/python/cpython/commit/b9e9292d75fdea621e05e39b8629e6935d282d0d


--

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-23 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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 095bc8f0d6845dded8f67fbc6eca20dfac8b3929 by Christian Heimes in 
branch 'main':
bpo-45847: Port _crypt to PY_STDLIB_MOD (GH-29725)
https://github.com/python/cpython/commit/095bc8f0d6845dded8f67fbc6eca20dfac8b3929


--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Hmm. isqrt_frac_rto is unnecessarily complicated. Here's a more streamlined 
version of the code.


import math

def isqrt_frac_rto(n, m):
"""
Square root of n/m, rounded to the nearest integer using round-to-odd.
"""
a = math.isqrt(n*m) // m
return a | (a*a*m != n)

def sqrt_frac(n, m):
"""
Square root of n/m as a float, correctly rounded.
"""
q = (n.bit_length() - m.bit_length() - 109) // 2
if q >= 0:
return float(isqrt_frac_rto(n, m << 2 * q) << q)
else:
return isqrt_frac_rto(n << -2 * q, m) / (1 << -q)

--

___
Python tracker 

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



[issue45839] python3 executable is able to install pandas

2021-11-23 Thread Muhammad Irfan Asghar


Muhammad Irfan Asghar  added the comment:

Hi

The issue is finally solved by using the command

pip3 install --trusted-host pypi.org --trusted-host pypi.python.org
--trusted-host files.pythonhosted.org pandas

Thanks to all who helped.

regards
Irfan

On Tue, Nov 23, 2021 at 10:03 AM Ronald Oussoren 
wrote:

>
> Ronald Oussoren  added the comment:
>
> Could you check with "curl -k https://pypi.org/ >/dev/null" what
> certificate is used by PyPI?
>
> On my system I get (amongst other output):
>
> ...
> * SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
> * ALPN, server accepted to use h2
> * Server certificate:
> *  subject: CN=pypi.org
> *  start date: Oct 22 18:55:44 2021 GMT
> *  expire date: Nov 23 18:55:43 2022 GMT
> *  subjectAltName: host "pypi.org" matched cert's "pypi.org"
> *  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Atlas R3 DV TLS CA H2
> 2021
> *  SSL certificate verify ok.
> ...
>
> Note how the issuer is GlobalSign. If you see some other certificate
> authority, or get an error from curl due to the same certificate
> verification problem, you have something on the path between you and PyPI
> that intercepts the connection, such as a corporate proxy.
>
> Pip appears to have a way to override certificate verification, you'll
> have to (a) read pip's manual for that and (b) be *very* sure you know
> what's going on before you start trusting some other CA that's not in the
> global trust root used by pip and certify.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue45885] Specialize COMPARE_OP

2021-11-23 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue45885] Specialize COMPARE_OP

2021-11-23 Thread Dennis Sweeney


New submission from Dennis Sweeney :

Some specialization statistics:

https://gist.github.com/sweeneyde/49cc3a9d074d56cf095cb0a42d13d7a4

Including 3 opcodes: COMPARE_OP_INT and COMPARE_OP_FLOAT and COMPARE_OP_STR 
(equality only) seems to give pretty good specialization numbers, better than 
just 2.

--
components: Interpreter Core
messages: 406887
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Specialize COMPARE_OP
type: performance
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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Should the last line of sqrt_frac() be wrapped with float()?

It's already a float - it's the result of an int / int division.

--

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> works for me
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



[issue45883] reuse_address mistakenly removed from loop.create_server

2021-11-23 Thread Oleg Iarygin


Change by Oleg Iarygin :


--
nosy: +arhadthedev

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Should the last line of sqrt_frac() be wrapped with float()?

--

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f840398a5fd8741653c26eb8641c48656c9800d4 by Christian Heimes in 
branch 'main':
bpo-45873: Restore Python 3.6 compatibility (GH-29730)
https://github.com/python/cpython/commit/f840398a5fd8741653c26eb8641c48656c9800d4


--

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27971
pull_request: https://github.com/python/cpython/pull/29730

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Reposting with more careful timing runs.  No regression was observed.

$ python3.10 --version
Python 3.10.0
$ python3.10 -m timeit -r 11 -s 'x=5' 'x^3'# Xor with variable
500 loops, best of 11: 41.7 nsec per loop
$ python3.10 -m timeit -r 11 -s 'x=5' 'x+3'# Add with variable
1000 loops, best of 11: 22.7 nsec per loop
$ python3.10 -m timeit -r 11 '5+3' # Constant folded
5000 loops, best of 11: 7.22 nsec per loop

$ python3.11 --version
Python 3.11.0a2
$ python3.11 -m timeit -r 11 -s 'x=5' 'x^3'# Xor with variable
2000 loops, best of 11: 19.4 nsec per loop
$ python3.11 -m timeit -r 11 -s 'x=5' 'x+3'# Add with variable
2000 loops, best of 11: 17 nsec per loop
$ python3.11 -m timeit -r 11 '5+3' # Constant folded
5000 loops, best of 11: 7.27 nsec per loop

--

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Mark Shannon


Mark Shannon  added the comment:

> I assume there's something wrong with the OP's methodology for profiling.

In a word "cProfile".
All cProfile is doing is measuring the overhead of cProfile.

That the overhead of cProfile has gone up is not surprising. That it has gone 
up so much, is a bit surprising.

My advice would be use a sampling profiling like Scalene.

--

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

I assume there's something wrong with the OP's methodology for profiling. 

(Raymond, in your last example there's a -s argument but nothing to run -- does 
timeit just use "pass" in that case?)

--

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Irit Katriel


Irit Katriel  added the comment:

Raymond, your last two results look like 3.10 rather than 3.11.

--

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +Mark.Shannon, gvanrossum, iritkatriel

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

I think GH-28612 broke Windows builds:

  python_uwp.cpp
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) struct PyStatus __cdecl PyConfig_SetArgv(struct PyConfig 
*,__int64,wchar_t * const *)" 
(__imp_?PyConfig_SetArgv@@YA?AUPyStatus@@PEAUPyConfig@@_JPEBQEA_W@Z) 
[D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) int __cdecl PyStatus_Exception(struct PyStatus)" 
(__imp_?PyStatus_Exception@@YAHUPyStatus@@@Z) 
[D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) void __cdecl PyConfig_InitPythonConfig(struct PyConfig 
*)" (__imp_?PyConfig_InitPythonConfig@@YAXPEAUPyConfig@@@Z) 
[D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) int __cdecl PyStatus_IsExit(struct PyStatus)" 
(__imp_?PyStatus_IsExit@@YAHUPyStatus@@@Z) [D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) struct PyStatus __cdecl PyConfig_SetString(struct 
PyConfig *,wchar_t * *,wchar_t const *)" 
(__imp_?PyConfig_SetString@@YA?AUPyStatus@@PEAUPyConfig@@PEAPEA_WPEB_W@Z) 
[D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) void __cdecl PyConfig_Clear(struct PyConfig *)" 
(__imp_?PyConfig_Clear@@YAXPEAUPyConfig@@@Z) 
[D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) void __cdecl PyPreConfig_InitPythonConfig(struct 
PyPreConfig *)" (__imp_?PyPreConfig_InitPythonConfig@@YAXPEAUPyPreConfig@@@Z) 
[D:\a\1\s\PCbuild\python_uwp.vcxproj]
python_uwp.obj : error LNK2001: unresolved external symbol 
"__declspec(dllimport) struct PyStatus __cdecl PyStatus_Ok(void)" 
(__imp_?PyStatus_Ok@@YA?AUPyStatus@@XZ) [D:\a\1\s\PCbuild\python_uwp.vcxproj]
D:\a\1\s\PCbuild\amd64\python_uwp.exe : fatal error LNK1120: 8 unresolved 
externals [D:\a\1\s\PCbuild\python_uwp.vcxproj]

https://dev.azure.com/Python/cpython/_build/results?buildId=92032=results

--
nosy: +christian.heimes

___
Python tracker 

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



[issue45884] datetime.strptime incorrectly handling hours and minutes with bad format string

2021-11-23 Thread Jon Oxtoby


Jon Oxtoby  added the comment:

Just noticed the potential for this issue was raised in 
https://bugs.python.org/msg393688 so it's possible this is not a bug and is the 
desired behavior, but the documentation doesn't seem to address the issue 
(unless I'm overlooking it).

--

___
Python tracker 

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



[issue45884] datetime.strptime incorrectly handling hours and minutes with bad format string

2021-11-23 Thread Jon Oxtoby


New submission from Jon Oxtoby :

Running datetime.strptime against a string containing year, month, day but with 
a formatter including %H causes a two-digit day to be split across the day and 
hour fields of the datetime:

datetime.datetime.strptime('20140812', '%Y%m%d%H')
returns: datetime.datetime(2014, 8, 1, 2, 0)
expected: ValueError: time data '20140812' does not match format '%Y%m%d%H'

datetime.datetime.strptime('2014081201', '%Y%m%d%H%M')
returns: datetime.datetime(2014, 8, 12, 0, 1)
expected: ValueError: time data '2014081201' does not match format '%Y%m%d%H%M'

--
components: Library (Lib)
messages: 406877
nosy: joxtoby27
priority: normal
severity: normal
status: open
title: datetime.strptime incorrectly handling hours and minutes with bad format 
string
type: behavior
versions: 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



[issue45883] reuse_address mistakenly removed from loop.create_server

2021-11-23 Thread Jim Crist-Harif


Change by Jim Crist-Harif :


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

___
Python tracker 

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



[issue45883] reuse_address mistakenly removed from loop.create_server

2021-11-23 Thread Jim Crist-Harif


New submission from Jim Crist-Harif :

In https://bugs.python.org/issue45129 the deprecated `reuse_address` parameter 
to `create_datagram_endpoint` was removed. This PR mistakenly removed this 
parameter from `create_server` as well (where it wasn't deprecated).

--
components: asyncio
messages: 406876
nosy: asvetlov, jcristharif, yselivanov
priority: normal
severity: normal
status: open
title: reuse_address mistakenly removed from loop.create_server
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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Here's the float-and-Fraction-based code that I'm using to compare the 
integer-based code against:

def sqrt_frac2(n, m):
"""
Square root of n/m as a float, correctly rounded.
"""
f = fractions.Fraction(n, m)

# First approximation.
x = math.sqrt(n / m)

# Use the approximation to find a pair of floats bracketing the actual sqrt
if fractions.Fraction(x)**2 >= f:
x_lo, x_hi = math.nextafter(x, 0.0), x
else:
x_lo, x_hi = x, math.nextafter(x, math.inf)

# Check the bracketing. If math.sqrt is correctly rounded (as it will be on 
a
# typical machine), then the assert can't fail. But we can't rely on 
math.sqrt being
# correctly rounded in general, so would need some fallback.
fx_lo, fx_hi = fractions.Fraction(x_lo), fractions.Fraction(x_hi)
assert fx_lo**2 <= f <= fx_hi**2

# Compare true square root with the value halfway between the two floats.
mid = (fx_lo + fx_hi) / 2
if mid**2 < f:
return x_hi
elif mid**2 > f:
return x_lo
else:
# Tricky case: mid**2 == f, so we need to choose the "even" endpoint.
# Cheap trick: the addition in 0.5 * (x_lo + x_hi) will round to even.
return 0.5 * (x_lo + x_hi)

--

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread Gaige Paulsen


Gaige Paulsen  added the comment:

I can test the backports if you like. In that case, let me know when the 
backports are done, I should be able to test those rapidly, now that I have my 
build environment working for building from source.

Thanks again!

--

___
Python tracker 

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



[issue45882] mailbox fails to read message from mbox

2021-11-23 Thread Peter Wurmsdobler


New submission from Peter Wurmsdobler :

When using mailbox to convert mbox files to maildir, I have noticed that it 
cannot handle messages in the mbox file that start with two subsequent `From` 
lines in the header like:

```
>From - Fri Feb 20 09:46:18 1998
>From na...@company.com Wed Feb 18 18:38:38 1998
```

A new maildir message will be created, but none of fields following the two 
header lines such as `Date` etc. will be parsed; the result is a message with 
header and body inside the message.

--
components: Library (Lib)
messages: 406873
nosy: peter4
priority: normal
severity: normal
status: open
title: mailbox fails to read message from mbox
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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

Gaige Paulsen: "Result: I can confirm that the compilation problem is resolved 
with this change (and was failing with the main branch prior to the change)."

Thank you for the confirmation. I merged my change and I'm backporting it to 
Python 3.9 and 3.10.

--

___
Python tracker 

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



[issue33381] [doc] Incorrect documentation for strftime()/strptime() format code %f

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> docs@python
components: +Documentation, Library (Lib)
keywords: +easy, newcomer friendly
nosy: +docs@python
title: Incorrect documentation for strftime()/strptime() format code %f -> 
[doc] Incorrect documentation for strftime()/strptime() format code %f
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27969
pull_request: https://github.com/python/cpython/pull/29732

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4ae26b9c1d0c33e3db92c6f305293f9240dea358 by Victor Stinner in 
branch 'main':
bpo-39026: Fix Python.h when building with Xcode (GH-29488)
https://github.com/python/cpython/commit/4ae26b9c1d0c33e3db92c6f305293f9240dea358


--

___
Python tracker 

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



[issue45616] Python Launcher Matches 3.10 instead of 3.1

2021-11-23 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue45561] Run smelly.py and multissltests.py from $(srcdir)

2021-11-23 Thread Neil Schemenauer


Change by Neil Schemenauer :


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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Does the technique you had in mind involve testing 1 ulp up or down to see 
> whether its square is closer to the input?

Kinda sorta. Below is some code: it's essentially just pure integer operations, 
with a last minute conversion to float (implicit in the division in the case of 
the second branch). And it would need to be better tested, documented, and 
double-checked to be viable.


def isqrt_rto(n):
"""
Square root of n, rounded to the nearest integer using round-to-odd.
"""
a = math.isqrt(n)
return a | (a*a != n)


def isqrt_frac_rto(n, m):
"""
Square root of n/m, rounded to the nearest integer using round-to-odd.
"""
quotient, remainder = divmod(isqrt_rto(4*n*m), 2*m)
return quotient | bool(remainder)


def sqrt_frac(n, m):
"""
Square root of n/m as a float, correctly rounded.
"""
quantum = (n.bit_length() - m.bit_length() - 1) // 2 - 54
if quantum >= 0:
return float(isqrt_frac_rto(n, m << 2 * quantum) << quantum)
else:
return isqrt_frac_rto(n << -2 * quantum, m) / (1 << -quantum)

--

___
Python tracker 

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



[issue27582] Mispositioned SyntaxError caret for unknown code points

2021-11-23 Thread Irit Katriel

Irit Katriel  added the comment:

This seems to have been fixed by now, I get this on 3.11:

>>> varname = “d“a”t”apoint
  File "", line 1
varname = “d“a”t”apoint
  ^
SyntaxError: invalid character '“' (U+201C)
>>> varname = “d“a”t”apoint.evidence
  File "", line 1
varname = “d“a”t”apoint.evidence
  ^
SyntaxError: invalid character '“' (U+201C)
>>> varname = “d“a”t”apoint[evidence]
  File "", line 1
varname = “d“a”t”apoint[evidence]
  ^
SyntaxError: invalid character '“' (U+201C)
>>> varname = “d“a”t”apoint(evidence)
  File "", line 1
varname = “d“a”t”apoint(evidence)
  ^
SyntaxError: invalid character '“' (U+201C)

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

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-23 Thread Gaige Paulsen


Gaige Paulsen  added the comment:

Sorry about the delay.
Finally fixed my workflow for building from scratch.

Result: I can confirm that the compilation problem is resolved with this change 
(and was failing with the main branch prior to the change).

--

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Éric Araujo

Éric Araujo  added the comment:

Thank you for suggesting the improvement and working on a PR nonetheless!
Hope the experience can be useful for other tickets in the future.

--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> It wouldn't be hard to go for _always_ correctly rounded 
> and actually get it over.

Yes, that would be the right thing to do.

Does the technique you had in mind involve testing 1 ulp up or down to see 
whether its square is closer to the input?


> an Emax of 999 and an Emin of -999 would already be 
> more than big enough.

Right. In haste, I confused max_exp=1024 with max_10_exp=308.  

Am still thinking that the precision needs to be bumped up a bit the 28 place 
default.

--

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Éric Araujo

Éric Araujo  added the comment:

I think that there’s no need to change the existing tests.
The CPython project prefers to not do tiny improvements for their own sake.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue41396] pystate.c:_PyCrossInterpreterData_Release() does not clear py exception on error

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +eric.snow, vstinner

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-23 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
nosy_count: 1.0 -> 2.0
pull_requests: +27967
pull_request: https://github.com/python/cpython/pull/29730

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Thomas Stolarski


Thomas Stolarski  added the comment:

I figured this would probably be the case, but since YIQ also requires a 
profile (and the FCC one it implements is pretty weird for digital work), I 
thought I'd give it a shot anyway.

Would it be worth moving the test/formatting changes over to a different ticket 
or should we just leave them?

--

___
Python tracker 

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



[issue2516] Instance methods are misreporting the number of arguments

2021-11-23 Thread Irit Katriel


Irit Katriel  added the comment:

This seems to have been fixed by now, on 3.11 I get this:

>>> class A:
... def foo(self, x): pass
... 
>>> A().foo()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: A.foo() missing 1 required positional argument: 'x'

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

___
Python tracker 

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



[issue2786] Names in function call exception should have class names, if they're methods

2021-11-23 Thread Irit Katriel


Irit Katriel  added the comment:

This seems to have been fixed by now, on 3.11 I get this:

>>> class foo:
...   def __init__(self, bar):
...  pass
... 
>>> foo()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: foo.__init__() missing 1 required positional argument: 'bar'

--
nosy: +iritkatriel
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here are timings from stock macOS builds from python.org:

$ python3.10 --version
Python 3.10.0
$ python3.10 -m timeit -r 11 -s 'x=5' 'x^3'  # Xor with variable
500 loops, best of 11: 41.4 nsec per loop
$ python3.10 -m timeit -r 11 -s 'x=5' 'x+3'  # Add with variable
1000 loops, best of 11: 22.7 nsec per loop
$ python3.10 -m timeit -r 11 -s '3 + 5'  # Constant folded
5000 loops, best of 11: 7.15 nsec per loop

$ python3.11 --version
Python 3.11.0a2
$ python3.11 -m timeit -r 11 -s 'x=5' 'x^3'
2000 loops, best of 11: 19.2 nsec per loop
$ python3.10 -m timeit -r 11 -s 'x=5' 'x+3'
1000 loops, best of 11: 22.5 nsec per loop
$ python3.10 -m timeit -r 11 -s '3 + 5'
5000 loops, best of 11: 7.16 nsec per loop

--
nosy: +rhettinger

___
Python tracker 

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



[issue29739] zipfile raises wrong exception for some incorrect passwords

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

I have uploaded a reproducer at 
https://github.com/tiran/cpython_builddep/compare/cross-aarch64

$ podman run -ti --rm -v $(pwd):/cpython:Z 
quay.io/tiran/cpythonbuild:ubuntu-impish-aarch64

...
aarch64-linux-gnu-gcc -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fvisibility=hidden -I/cpython/Include/internal -I/usr/include/x86_64-linux-gnu 
-I. -IObjects -IPython -I/usr/include -I/usr/include/x86_64-linux-gnu 
-I/usr/local/include -I/cpython/Include 
-I/cpython/builddep/ubuntu-impish-x86_64 -c /cpython/Modules/_ctypes/_ctypes.c 
-o build/temp.linux-aarch64-3.10/cpython/Modules/_ctypes/_ctypes.o 
-DPy_BUILD_CORE_MODULE -DHAVE_FFI_PREP_CIF_VAR=1 -DHAVE_FFI_PREP_CLOSURE_LOC=1 
-DHAVE_FFI_CLOSURE_ALLOC=1
In file included from /usr/aarch64-linux-gnu/include/features.h:508,
 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
 from /usr/aarch64-linux-gnu/include/limits.h:26,
 from 
/usr/lib/gcc-cross/aarch64-linux-gnu/11/include/limits.h:203,
 from 
/usr/lib/gcc-cross/aarch64-linux-gnu/11/include/syslimits.h:7,
 from 
/usr/lib/gcc-cross/aarch64-linux-gnu/11/include/limits.h:34,
 from /cpython/Include/Python.h:11,
 from /cpython/Modules/zlibmodule.c:8:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No 
such file or directory
7 | # include 

--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

> we've run the ball almost the full length of the field and then failed to put 
> the ball over the goal line

But if we only go from "faithfully rounded" to "almost always correctly 
rounded", it seems to me that we're still a couple of millimetres away from 
that goal line. It wouldn't be hard to go for _always_ correctly rounded and 
actually get it over.

> Yes, the Emin and Emax for the default context is already almost big enough

I'm confused: big enough for what? I was thinking of the use-case where the 
inputs are all floats, in which case an Emax of 999 and an Emin of -999 would 
already be more than big enough.

--

___
Python tracker 

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



[issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc

2021-11-23 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

Can anyone problem examples that it’s not an option to continue using the 
“technically incorrect” `-gnu` suffix on 3.9 and 3.10? From what I understand, 
te suffix technically works (as in the module will load correctly), it just 
fails to distinguish the ABI in the name.

If that’s correct, I feel “being able to distinguish between modules built 
against musl and glibc” should be a feature request and only implemented for 
3.11+, while versions 3.10 and prior continue to use `-gnu`. This will also 
provide a simpler way out of the wheel compatibility problem; projects can 
distribute different wheels for 3.10 (or lower) and 3.11 (or higher), while the 
former wheel continues to contain `-gnu`-suffixed modules, and only contain 
`-musl`-suffixed ones in the latter.

--
nosy: +uranusjr

___
Python tracker 

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



[issue45873] Stop using bootstrap_python for deep-freeze in UNIX builds

2021-11-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 5be98e57b3c3b36d1a1176b49c73b8822c6380e7 by Guido van Rossum in 
branch 'main':
bpo-45873: Get rid of bootstrap_python (#29717)
https://github.com/python/cpython/commit/5be98e57b3c3b36d1a1176b49c73b8822c6380e7


--

___
Python tracker 

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



[issue45850] Port deep-freeze to Windows

2021-11-23 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 5be98e57b3c3b36d1a1176b49c73b8822c6380e7 by Guido van Rossum in 
branch 'main':
bpo-45873: Get rid of bootstrap_python (#29717)
https://github.com/python/cpython/commit/5be98e57b3c3b36d1a1176b49c73b8822c6380e7


--

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

You can write your own module on PyPI with more advanced features if you want 
to extend colorsys ;-)

--

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, let's reject this feature and restrict colorsys to simple color spaces 
which don't require profiles.

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

___
Python tracker 

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



[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-23 Thread Christian Heimes


New submission from Christian Heimes :

Cross compiling is an approach to compile a program for a different CPU 
architecture and platform, e.g. compile for an ARM64 (aarch64) or WASM on a 
x86_64 build system.

Python configure script, Makefile, and setup.py have multiple references to 
cross compiling. However I could not find any documentation in the devguide or 
Python docs how to cross compile. We also lack CI (buildbot) to test cross 
compiling. This lack of awareness and testing leads to breakage of the feature. 
For example the design of Programs/_freeze_module in main (3.11-dev) is 
incompatible with cross compiling.

I kinda got cross compiling working with 3.10, but only with some additional 
hacks and patches. I also ran into other problems like _PYTHON_HOST_PLATFORM 
env var is not automatically forwarded to setup.py. The helper functions 
add_multiarch_paths() and add_cross_compiling_paths() break builds for me, too. 
Cross compiling only works when the methods are commented out.

--
assignee: docs@python
components: Build, Cross-Build, Documentation, Tests
messages: 406853
nosy: Alex.Willmer, brett.cannon, christian.heimes, docs@python
priority: normal
severity: normal
status: open
title: Cross compiling on Linux is untested, undocumented, and broken
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue42872] Inconsistent exceptions thrown by pathlib.Path.mkdir on different OSes

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Improper NotADirectoryError when opening a file in a fake 
directory

___
Python tracker 

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



[issue41742] Request for docs.python.org/3/library/configparser.html#exceptions improvement

2021-11-23 Thread Irit Katriel


Irit Katriel  added the comment:

I agree with Terry, it's pretty clear that this is a list of the exceptions 
that are defined in the module. Indeed many builtin exceptions can be raised 
from any piece of code (for example, you can run out of memory in any module).

--
nosy: +iritkatriel
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-23 Thread Miro Hrončok

Miro Hrončok  added the comment:

I consider it a bugfix. I don't expect users to rely on the previous behavior 
and be surprised by the new, but yet I know https://xkcd.com/1172/ very well.

--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I'm not sure this is worth worrying about ...

Instead of writing simple, mostly accurate code with math.fsum(), these 
functions have already applied labor intensive measures to get an exact mean 
and exact sum of square differences expressed in fractions.  Then at the final 
step before the square root, it prematurely rounds to a float.  This is easy to 
fix and has a single step cost comparable to that already paid for each input 
datum.

In a sports analogy, we've run the ball almost the full length of the field and 
then failed to put the ball over the goal line.

Part of the module's value proposition is that it strives to be more accurate 
than obvious implementations.  The mean, variance, and pvariance function are 
correctly rounded.  In this regard, the stdev and pstdev functions are 
deficient, but they could easily be made to be almost always correctly rounded.

> One thought: would the deci_sqrt approach help with value ranges 
> where the values are well within float limits, but the squares
> of the values are not?

Yes, the Emin and Emax for the default context is already almost big enough:

Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-99, 
Emax=99, capitals=1, clamp=0, flags=[], 
traps=[InvalidOperation, DivisionByZero, Overflow])

We could bump that up to fully envelop operations on the sum of squares:

Context(Emin=-9_999_999, Emax=9_999_999, prec=50)

--

___
Python tracker 

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



[issue45880] Performance regression of Int object operators. (Python 3.11)

2021-11-23 Thread Xinhang Xu


New submission from Xinhang Xu :

Hello.

I'm working on a compute-bound project recently, so I tested several Python 
versions on my PC (Windows 10 64-bit), about Python's performance on operating 
Int object. All Python binaries are official distributions.


Testcase #1 (simple xor op)

Source:

import cProfile as profile
profile.run('for _ in range(5): 5 ^ 6')

The given result:

   C:\Users\surface\Desktop\PythonTest>python-3.9.9-embed-amd64\python 
C:\Users\surface\python_test.py
 3 function calls in 24.398 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1   24.398   24.398   24.398   24.398 :1()
10.0000.000   24.398   24.398 {built-in method builtins.exec}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}



   C:\Users\surface\Desktop\PythonTest>python-3.10.0-embed-amd64\python 
C:\Users\surface\python_test.py
 3 function calls in 27.941 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1   27.941   27.941   27.941   27.941 :1()
10.0000.000   27.941   27.941 {built-in method builtins.exec}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}



   C:\Users\surface\Desktop\PythonTest>python-3.11.0a2-embed-amd64\python 
C:\Users\surface\python_test.py
 3 function calls in 42.209 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1   42.209   42.209   42.209   42.209 :1()
10.0000.000   42.209   42.209 {built-in method builtins.exec}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}



Testcase #2 (simple add op)

Source:

import cProfile as profile
profile.run('for _ in range(5): 5 + 6')

The given result:

   C:\Users\surface\Desktop\PythonTest>python-3.9.9-embed-amd64\python 
C:\Users\surface\python_test.py
 3 function calls in 24.599 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1   24.599   24.599   24.599   24.599 :1()
10.0000.000   24.599   24.599 {built-in method builtins.exec}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}



   C:\Users\surface\Desktop\PythonTest>python-3.10.0-embed-amd64\python 
C:\Users\surface\python_test.py
 3 function calls in 27.414 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1   27.414   27.414   27.414   27.414 :1()
10.0000.000   27.414   27.414 {built-in method builtins.exec}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}



   C:\Users\surface\Desktop\PythonTest>python-3.11.0a2-embed-amd64\python 
C:\Users\surface\python_test.py
 3 function calls in 43.675 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1   43.675   43.675   43.675   43.675 :1()
10.0000.000   43.675   43.675 {built-in method builtins.exec}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}



As you can see, Python 3.11 costs *much more* time to execute Int object 
operator. I have also tested the same cases on another Windows PC, the result 
shows the same.

Is it a common thing? What's the reason for this problem?


Thanks.

--
messages: 406849
nosy: xuxinhang
priority: normal
severity: normal
status: open
title: Performance regression of Int object operators. (Python 3.11)
type: performance
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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

Now, is this a bugfix, or a new feature?
I lean toward calling it a bugfix and backporting to earlier versions.

--

___
Python tracker 

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



[issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home

2021-11-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

Yes. This is a minor bug in the deprecated distutils module.

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

___
Python tracker 

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



[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-11-23 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-23 Thread miss-islington

miss-islington  added the comment:


New changeset ae1965ccb4b1fad63fab40fe8805d1b8247668d3 by Miro Hrončok in 
branch 'main':
bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_ca… 
(GH-29384)
https://github.com/python/cpython/commit/ae1965ccb4b1fad63fab40fe8805d1b8247668d3


--
nosy: +miss-islington

___
Python tracker 

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



[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

> YUV is a common color encoding system. It's used by the JPEG image format and 
> MPEG video format for example.

As far as I understand it, the YUV/RGB conversion used by JPEG is not the same 
as the one used by MPEG, and neither of those is the Rec 709 YUV proposed here.

YUV is used in video production and photography. If you need to work with it, 
you most likely need some kind of precise color matching. If colorsys 
implements the wrong one *for you* (even if it's the most commonly used one, 
and what HDTV uses), then the stdlib has failed you.

Meanwhile, RGB/HLS is used by Web designers writing CSS, GUI authors giving you 
a big green button to click, or color pickers for your avatar's hair. They're 
designing for uncalibrated monitors. *That* is the target audience for colorsys.
The image libraries these people use to read JPGs invariably convert to RGB and 
throw away any precise color information, which is meaningless on uncalibrated 
monitors.

I cannot see a use case for YUV in colorsys that doesn't also require a more 
complex image processing library. It's that library that should provide the 
necessary colorspace conversions, depending on if it's dealing with JPEG or 
MPEG or HDTV.

But please point out my mistakes and clear my doubts!

--

___
Python tracker 

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



[issue45786] Avoid allocating when exiting frame; it may be unsafe.

2021-11-23 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2021-11-23 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue45879] Access violation

2021-11-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

Please provide the code you used to trigger this error, so that we can 
reproduce it.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

One thought: would the deci_sqrt approach help with value ranges where the 
values are well within float limits, but the squares of the values are not? 
E.g., on my machine, I currently get errors for both of the following:

>>> xs = [random.normalvariate(0.0, 1e200) for _ in range(10**6)]
>>> statistics.stdev(xs)

>>> xs = [random.normalvariate(0.0, 1e-200) for _ in range(10**6)]
>>> statistics.stdev(xs)

It's hard to imagine that there are too many use-cases for values of this size, 
but it still feels a bit odd to be constrained to only half of the dynamic 
range of float.

--

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

We are down to 9 missing modules:

readline
_curses
_curses_panel
_dbm
_ctypes
_multiprocessing
_posixshmem
_tkinter
_uuid

--

___
Python tracker 

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



[issue45878] Use `self.assertRaises` instead of `try/except` in `ctypes/test_functions.py::test_mro`

2021-11-23 Thread Alex Waygood


Change by Alex Waygood :


--
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2021-11-23 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27964
pull_request: https://github.com/python/cpython/pull/29727

___
Python tracker 

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



[issue45869] Unicode and acii regular expressions do not agree on ascii space characters

2021-11-23 Thread Oleg Iarygin


Change by Oleg Iarygin :


--
nosy: +arhadthedev

___
Python tracker 

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



[issue45879] Access violation

2021-11-23 Thread vladexl


New submission from vladexl :

It seems object.c hasn't taken into account possible nullptr:

object.c: ...else if (Py_TYPE(v)->tp_as_number != NULL &&...

It seems Py_TYPE(v) returns null

StackTrace:

> python310.dll!PyObject_IsTrue(_object * v=0x1d91e2d4) Line 1444 C
  python310.dll!_PyEval_EvalFrameDefault(_ts * tstate=0x1db76f50, _frame * 
f=0x1c064028, int throwflag=0) Line 3793 C
  [Inline Frame] python310.dll!_PyEval_EvalFrame(_ts *) Line 46 C
  python310.dll!_PyEval_Vector(_ts * tstate=0x1db76f50, PyFrameConstructor * 
con=0x1bd91858, _object * locals=0x, _object * const * args=0x1bdf86a8, 
unsigned int argcount=1, _object * kwnames=0x) Line 5080 C
  python310.dll!_PyFunction_Vectorcall(_object * func=0x1bd91850, _object * 
const * stack=0x1bdf86a8, unsigned int nargsf=2147483649, _object * 
kwnames=0x) Line 347 C
  [Inline Frame] python310.dll!_PyObject_VectorcallTstate(_ts *) Line 114 C
  python310.dll!PyObject_Vectorcall(_object * callable=0x1bd91850, _object * 
const * args, unsigned int nargsf=2147483649, _object * kwnames=0x) 
Line 123 C
  python310.dll!call_function(_ts * tstate=0x1db76f50, PyTraceInfo * 
trace_info=0x1bf3f7a0, _object * * * pp_stack=0x1bf3f774, int oparg=1, _object 
* kwnames=0x) Line 5888 C
  python310.dll!_PyEval_EvalFrameDefault(_ts * tstate=0x1db76f50, _frame * 
f=0x1bdf8568, int throwflag=0) Line 4222 C
  [Inline Frame] python310.dll!_PyEval_EvalFrame(_ts *) Line 46 C
  python310.dll!_PyEval_Vector(_ts * tstate=0x1db76f50, PyFrameConstructor * 
con=0x1bd918a0, _object * locals=0x, _object * const * args=0x1bde5334, 
unsigned int argcount=2, _object * kwnames=0x) Line 5080 C
  python310.dll!_PyFunction_Vectorcall(_object * func=0x1bd91898, _object * 
const * stack=0x1bde5334, unsigned int nargsf=2, _object * kwnames=0x) 
Line 347 C
  python310.dll!PyVectorcall_Call(_object * callable=0x1bd91898, _object * 
tuple=0x1bde5328, _object * kwargs=0x1ef3d618) Line 272 C
  python310.dll!_PyObject_Call(_ts * tstate=0x1db76f50, _object * 
callable=0x1bd91898, _object * args=0x1bde5328, _object * kwargs=0x1ef3d618) 
Line 290 C
  [Inline Frame] python310.dll!PyObject_Call(_object *) Line 317 C
  python310.dll!do_call_core(_ts * tstate=0x1db76f50, PyTraceInfo * 
trace_info=0x1bf3f93c, _object * func=0x1bd91898, _object * 
callargs=0x1bde5328, _object * kwdict=0x1ef3d618) Line 5940 C
  python310.dll!_PyEval_EvalFrameDefault(_ts * tstate=0x1db76f50, _frame * 
f=0x1bd7ab28, int throwflag=0) Line 4286 C
  [Inline Frame] python310.dll!_PyEval_EvalFrame(_ts *) Line 46 C
  python310.dll!_PyEval_Vector(_ts * tstate=0x1db76f50, PyFrameConstructor * 
con=0x1bdef930, _object * locals=0x, _object * const * args=0x1bdfa164, 
unsigned int argcount=1, _object * kwnames=0x) Line 5080 C
  python310.dll!_PyFunction_Vectorcall(_object * func=0x1bdef928, _object * 
const * stack=0x1bdfa164, unsigned int nargsf=2147483649, _object * 
kwnames=0x) Line 347 C
  [Inline Frame] python310.dll!_PyObject_VectorcallTstate(_ts *) Line 114 C
  python310.dll!PyObject_Vectorcall(_object * callable=0x1bdef928, _object * 
const * args, unsigned int nargsf=2147483649, _object * kwnames=0x) 
Line 123 C
  python310.dll!call_function(_ts * tstate=0x1db76f50, PyTraceInfo * 
trace_info=0x1bf3fa94, _object * * * pp_stack=0x1bf3fa70, int oparg=1, _object 
* kwnames=0x) Line 5888 C
  python310.dll!_PyEval_EvalFrameDefault(_ts * tstate=0x1db76f50, _frame * 
f=0x1bdfa028, int throwflag=0) Line 4207 C
  [Inline Frame] python310.dll!_PyEval_EvalFrame(_ts *) Line 46 C
  python310.dll!_PyEval_Vector(_ts * tstate=0x1db76f50, PyFrameConstructor * 
con=0x1bdefa98, _object * locals=0x, _object * const * args=0x1bc9db04, 
unsigned int argcount=1, _object * kwnames=0x) Line 5080 C
  python310.dll!_PyFunction_Vectorcall(_object * func=0x1bdefa90, _object * 
const * stack=0x1bc9db04, unsigned int nargsf=2147483649, _object * 
kwnames=0x) Line 347 C
  [Inline Frame] python310.dll!_PyObject_VectorcallTstate(_ts *) Line 114 C
  python310.dll!PyObject_Vectorcall(_object * callable=0x1bdefa90, _object * 
const * args, unsigned int nargsf=2147483649, _object * kwnames=0x) 
Line 123 C
  python310.dll!call_function(_ts * tstate=0x1db76f50, PyTraceInfo * 
trace_info=0x1bf3fbec, _object * * * pp_stack=0x1bf3fbc8, int oparg=1, _object 
* kwnames=0x) Line 5888 C
  python310.dll!_PyEval_EvalFrameDefault(_ts * tstate=0x1db76f50, _frame * 
f=0x1bc9d9c8, int throwflag=0) Line 4207 C
  [Inline Frame] python310.dll!_PyEval_EvalFrame(_ts *) Line 46 C
  python310.dll!_PyEval_Vector(_ts * tstate=0x1db76f50, PyFrameConstructor * 
con=0x1bdef978, _object * locals=0x, _object * const * args=0x1bf3fce8, 
unsigned int argcount=1, _object * kwnames=0x) Line 5080 C
  python310.dll!_PyFunction_Vectorcall(_object * func=0x1bdef970, _object * 
const * stack=0x1bf3fce8, unsigned int nargsf=1, _object * 

[issue45783] test_freeze fails if a file is removed

2021-11-23 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue45783] test_freeze fails if a file is removed

2021-11-23 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 8ed1495ad900dd815ff8fb97926da5312aaa23f9 by Eric Snow in branch 
'main':
bpo-45783: Preserve file moves and deletions in the tests for the freeze tool. 
(GH-29527)
https://github.com/python/cpython/commit/8ed1495ad900dd815ff8fb97926da5312aaa23f9


--

___
Python tracker 

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



  1   2   >