[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

If the issue is about how pyperformance creates its virtual environment (how 
setuptools is installed), I suggest to continue discussion the issue in 
pyperformance: https://github.com/python/pyperformance/issues/ ;-)

--

___
Python tracker 

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



[issue46178] Remove `.travis.yml`?

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

I had so many troubles with Travis CI. I'm happy that GitHub Actions is more 
reliable and that Travis CI is gone.

--
nosy: +vstinner

___
Python tracker 

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



[issue46142] python --help output is too long

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

initconfig.c parses all -X options. preconfig.c also checks for a few specific 
-X options which are also checked in initconfig.c.

My notes on parsing command line options:
https://pythondev.readthedocs.io/pyconfig.html#add-a-new-command-line-option

--

___
Python tracker 

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



[issue46265] Error when cross compiling for hardfloat MIPS

2022-01-05 Thread Jeffery To


New submission from Jeffery To :

The Python package for OpenWrt was updated to 3.10 recently and we found that 
builds are failing for MIPS 24Kf (original report at 
https://github.com/openwrt/packages/issues/17217):

mipsel_24kc+24kf_gcc-11.2.0_musl/lib -znow -zrelro 
-L/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc+24kf_musl/Python-3.10.0
 
-L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc+24kf_musl/usr/lib
 
-L/builder/shared-workdir/build/sdk/staging_dir/target-mipsel_24kc+24kf_musl/lib
 -fno-semantic-interposition -fprofile-generate -Xlinker -export-dynamic -o 
python Programs/python.o -L. -lpython3.10 -ldl  -lpthread -lm -lz   -lm 
/builder/shared-workdir/build/sdk/staging_dir/toolchain-mipsel_24kc+24kf_gcc-11.2.0_musl/bin/../lib/gcc/mipsel-openwrt-linux-musl/11.2.0/../../../../mipsel-openwrt-linux-musl/bin/ld:
 
/builder/shared-workdir/build/sdk/build_dir/target-mipsel_24kc+24kf_musl/Python-3.10.0/libpython3.10.so:
 undefined reference to `__fn_local_PyFloat_FromDouble.localalias'
collect2: error: ld returned 1 exit status
make[7]: *** [Makefile:602: python] Error 1

This error is only occurring for mipsel_24kc+24kf and not our other mips 
targets (none of which have an FPU).

I found that compilation will succeed if I disable optimizations or patch out 
the use of -fno-semantic-interposition, though I'm still not sure what is the 
exact cause of the error.

--
components: Build
messages: 409735
nosy: jefferyto
priority: normal
severity: normal
status: open
title: Error when cross compiling for hardfloat MIPS
type: compile error
versions: Python 3.10

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-05 Thread Vinay Sajip


Change by Vinay Sajip :


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

___
Python tracker 

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



[issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits)

2022-01-05 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Tests
title: Race condition in runtest_mp leads to hangs (never exits) -> 
test.libregrtest: Race condition in runtest_mp leads to hangs (never exits)

___
Python tracker 

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



[issue46205] Race condition in runtest_mp leads to hangs (never exits)

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

Do you want to work on a fix?

--

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-05 Thread Vinay Sajip


Vinay Sajip  added the comment:

I've created a PR to add a "Security Considerations" section in the 
configuration documentation. Comments on the PR are welcome.

--
stage: patch review -> 

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:

I have tested my PR on a FreeBSD VM. Python fails to compile on main and builds 
correctly with my patch.

--
components: +Build
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Nikita Sobolev


New submission from Nikita Sobolev :

For some reasons useful day constants (`MONDAY` ... `SUNDAY`) from `calendar` 
are not properly recognised.

Several problems:
0. Not all code inside uses these constants
1. They are not tested. Only `.MONDAY` and `.SUNDAY` are tested to be present 
in 
https://github.com/python/cpython/blob/main/Lib/test/test_calendar.py#L508-L511
2. They are not in `__all__`
3. They are partially documented. There are some notes about them in 
https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday

> Sets the weekday (0 is Monday, 6 is Sunday) to start each week. The values 
> :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:`THURSDAY`, 
> :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are provided for 
> convenience. For example, to set the first weekday to Sunday:

>import calendar
>calendar.setfirstweekday(calendar.SUNDAY)

But, they are not clickable, because, for example, ":const:`MONDAY`" does not 
exist in docs index.

So, my plan is:
0. Improve constant usage in the source code to make it more readable
1. Test that constants are there
2. Add them to `__all__` as a part of public API
3. Improve their docs

--
components: Library (Lib)
messages: 409742
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`
type: behavior
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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28620
pull_request: https://github.com/python/cpython/pull/30414

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset cae55542d23e606dde9819d5dadd7430085fcc77 by Christian Heimes in 
branch 'main':
bpo-46263: Don't use MULTIARCH on FreeBSD (#30410)
https://github.com/python/cpython/commit/cae55542d23e606dde9819d5dadd7430085fcc77


--

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28619
pull_request: https://github.com/python/cpython/pull/30413

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Christian Heimes


Change by Christian Heimes :


--
priority: release blocker -> normal

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread miss-islington


miss-islington  added the comment:


New changeset 64199e9235275a795097ee0c53b2c560e21c70d0 by Miss Islington (bot) 
in branch '3.9':
bpo-46263: Don't use MULTIARCH on FreeBSD (GH-30410)
https://github.com/python/cpython/commit/64199e9235275a795097ee0c53b2c560e21c70d0


--

___
Python tracker 

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



[issue46267] gzip.compress incorrectly ignores level parameter

2022-01-05 Thread Ruben Vorderman


New submission from Ruben Vorderman :

def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
"""Compress data in one shot and return the compressed string.

compresslevel sets the compression level in range of 0-9.
mtime can be used to set the modification time. The modification time is
set to the current time by default.
"""
if mtime == 0:
# Use zlib as it creates the header with 0 mtime by default.
# This is faster and with less overhead.
return zlib.compress(data, level=compresslevel, wbits=31)
header = _create_simple_gzip_header(compresslevel, mtime)
trailer = struct.pack("

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



[issue46260] Misleading SyntaxError on f-string

2022-01-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

In fstring_find_expr, the code[0] that's checking for parens, braces, and 
brackets detects the closing paren without a matching open paren.

The error message isn't incorrect: if you added a matching open paren the code 
would compile:
>>> foo=lambda:0
>>> f'{foo()}'
'0'

So while the error might not be intuitive, it's not wrong.

0: 
https://github.com/python/cpython/blob/cae55542d23e606dde9819d5dadd7430085fcc77/Parser/string_parser.c#L664d

--

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2022-01-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am removing the "release blocker" tag.

Simon, thanks a lot for both PRs. I am sorry that we needed to revert your 
original work, but unfortunately it was blocking a release and we are forced to 
act in this case. PLease, work together with Christian and Matthias to make a 
version of the patch that works in all supported platforms.

--
priority: release blocker -> 

___
Python tracker 

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



[issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x

2022-01-05 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Log:

```
--- sharedmods ---
LD_LIBRARY_PATH=/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build CC='cc 
-pthread' LDSHARED='cc -pthread -shared' OPT='-g -O0 -Wall'  
_TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  build
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/./setup.py", 
line 49, in 
from distutils.command.build_ext import build_ext
^
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/distutils/command/build_ext.py",
 line 13, in 
from distutils.sysconfig import customize_compiler, get_python_version
^^
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/distutils/sysconfig.py",
 line 53, in 
_config_vars = get_config_vars()
   ^
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/sysconfig.py", line 
621, in get_config_vars
_init_posix(_CONFIG_VARS)
^
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/sysconfig.py", line 
482, in _init_posix
_temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
^
ModuleNotFoundError: No module named 
'_sysconfigdata_d_freebsd14_x86_64-unknown-freebsd14'
*** [sharedmods] Error code 1
make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-564d/build
```

Link: https://buildbot.python.org/all/#/builders/483/builds/1409

--
components: Build
messages: 409760
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x
type: compile error
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



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28624
pull_request: https://github.com/python/cpython/pull/30420

___
Python tracker 

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



[issue44024] Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr

2022-01-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good point. That code was originally added in issue420304 because every 
exception raised in PyObject_GetAttr() (including a TypeError for non-string 
name) was silenced in hasattr() and 3-argument getattr(). It was changed in 
Python 3, so this code duplication is no longer needed.

The name of the function was added in error messages in 
a9b9c9fa9fe9d1ae74ba9f89c43557a7f9bc04f5. Now it will gone. It is a minor 
regression, but I think that it is fine. Not all error messages contain a 
function name. In this case the context is clear from the traceback, and the 
error is not specific to these two functions, setattr() and delattr() raise the 
same error.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34178] test_tcl fails on the 3.7 branch

2022-01-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was a bug fix. msg320663 states that that issue needs a more complex fix 
than provided by the initial patch. And that more complex fix was applied.

It looks to me that this issue is caused by running new tests with old stdlib. 
Tests caught a bug in an unfixed code, as expected.

--
status: pending -> open

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue34178] test_tcl fails on the 3.7 branch

2022-01-05 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2022-01-05 Thread Mark Shannon


Mark Shannon  added the comment:

Yes, most of it :)

We haven't implemented points 2 and 3, yet.

I'm in no hurry to implement 3. It would clean up `gen.throw` a lot, and break 
the dependency between that code and the interpreter, but it isn't urgent.

2 is more urgent. I think we need it to allow specialization of `FOR_ITER` for 
generators, so it should happen in the next few weeks.

--

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2022-01-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>> I am not a regular CPython developer, so I don't have a good way to assess 
>> which reviewers speak for the project and which reviewers are only offering 
>> a personal opinion.

In this webpage (bpo) core developers have a little python logo close to their 
name (as myself).

In GitHub, you can sometimes tell by hovering over the profile or checking the 
core dev log in the devguide: https://devguide.python.org/developers/

--

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2022-01-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset dd50316e458d7c3284f8948b0606d8aa91ab855d by Simon McVittie in 
branch 'main':
bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417)
https://github.com/python/cpython/commit/dd50316e458d7c3284f8948b0606d8aa91ab855d


--

___
Python tracker 

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



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread miss-islington


miss-islington  added the comment:


New changeset 46e4c257e7c26c813620232135781e6c53fe8d4d by Inada Naoki in branch 
'main':
bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)
https://github.com/python/cpython/commit/46e4c257e7c26c813620232135781e6c53fe8d4d


--
nosy: +miss-islington

___
Python tracker 

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



[issue46267] gzip.compress incorrectly ignores level parameter

2022-01-05 Thread Ruben Vorderman


Change by Ruben Vorderman :


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

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2022-01-05 Thread Simon McVittie


Change by Simon McVittie :


--
keywords: +patch
pull_requests: +28623
pull_request: https://github.com/python/cpython/pull/30417

___
Python tracker 

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



[issue46148] Optimize pathlib

2022-01-05 Thread Kumar Aditya


Change by Kumar Aditya :


--
resolution:  -> postponed
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



[issue46148] Optimize pathlib

2022-01-05 Thread Kumar Aditya


Kumar Aditya  added the comment:

I am withdrawing this for now and since there is already a bpo for vectorcall I 
am closing this.

--

___
Python tracker 

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



[issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:

Python's stdlib does not support locale aware unicode transformations. I 
recommend that you check out https://pypi.org/project/PyICU .

--
nosy: +christian.heimes

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread miss-islington


miss-islington  added the comment:


New changeset 7e951f356ec76a5a5fdb851d71df5d120014bf3f by Miss Islington (bot) 
in branch '3.10':
bpo-46263: Don't use MULTIARCH on FreeBSD (GH-30410)
https://github.com/python/cpython/commit/7e951f356ec76a5a5fdb851d71df5d120014bf3f


--

___
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

2022-01-05 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +28621
pull_request: https://github.com/python/cpython/pull/30415

___
Python tracker 

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



[issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR

2022-01-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If you are looking for case-insensitive string comparison, look at 
locale.strcoll() and locale.strxfrm(). They are locale-aware.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2022-01-05 Thread Simon McVittie


Simon McVittie  added the comment:

I've opened https://github.com/python/cpython/pull/30417, is that what you want?

I am not a regular CPython developer, so I don't have a good way to assess 
which reviewers speak for the project and which reviewers are only offering a 
personal opinion.

--

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2022-01-05 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 332e6b972567debfa9d8f3f9a4a966c7ad15eec9 by Brandt Bucher in 
branch 'main':
bpo-45256: Don't track the exact depth of each `InterpreterFrame` (GH-30372)
https://github.com/python/cpython/commit/332e6b972567debfa9d8f3f9a4a966c7ad15eec9


--

___
Python tracker 

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



[issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x

2022-01-05 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

It also generates several warnings:

```
Python/pytime.c:297:10: warning: implicit conversion from 'long' to 'double' 
changes value from 9223372036854775807 to 9223372036854775808 
[-Wimplicit-int-float-conversion]
Python/pytime.c:352:14: warning: implicit conversion from 'long' to 'double' 
changes value from 9223372036854775807 to 9223372036854775808 
[-Wimplicit-int-float-conversion]
Python/pytime.c:507:10: warning: implicit conversion from 'long' to 'double' 
changes value from 9223372036854775807 to 9223372036854775808 
[-Wimplicit-int-float-conversion]
./Modules/expat/xmlparse.c:3095:9: warning: code will never be executed 
[-Wunreachable-code]
./Modules/expat/xmlparse.c:3787:9: warning: code will never be executed 
[-Wunreachable-code]
./Modules/_threadmodule.c:1648:26: warning: implicit conversion from 
'_PyTime_t' (aka 'long') to 'double' changes value from 9223372036854775 to 
9223372036854776 [-Wimplicit-int-float-conversion]
1 warning generated.
/usr/include/netgraph/bluetooth/include/ng_btsocket.h:244:2: warning: "Make 
sure new member of socket address initialized" [-W#warnings]
#warning "Make sure new member of socket address initialized"
1 warning generated.
/usr/include/netgraph/bluetooth/include/ng_btsocket.h:244:2: warning: "Make 
sure new member of socket address initialized" [-W#warnings]
#warning "Make sure new member of socket address initialized"
1 warning generated.
```

--

___
Python tracker 

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



[issue46260] Misleading SyntaxError on f-string

2022-01-05 Thread Matt Delengowski


Matt Delengowski  added the comment:

Hi Eric,

I see what are you referring to. Like you said unintuitive but still correct. 
Do you think it would be worthwhile to change the order of the checking such 
that '}' is always first? Or could the same edge case still appear but just the 
other way around?

Either way, thanks for looking into this and sorry for the trouble.

--

___
Python tracker 

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



[issue46260] Misleading SyntaxError on f-string

2022-01-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

No trouble. I'm glad to know it wasn't actually the same error as plain "foo)" 
(although the error message is the same). That would have concerned me.

Changing the code so that it doesn't error out on the first problem it sees, 
but keeps looking for a different type of error and then maybe backtracks or 
re-parses would be a lot of work, and I think we'd just end up with a different 
class of errors.

I'm going to close this. Maybe when/if we move f-strings to the real parser we 
can look at this issue again.

--
resolution:  -> later
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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:

I have backported the patch to all versions that receive regular fixes.

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

___
Python tracker 

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



[issue46268] Buildbot failure for buildbot/AMD64 FreeBSD Non-Debug / Shared 3.x

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Duplicate of bpo-46263.

--
nosy: +erlendaasland
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> FreeBSD buildbots cannot compile Python

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-05 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Personally, I'd rather we not revert the original change.

Even in 3.10? Your PR looks pretty heavy for a bugfix release, and won't apply 
cleanly to 3.10.

> Moving the data to _PyRuntimeState would save me some effort with related 
> work I'm doing right now.

I guess that's what makes the PR hard to review. What's the plan (or are there 
more conflicting plans), and what's the state in 3.10 vs. main?

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:

GH-30367 broke Emscripten WASM builds. I'm getting a "null function or function 
signature mismatch" error from the WASM engine:

RuntimeError: null function or function signature mismatch
at _PyEval_EvalFrameDefault 
(http://localhost:8000/python.wasm:wasm-function[2383]:0x103a6f)
at gen_send_ex2 
(http://localhost:8000/python.wasm:wasm-function[886]:0x4f35d)
at gen_iternext 
(http://localhost:8000/python.wasm:wasm-function[893]:0x4fb1a)
at builtin_any 
(http://localhost:8000/python.wasm:wasm-function[3927]:0x198a87)
at cfunction_vectorcall_O 
(http://localhost:8000/python.wasm:wasm-function[403]:0x201ae)
at PyObject_Vectorcall 
(http://localhost:8000/python.wasm:wasm-function[2426]:0x109dbe)
at _PyEval_EvalFrameDefault 
(http://localhost:8000/python.wasm:wasm-function[2383]:0x1062ba)
at _PyEval_Vector 
(http://localhost:8000/python.wasm:wasm-function[2380]:0xfc366)
at PyEval_EvalCode 
(http://localhost:8000/python.wasm:wasm-function[2379]:0xfc014)
at _PyConfig_InitPathConfig 
(http://localhost:8000/python.wasm:wasm-function[6871]:0x2924b0)

I'm trying to get more debug information now.

--
nosy: +christian.heimes
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FWIW: from test_embed.test_init_setpythonhome:

if not config['executable']:
config['use_frozen_modules'] = -1

>From the buildbot test stdout (and pythoninfo) I see that config["executable"] 
>is set to "".

--

___
Python tracker 

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



[issue46148] Optimize pathlib

2022-01-05 Thread Éric Araujo

Éric Araujo  added the comment:

A note about benchmarks: I think timeit is not the right tool for them, but 
https://github.com/python/pyperformance is

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread miss-islington


miss-islington  added the comment:


New changeset da8be157f4e275c4c32b9199f1466ed7e52f62cf by Miss Islington (bot) 
in branch '3.10':
bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)
https://github.com/python/cpython/commit/da8be157f4e275c4c32b9199f1466ed7e52f62cf


--

___
Python tracker 

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



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I closed the bug without intention to do so. Sorry for the noise.

--
nosy: +erlendaasland
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue46269] '__new__' is never shown in `dir(SomeEnum)`

2022-01-05 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now `__new__` is marked to be special-cased in `Enum.__dir__`.
It is generally ignored:
But, (I think that was the original idea), when `__new__` is overridden, it 
should be added to the output.

But, this line is problematic: 
https://github.com/python/cpython/blame/46e4c257e7c26c813620232135781e6c53fe8d4d/Lib/enum.py#L656

Why? Because `self.__new__` is always `EnumMeta.__new__`. Original `__new__` is 
renamed to `_new_member_`.

This behavior is also not tested.

So, my proposal is: let's always remove this method from `__dir__`. Why?
- If we modify the check above to compare `_new_member_`, we will show 
`__new__` as the output. It is kinda misleading
- `__new__` is not supposed to be overloaded in `EnumMeta`, it is very special
- `__new__` is a very basic thing. It would be kinda strange not to see it for 
some cases, but to see it for others. For example, all (?) other data types 
always show `__new__`, even if it is not explicitly defined:

```
>>> class A:
...def __new__(*args, **kwargs): ...
... 
>>> assert '__new__' in dir(A)

>>> class B: ...
... 
>>> assert '__new__' in dir(B)
```

I guess being consistent here (we don't show `__new__` at all times) is better.

I will send a PR that removes these two lines in a moment! Any other ideas are 
much appreciated! 

Related:
- https://bugs.python.org/issue45535
- https://github.com/python/cpython/pull/29316

--
components: Library (Lib)
messages: 409771
nosy: AlexWaygood, ethan.furman, sobolevn
priority: normal
severity: normal
status: open
title: '__new__' is never shown in `dir(SomeEnum)`
type: behavior

___
Python tracker 

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



[issue46269] '__new__' is never shown in `dir(SomeEnum)`

2022-01-05 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FWIW: from test_embed.test_init_setpythonhome:

if not config['executable']:
config['use_frozen_modules'] = -1

>From the buildbot test stdout (but not pythoninfo) I see that 
>config["executable"] is set to "".

--

___
Python tracker 

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



[issue46263] FreeBSD buildbots cannot compile Python

2022-01-05 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue46248] Compilation errors on macOS

2022-01-05 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The libraries you mention are 3th party projects.  Please check with the 
project first.

I've look at the GitHub repository for libmobiledevice and have no idea how 
they determine the compiler flags for Python.   As mentioned in an earlier 
version "python-config" is the documented way to fetch such flags.

--

___
Python tracker 

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



[issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

I applied PR 30123 of bpo-46006: "./python bug.py" does still crash. So 
bpo-46006 is unrelated to this issue.

--

___
Python tracker 

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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:

I got more debug symbols:

python.js:235 Uncaught RuntimeError: null function or function signature 
mismatch
at _PyEval_EvalFrameDefault (ceval.c:4247)
at _PyEval_EvalFrame (pycore_ceval.h:48)
at gen_send_ex2 (genobject.c:219)
at gen_iternext (genobject.c:583)
at builtin_any (bltinmodule.c:384)
at cfunction_vectorcall_O (methodobject.c:516)
at _PyObject_VectorcallTstate.11 (pycore_call.h:89)
at PyObject_Vectorcall (call.c:298)
at _PyEval_EvalFrameDefault (ceval.c:4625)
at _PyEval_EvalFrame.1 (pycore_ceval.h:48)

The culprit is 

   PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter);

in the TARGET(FOR_ITER) target. An additional NULL check resolves the problem.


index 953876f6226..390400b3246 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4244,7 +4244,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, 
InterpreterFrame *frame, int thr
 PREDICTED(FOR_ITER);
 /* before: [iter]; after: [iter, iter()] *or* [] */
 PyObject *iter = TOP();
-PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter);
+PyObject *(*iternext)(PyObject *) = *Py_TYPE(iter)->tp_iternext;
+if (iternext == NULL) {
+PyErr_BadInternalCall();
+goto error;
+   }
+PyObject *next = iternext(iter);
 if (next != NULL) {
 PUSH(next);
 PREDICT(STORE_FAST);

--

___
Python tracker 

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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2022-01-05 Thread Christian Heimes


Change by Christian Heimes :


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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2022-01-05 Thread Christian Heimes


Christian Heimes  added the comment:

False alarm ... the frozen files for getpath.py were out of date. I can no 
longer reproduce the issue after a hard git clean and rebuild.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-05 Thread Jan


New submission from Jan :

In chapter 5.7 in the official Python tutorial (see: 
https://docs.python.org/3/tutorial/datastructures.html), there is the following 
paragraph:

"The comparison operators in and not in check whether a value occurs (does not 
occur) in a sequence. The operators is and is not compare whether two objects 
are really the same object. All comparison operators have the same priority, 
which is lower than that of all numerical operators."

I believe that "in" and "not in" are rather membership operators than 
comparison operators. I think a differentiation of operator types in one or two 
sentences would be helpful.

--
assignee: docs@python
components: Documentation
messages: 409782
nosy: docs@python, realjanpaulus
priority: normal
severity: normal
status: open
title: Comparison operators in Python Tutorial 5.7
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think these were intended to be public.  like "January" and "February", 
they were for internal use.  Presumably, this is because the names vary across 
languages.

In the absence of some demonstrated user need, we should leave this alone.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

IMO writing a complete rationale for running multiple interpreters in parallel 
which require a whole PEP. I didn't write such PEP yet since there are still 
non-trivial technical issues, especially the problem of static types: bpo-40601.

I don't have time right now to measure the performance overhead of PR 30123 on 
_PyUnicode_EqualToASCIIId() and on changing a type attribute (like overriding 
the __init__() method). I expect a minor overhead on micro-benchmark and no 
significant change on pyperformance macrobenchmarks. But again, right I don't 
have time to go through such analysis.

The priority for now is to unblock the Python 3.11 release and repair the 
Python 3.10 regression, so I'm fine with reverting my commit 
ea251806b8d11b30d2182af1e589caf88acf which introduced the regression.

PR 30131 makes more changes than just reverting the commit, it changes the 
_PyRuntimeState structure and it also reverts the identifiers change, whereas 
so far, there is no known relationship between this issue and identifiers. IMO 
it's ok to leave identifiers unchanged.

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-05 Thread Eric Snow


Eric Snow  added the comment:

+1 on just reverting in both branches.  I can deal with my stuff separately.

--

___
Python tracker 

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



[issue46269] '__new__' is never shown in `dir(SomeEnum)`

2022-01-05 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 817a6bc9f7b802511c4d42273a621c556a48870b by Nikita Sobolev in 
branch 'main':
bpo-46269: [Enum] remove special-casing of `__new__` in `EnumType.__dir__` 
(GH-30421)
https://github.com/python/cpython/commit/817a6bc9f7b802511c4d42273a621c556a48870b


--

___
Python tracker 

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



[issue46257] Convert statistics sum of squares to a single pass algorithm

2022-01-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue46257] Convert statistics sum of squares to a single pass algorithm

2022-01-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 43aac29cbbb8a963a22c334b5b795d1e43417d6b by Raymond Hettinger in 
branch 'main':
bpo-46257: Convert statistics._ss() to a single pass algorithm (GH-30403)
https://github.com/python/cpython/commit/43aac29cbbb8a963a22c334b5b795d1e43417d6b


--

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)

Python 3.8.0 is the first Python version containing this change. So it looks 
like a Python 3.8 regression.

--

___
Python tracker 

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



[issue30569] Tutorial section 2.1 has *nix example at 3.7, but Windows at 3.6

2022-01-05 Thread Irit Katriel


Irit Katriel  added the comment:

I think this has all been changed by now, in a number of commits.

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

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2022-01-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28626
pull_request: https://github.com/python/cpython/pull/30422

___
Python tracker 

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



[issue46260] Misleading SyntaxError on f-string

2022-01-05 Thread William Navaraj


William Navaraj  added the comment:

@Eric Smith,Thanks for explaining the intuition behind this statement. I agree. 
Just to avoid ambiguity we could add

"f-string: unmatched '%c' - no matching open parenthesis or missing '}'"

The only possibility at nested_depth==0 line 665 is either of those because of 
the check in line 559 i.e. assert(**str == '{')
https://github.com/python/cpython/blob/cae55542d23e606dde9819d5dadd7430085fcc77/Parser/string_parser.c#L559

Will help folks to look backwards (close to open as well) than forwards (open 
to close) as in Matt's case which is also a valid interpretation where there is 
an opening paren outside the f-string.  

or simply

"f-string: unmatched '%c' or missing '}'" will also do.

--
nosy: +williamnavaraj

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue46070] _PyImport_FixupExtensionObject() regression causing a crash in subintepreters

2022-01-05 Thread STINNER Victor


STINNER Victor  added the comment:

bug.py:

* Python 3.7 branch doesn't crash
* Python 3.8 branch does crash

So the regression was introduced in Python 3.8.

git bisect points me to this change:
---
commit 13915a3100608f011b29da2f3716c990f523b631 (refs/bisect/bad)
Author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
Date:   Mon Oct 7 09:38:00 2019 -0700

bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)

(cherry picked from commit 321def805abc5b7c92c7e90ca90cb2434fdab855)

Co-authored-by: Ben Harper 
---

Before this change, bug.py doesn't crash. With this change, bug.py does crash.

--

___
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

2022-01-05 Thread Mark Shannon


Mark Shannon  added the comment:

See https://github.com/faster-cpython/ideas/discussions/210

--

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-05 Thread STINNER Victor


Change by STINNER Victor :


--
title: _PyImport_FixupExtensionObject() regression causing a crash in 
subintepreters -> [subinterpreters] asyncio crash when importing _asyncio in 
subinterpreter (Python 3.8 regression)

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28627
pull_request: https://github.com/python/cpython/pull/30422

___
Python tracker 

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



[issue46269] '__new__' is never shown in `dir(SomeEnum)`

2022-01-05 Thread Alex Waygood

Alex Waygood  added the comment:

Thanks, Nikita! My bad for not adding tests for __new__ in PR 29316.

To confirm: yes, my idea in PR 29316 was that "__new__" (along with most enum 
dunders) should not show up in the output of dir(Enum), but should show up in 
dir(EnumSubclass) if and only if __new__ has been overridden outside of 
enum.py. That's because, unlike with most Python classes, the fact that 
enum.Enum has a __new__ method or a __format__ method doesn't really tell you 
very much about enum.Enum's behaviour, due to how magical enums are. But if 
it's been overridden in a custom Enum subclass, that does tell you that the 
enum class has special behaviour in some way — the HTTPStatus enum at 
Lib/http/__init__.py:6 is a really good example of that.

But you're right: the existing code doesn't work as expected, at all:

```
>>> from http import HTTPStatus
>>> '__new__' in dir(HTTPStatus)
False
```

--

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

> I don't think these were intended to be public.

Thanks for the feedback! The problem is they are documented here: 
https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday

Should we change the docs there to hide them as implementation detail?
Because the current state looks inconsistent to me.

--

___
Python tracker 

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



[issue37330] open(): remove 'U' mode, deprecated since Python 3.3

2022-01-05 Thread Éric Araujo

Éric Araujo  added the comment:

> it is useful to build old versions, sometimes 7 year old versions, to confirm 
> if/when the behaviour regressed. 

I think the sticking point is this: it is not expected that old versions should 
work as-is with the newest Python.  Can you do your build and test with the 
Python version that was current 7 years ago?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46248] Compilation errors on macOS

2022-01-05 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> third party
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



[issue46271] frozen modules are not regenerated on bytecode magic change when cross building

2022-01-05 Thread Christian Heimes


New submission from Christian Heimes :

The Makefile rules for frozen header files have a dependency on 
$(FREEZE_MODULE_BOOTSTRAP_DEPS) or $(FREEZE_MODULE_DEPS). For normal builds 
this dependency will trigger a refresh of the frozen header files when the byte 
code magic changes:

  FREEZE_MODULE_BOOTSTRAP_DEPS=Programs/_freeze_module
  FREEZE_MODULE_DEPS=_bootstrap_python

Both binaries depend on object files which indirectly have a dependency on all 
core header files $(PYTHON_HEADERS).

However cross builds use an external Python binary. Neither 
$(FREEZE_MODULE_BOOTSTRAP_DEPS) nor $(FREEZE_MODULE_DEPS) add an indirect 
dependency on $(PYTHON_HEADERS). The frozen header files are not rebuilt when 
any header file like opcode.h is modified. This causes hard to debug issues 
like https://bugs.python.org/issue46009#msg409770

Fix: all frozen header files should also depend on $(PYTHON_HEADERS)

--
components: Cross-Build
messages: 409794
nosy: Alex.Willmer, christian.heimes, gvanrossum
priority: normal
severity: normal
status: open
title: frozen modules are not regenerated on bytecode magic change when cross 
building
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



[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue46272] Fix bitwise and logical terminology in python.gram

2022-01-05 Thread Raymond Hettinger


New submission from Raymond Hettinger :

In the section "Comparison operators", all mentions of "bitwise" should be 
"binary".

The section "Logical operators" should be retitled "Bitwise operators".  See: 
https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations

--
assignee: pablogsal
components: Documentation
messages: 409796
nosy: pablogsal, rhettinger
priority: normal
severity: normal
status: open
title: Fix bitwise and logical terminology in python.gram
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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-05 Thread Eric Snow


Eric Snow  added the comment:

> IMO writing a complete rationale for running multiple interpreters in 
> parallel which require a whole PEP.

FYI, I'm planning on having such a PEP published in the next few days.

--

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Applying the following patch upon the aforementioned commit (in 3.8) fixes
> the issue for me on latest Debian

By "the issue", I mean bug.py, not win_py399_crash_reproducer.py.

Victor: perhaps we should open a separate issue for the bug.py issue.

Applying the patch from msg409795 onto the 3.9 branch also fixes the segfault 
from bug.py there.

main does not segfault for me, but I would apply the patch anyway, since the 
current code is broken.

--

___
Python tracker 

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



[issue45665] Problems caused by isinstance(list[int], type) returning True

2022-01-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Gentle ping, as the next alpha will be release soon

--
nosy: +pablogsal

___
Python tracker 

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



[issue45665] Problems caused by isinstance(list[int], type) returning True

2022-01-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal

___
Python tracker 

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



[issue40601] [C API] Hide static types from the limited C API

2022-01-05 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> The problem is they are documented here:
> https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday

Well, that does make them public, so we have to go forward.

--
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

In 13915a3100608f011b29da2f3716c990f523b631, the init flag is set before we 
even know if module initialisation was successful. Applying the following patch 
upon the aforementioned commit (in 3.8) fixes the issue for me on latest Debian:

```
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 5261ed3d4c..782138e4e4 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -3250,17 +3250,14 @@ static int
 module_init(void)
 {
 PyObject *module = NULL;
+if (module_initialized) {
+return 0;
+}
 
 asyncio_mod = PyImport_ImportModule("asyncio");
 if (asyncio_mod == NULL) {
 goto fail;
 }
-if (module_initialized != 0) {
-return 0;
-} 
-else {
-module_initialized = 1;
-}
 
 current_tasks = PyDict_New();
 if (current_tasks == NULL) {
@@ -3322,6 +3319,7 @@ module_init(void)
 }
 
 Py_DECREF(module);
+module_initialized = 1;
 return 0;
 
 fail:
```

--

___
Python tracker 

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



[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-05 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

It may seem weird, but a "membership operator" is a kind of "comparison 
operator".¹  They can even participate in chaining, 'a < b in s < c` is 
equivalent to `(a < b) and (b in s) and (b < c)`. 

I'm propose this new wording to mention the concept of "membership":

"The comparison operators `in` and `not in` are membership tests that determine 
whether a value is in (or not in) a container."

¹ https://docs.python.org/3/reference/expressions.html#comparisons

--

___
Python tracker 

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



[issue46256] Objects __del__ called after module have been removed

2022-01-05 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I'm getting this:

Traceback (most recent call last):
  File "/mnt/c/Users/sween/Source/Repos/cpython2/cpython/delbug.py", line 65, 
in 
conn = psycopg.connect('dbname=cuny_curriculum')
  File "/home/sween/.local/lib/python3.10/site-packages/psycopg/connection.py", 
line 572, in connect
raise ex.with_traceback(None)
psycopg.OperationalError: connection is bad: No such file or directory
Is the server running locally and accepting connections on that socket?

Is there a self-contained way to reproduce the issue without a DB up and 
running? Or to somehow shrink the reproducer down to its cpython-relevant bare 
essentials?

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-05 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
keywords: +patch
pull_requests: +28628
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/30423

___
Python tracker 

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



[issue46273] Document what asyncio.wait() and asyncio.as_completed() do if canceled.

2022-01-05 Thread Mikhail Terekhov


New submission from Mikhail Terekhov :

It is not clear from documentation what happens with awaitable objects when 
these are canceled.

--
assignee: docs@python
components: Documentation, asyncio
messages: 409801
nosy: asvetlov, docs@python, termim, yselivanov
priority: normal
severity: normal
status: open
title: Document what asyncio.wait() and asyncio.as_completed() do if canceled.
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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Note, GH-30423 does _not_ fix the win_py399_crash_reproducer.py issue.

--

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-05 Thread Jean-Paul Calderone


Jean-Paul Calderone  added the comment:

My understanding of the resolution of this ticket is that it is still not 
possible to use setrlimit with RLIMIT_STACK to raise the soft stack limit.  Is 
that correct?

In that case, the original bug report still seems valid and unresolved (and 
indeed, I am porting a project from Python 2.7 to Python 3.9 and on macOS it 
fails because it cannot raise the stack limit).

--
nosy: +exarkun

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e5894ca8fd05e6a6df1033025b9093b68baa718d by Nikita Sobolev in 
branch 'main':
bpo-46266:  Add calendar day of week constants to __all__  (GH-30412)
https://github.com/python/cpython/commit/e5894ca8fd05e6a6df1033025b9093b68baa718d


--

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the PR.  Sorry that I missed the one public reference in the docs.

--
resolution:  -> fixed
status: open -> closed
versions:  -Python 3.10, Python 3.9

___
Python tracker 

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



[issue46266] Improve day constants (`MONDAY` ... `SUNDAY`) in `calendar.py`

2022-01-05 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +28629
pull_request: https://github.com/python/cpython/pull/30424

___
Python tracker 

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



[issue46270] Comparison operators in Python Tutorial 5.7

2022-01-05 Thread Jan


Jan  added the comment:

I really like this solution because it mentions the buzz word "membership". But 
I would change "container" to "sequence" because the term "container" doesn't 
appear in chapter 5, "sequence" on the other hand multiple times. My proposal:

"The comparison operators `in` and `not in` are membership tests that determine 
whether a value is in (or not in) a sequence."

--
resolution:  -> works for me

___
Python tracker 

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



[issue46256] Objects __del__ called after module have been removed

2022-01-05 Thread Christopher Vickery


Christopher Vickery  added the comment:

The app has to open a db connection during module initialization to trigger the 
problem, so I can't provide a self-contained way to reproduce the problem.

The closest I can come is the attached file, format_rules_annotated.py.

With lines 66-69 in place, the problem occurs, even if there are no command 
line arguments, with Python 3.10, but not with Python 3.9. If I comment out 
lines 66-69 there is no problem with either 3.10 or 3.9, even if I add a 
command line argument that causes connections to be opened within functions 
defined within the module. (I added the explicit initialization of the 
institution_names dict so I could test those function calls without accessing 
the db during module initialization.)

FWIW, here is an execution under 3.10 with lines 66-69 commented out:

$ python -m format_rules_annotated -r QCC01:QNS01:PH:35
QCC01:QNS01:PH:35
C- or above in PH 101 at Queensborough, 4.0 credits, transfers to Queens as 
PHYS-11 and PHYS-14, 4.0 credits.
[No "Exception ignored" message appears here because db was not accessed during 
module initialization]
$

--
Added file: https://bugs.python.org/file50542/format_rules_annotated.py

___
Python tracker 

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



  1   2   >