[issue33590] [doc] sched.enter priority has no impact on execution

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python
resolution: not a bug -> 
title: sched.enter priority has no impact on execution -> [doc] sched.enter 
priority has no impact on execution
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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The standard deviation computation in the statistics module is still subject to 
error even though the mean and sum of square differences are computed exactly 
using fractions.

The problem is that the exact fraction gets rounded to a float before going 
into math.sqrt() which also rounds.

It would be better to compute a high precision square root directly from the 
exact fraction rather than from a fraction rounded to a float.

Here are two ways to do it.  With Cpython, the second way is twice as fast.   
With PyPy3, the speed is about the same. 


def frac_sqrt(x: Fraction) -> float:
'Return sqrt to greater precision than math.sqrt()'
# Needed because a correctly rounded square root of
# a correctly rounded input can still be off by 1 ulp.
# Here we avoid the initial rounding and work directly
# will the exact fractional input.  The square root
# is first approximated with math.sqrt() and then
# refined with a divide-and-average step. Since the
# Newton-Raphson algorithm has quadratic convergence,
# one refinement step gives excellent accuracy.
a = Fraction(math.sqrt(x))
return float((x / a + a) / 2)


def deci_sqrt(x: Fraction) -> float:
ratio = Decimal(x.numerator) / Decimal(x.denominator)
return float(ratio.sqrt())

--
assignee: rhettinger
components: Library (Lib)
messages: 406824
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Improve accuracy of stdev functions in statistics
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



[issue22067] time_test fails after strptime()

2021-11-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, it was 2.7-only issue.

Thank you Irit for checking and closing outdated issues.

--
resolution: works for me -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-23 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue45877] Inconsistency in minimal supported version of Microsoft Visual Studio

2021-11-23 Thread Oleg Iarygin


New submission from Oleg Iarygin :

According to PCbuild/readme.txt:

> Using this directory requires an installation of
> Microsoft Visual Studio 2017 (MSVC 14.1) of any edition.

However, Doc/using/windows.rst states that Visual Studio 2017 is not required 
and 2015 may be used instead:

> The source tree contains a build solution and project files for Microsoft
> Visual Studio 2015, which is the compiler used to build the official Python
> releases.

VS 2017 mention was introduced in GH-3418. So either PCbuild readme needs to 
relax its requirements back or windows.rst needs to be updated.

--
assignee: docs@python
components: Build, Documentation
messages: 406826
nosy: arhadthedev, docs@python, steve.dower
priority: normal
severity: normal
status: open
title: Inconsistency in minimal supported version of Microsoft Visual Studio
type: behavior
versions: Python 3.10, Python 3.11, 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



[issue38642] python3.7.3 seems to cause add-apt-repository to rejct or not find gi library

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +christian.heimes

___
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 Ronald Oussoren


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-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29154] 5 failures in test_doctest: ModuleNotFoundError: No module named 'IPython'

2021-11-23 Thread Irit Katriel


Irit Katriel  added the comment:

3.6 is no longer maintained. I am closing this because there was no response to 
questions from the core devs. If you are having this problem in a current 
version (>=3.9) please open a new issue.

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



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

2021-11-23 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27956
pull_request: https://github.com/python/cpython/pull/29720

___
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 Nikita Sobolev


New submission from Nikita Sobolev :

Right now this test uses `try: ... except TypeError: ...` to ensure that mro is 
consistent. This has a flaw: code in `try` might not ever raise and this test 
would still pass.

I will refactor it to use `self.assertRaises` to be 100% sure.

--
components: Tests
messages: 406829
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Use `self.assertRaises` instead of `try/except` in 
`ctypes/test_functions.py::test_mro`
type: behavior

___
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 Nikita Sobolev


Change by Nikita Sobolev :


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

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

I'm not sure this is worth worrying about. We already have a very tight error 
bound on the result: if `x` is a (positive) fraction and `y` is the closest 
float to x, (and assuming IEEE 754 binary64, round-ties-to-even, no overflow or 
underflow, etc.) then `math.sqrt(y)` will be in error by strictly less than 1 
ulp from the true value √x, so we're already faithfully rounded. (And in 
particular, if the std. dev. is exactly representable as a float, this 
guarantees that we'll get that standard deviation exactly.)

--

___
Python tracker 

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



[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-11-23 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 135cabd328504e1648d17242b42b675cdbd0193b by Mark Shannon in 
branch 'main':
bpo-44525: Copy free variables in bytecode to allow calls to inner functions to 
be specialized (GH-29595)
https://github.com/python/cpython/commit/135cabd328504e1648d17242b42b675cdbd0193b


--

___
Python tracker 

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



[issue45848] Pegen's nice error reporting crashes with non-UTF-8 files

2021-11-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

Wow! Thank you for the quick fix!

--

___
Python tracker 

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



[issue44445] Add `site-include` install scheme path in sysconfig

2021-11-23 Thread Petr Viktorin


Change by Petr Viktorin :


--
keywords: +patch
nosy: +petr.viktorin
nosy_count: 7.0 -> 8.0
pull_requests: +27958
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29578

___
Python tracker 

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



[issue45191] Error.__traceback__.tb_lineno is wrong

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +pablogsal

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


miss-islington  added the comment:


New changeset 327c764fa2a032e34dc268164c3c9c2f95b978c4 by Miss Islington (bot) 
in branch '3.10':
bpo-45561: Run smelly.py tool from $(srcdir) (GH-29138)
https://github.com/python/cpython/commit/327c764fa2a032e34dc268164c3c9c2f95b978c4


--

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

Erlend and I have split off the pkg-config and autoconf work into bpo-45847, 
bpo-45573, and others.

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



[issue38642] python3.7.3 seems to cause add-apt-repository to rejct or not find gi library

2021-11-23 Thread Christian Heimes


Christian Heimes  added the comment:

"/usr/lib/python3/dist-packages" is not part of Python upstream source. It 
comes from Debian/Ubuntu-specific downstream patch. Please report Ubuntu bugs 
on the Ubuntu bug tracker https://bugs.launchpad.net/

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 

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



[issue45191] Error.__traceback__.tb_lineno is wrong

2021-11-23 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +Mark.Shannon

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


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +27959
pull_request: https://github.com/python/cpython/pull/29722

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


Change by miss-islington :


--
pull_requests: +27960
pull_request: https://github.com/python/cpython/pull/29723

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


Serhiy Storchaka  added the comment:


New changeset b48ac6fe38b2fca9963b097c04cdecfc6083104e by Nikita Sobolev in 
branch 'main':
bpo-45878: convert `try/except` to `self.assertRaises` in 
`Lib/ctypes/test/test_functions.py` (GH-29721)
https://github.com/python/cpython/commit/b48ac6fe38b2fca9963b097c04cdecfc6083104e


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2021-11-23 Thread Oleg Iarygin


Change by Oleg Iarygin :


--
nosy: +arhadthedev
nosy_count: 7.0 -> 8.0
pull_requests: +27961
pull_request: https://github.com/python/cpython/pull/29724

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

___
Python tracker 

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



[issue45614] traceback of exception with non-unicode __module__

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


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

___
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 Daniele Varrazzo


Change by Daniele Varrazzo :


--
nosy: +piro

___
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 Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.7, Python 
3.8

___
Python tracker 

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



[issue40673] remove deprecated urllib.request.URLopener/FancyURLopener

2021-11-23 Thread Irit Katriel


Change by Irit Katriel :


--
title: urllib.request.URLopener raises different exceptions based on 
implementation detail -> remove deprecated 
urllib.request.URLopener/FancyURLopener
versions: +Python 3.11 -Python 3.5, 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



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

2021-11-23 Thread Joran van Apeldoorn


Joran van Apeldoorn  added the comment:

Hi,

I was not suggesting that the documentation literally says they should be the 
same but it might be unexpected for users if ASCCI characters change properties 
depending on whether they are considered in a unicode or pure ASCII setting. 

The documentation says about re.A: "Make \w, \W, \b, \B, \d, \D, \s and \S 
perform ASCII-only matching instead of full Unicode matching. ". The problem 
might be that there is no clear notion of "ASCII-only matching". I assumed this 
mean matching ASCII characters only, i.e., the character classes are simply 
limited to codes below 128. 

About \s the documentation says:
"Matches Unicode whitespace characters (which includes [ \t\n\r\f\v], and also 
many other characters, for example the non-breaking spaces mandated by 
typography rules in many languages). If the ASCII flag is used, only [ 
\t\n\r\f\v] is matched.". This heavily implies that there are non-ASCII 
characters in Unicode that might be considered spaces, but that the ASCII 
characters are [ \t\n\r\f\v], although again, not stated literally. 

There might be valid reasons to change the definition (even for ASCII 
characters) depending on re.A, but should it then not follow the unicode 
standard for white space in the unicode case? (which would coincide with the 
current ASCII case). There seem to be many different places where python is 
opinionated about what a space is, but not much consistency behind it.

I am a bit worried about the undocumented nature of the precise definitions of 
the regex classes in general. How is a user supposed to know that the default 
behavior of \s, when no flag is passed, is to also match other ASCII characters 
then those mentioned for the ASCII case? In contrast to this, the \d class is 
directly defined as the unicode category [Nd]. 

It is likely to hard to change and to many things depend on it but the 
following definitions would make more sense to me, and hopefully others:
- Character classes are defined as a set of unicode properties/categories, 
following the same definitions as elsewhere in python.
- If re.A is passed, they are this same set but limited to codes below 128. 

After some digging in the code I traced the current definitions as follows:
 - For unicode Py_UNICODE_ISSPACE is called, which either does a lookup in the 
constant table _Py_ascii_whitespace or calls _PyUnicode_IsWhitespace for non 
ASCII characters. Both of these define a space as "Unicode characters having 
the bidirectional type 'WS', 'B' or 'S' or the category 'Zs'", i.e., this is 
simply the unicode string isspace() definition. 
 - For ASCII Py_ISSPACE is called which does a lookup in _Py_ctype_table. It is 
unclear to me how this table was made.

So sre just follows the other python definitions.
In searching around i found issue  #18236 , which also considers how the python 
definition differs from the unicode one.

--

___
Python tracker 

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



[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-11-23 Thread Petr Viktorin


Petr Viktorin  added the comment:

I think it's a good idea, but without the "will be disallowed in Python 3.13" 
part -- we should tell people that it's discouraged, but there's not much point 
in removing it.

But there's no consensus whether that's a good way to handle things, in 
general. So I'll leave it up to you.

--
status: pending -> open

___
Python tracker 

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



[issue40673] remove deprecated urllib.request.URLopener/FancyURLopener

2021-11-23 Thread STINNER Victor


STINNER Victor  added the comment:

I tried but failed to remove urllib deprecated functions: see bpo-45084.

--

___
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



[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



[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 * kwnames=0

[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



[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



[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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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

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



[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



[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



[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



[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



[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



[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



[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



[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


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



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



[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



[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



[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



[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



[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



[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&view=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



[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



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



[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



[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



[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



[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



[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



[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



[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



  1   2   >