[issue43248] platform.libc_ver() returns no information on Alpine Linux

2021-07-05 Thread Florian Bruhin


Change by Florian Bruhin :


--
nosy: +The Compiler

___
Python tracker 

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



[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-05 Thread Inada Naoki


Inada Naoki  added the comment:

iterating whole over the dict is O(n) where n is the historical max size of the 
dict.

On the other hand, there are no guarantee about `next(iter(d))` is O(1). The 
guarantee is O(n) at worst case. And your example is the worst case. So this is 
not a bug.

As Dennis wrote, we won't add doubly linked list to the dict only for this 
purpose.
OrderedDict is for the use case.

I don't have any better idea than bpo-32623. More ideas are welcome.

--

___
Python tracker 

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



[issue41676] asyncio.Event.wait broken link from asyncio.Event

2021-07-05 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Asyncio Event Documentation Links Incorrect

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread STINNER Victor

STINNER Victor  added the comment:

> Revert "bpo-44562: Remove invalid PyObject_GC_Del from error path of 
> types.GenericAlias … (GH-27016) (GH-27018)" (GH-27022)

That's a good idea :-)

The reverted commit caused many segfaults on macOS:
https://buildbot.python.org/all/#/builders/108/builds/122

4 tests failed:
test_cmd_line_script test_multiprocessing_main_handling
test_tarfile test_trace

--
nosy: +vstinner

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +25587
pull_request: https://github.com/python/cpython/pull/27028

___
Python tracker 

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



[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-05 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 09302405d22e86884d6058226790c0cdf5b72f14 by Dong-hee Na in branch 
'main':
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
https://github.com/python/cpython/commit/09302405d22e86884d6058226790c0cdf5b72f14


--

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Ken Jin


Ken Jin  added the comment:

> This change seems to emit deprecation warnings in test_pydoc.

test_typing emits them too as it tests importing things from __all__.

--

___
Python tracker 

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



[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25589
pull_request: https://github.com/python/cpython/pull/27030

___
Python tracker 

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



[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41576] document BaseException in favour of bare except in error tutorial

2021-07-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Serhiy/Terry: Is further discussion needed? Can this be closed, or should the 
proposed PR be applied (after resolving any issues)?

--
nosy: +erlendaasland

___
Python tracker 

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



[issue44565] python configure config.status: error: cannot find input file: `config.sh.in'

2021-07-05 Thread kevinshi


New submission from kevinshi :

config.status: error: cannot find input file: `config.sh.in'

--
components: Installation
messages: 396977
nosy: kevinshi
priority: normal
severity: normal
status: open
title: python configure config.status: error: cannot find input file: 
`config.sh.in'
type: compile error
versions: Python 3.6

___
Python tracker 

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



[issue1462485] StopIteration raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger


Thomas Grainger  added the comment:

```
import contextlib

@contextlib.contextmanager
def foo():
yield

class StartIrritation(StopIteration):
pass


with foo():
raise StartIrritation
```

--
nosy: +graingert

___
Python tracker 

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



[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger


New submission from Thomas Grainger :

https://bugs.python.org/issue1462485


import contextlib

@contextlib.contextmanager
def foo():
yield

class StartIrritation(StopIteration):
pass


with foo():
raise StartIrritation

--
messages: 396979
nosy: graingert, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: StopIteration subclass raised in body of 'with' statement suppressed
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue1462485] StopIteration raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger


Thomas Grainger  added the comment:

apologies I meant to post this on a new ticket

--

___
Python tracker 

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



[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-05 Thread miss-islington


miss-islington  added the comment:


New changeset 1f8486fd50ad4666078eb40ce9f24e8aac17a395 by Miss Islington (bot) 
in branch '3.10':
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
https://github.com/python/cpython/commit/1f8486fd50ad4666078eb40ce9f24e8aac17a395


--

___
Python tracker 

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



[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-05 Thread miss-islington


miss-islington  added the comment:


New changeset 9f47d872dbebdd95fd6b0a3351aeafaf82dfd203 by Miss Islington (bot) 
in branch '3.9':
bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012)
https://github.com/python/cpython/commit/9f47d872dbebdd95fd6b0a3351aeafaf82dfd203


--

___
Python tracker 

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



[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger


Thomas Grainger  added the comment:

This is the output:

```
Traceback (most recent call last):
  File "/home/graingert/projects/close.py", line 5, in foo
yield
  File "/home/graingert/projects/close.py", line 12, in 
raise StartIrritation
__main__.StartIrritation

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/graingert/projects/close.py", line 11, in 
with foo():
  File "/usr/lib/python3.10/contextlib.py", line 151, in __exit__
self.gen.throw(type, value, traceback)
RuntimeError: generator raised StopIteration
```


Note that this was fixed in @contextlib.asynccontextmanager
```
import asyncio
import contextlib

@contextlib.asynccontextmanager
async def foo():
yield

class StartIrritation(StopIteration):
pass


async def amain():
try:
async with foo():
raise StartIrritation
except StartIrritation:
print("good")
except RuntimeError:
print("bad")

asyncio.run(amain())
```

--

___
Python tracker 

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



[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger


Change by Thomas Grainger :


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

___
Python tracker 

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



[issue44565] python configure config.status: error: cannot find input file: `config.sh.in'

2021-07-05 Thread kevinshi


kevinshi  added the comment:

thanks
i'm resolved!
It because system's env has the same name for config.sh

--

___
Python tracker 

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



[issue44565] python configure config.status: error: cannot find input file: `config.sh.in'

2021-07-05 Thread kevinshi


Change by kevinshi :


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



[issue42889] Incorrect behavior after ast node visits

2021-07-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

We usually used 'fixed' for 'fixed in this issue'.  In any case, 'Resolution' 
is secdondary to 'Status'.

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

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-05 Thread Irit Katriel


Irit Katriel  added the comment:

This looks like a case of specialization.

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

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25591
pull_request: https://github.com/python/cpython/pull/27031

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b324c4c5f763c5116a97db8591e6dcb94456570a by Pablo Galindo in 
branch 'main':
bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021)
https://github.com/python/cpython/commit/b324c4c5f763c5116a97db8591e6dcb94456570a


--

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread miss-islington


miss-islington  added the comment:


New changeset d17cc1ff9fe82b17bbe589b83e440959c8f135d7 by Miss Islington (bot) 
in branch '3.10':
bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021)
https://github.com/python/cpython/commit/d17cc1ff9fe82b17bbe589b83e440959c8f135d7


--

___
Python tracker 

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



[issue44561] Some expired hyperlinks in Python documentation

2021-07-05 Thread Steven Hsu


Change by Steven Hsu :


--
pull_requests: +25592
pull_request: https://github.com/python/cpython/pull/27032

___
Python tracker 

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



[issue4600] __class__ assignment: new-style? heap? == confusing

2021-07-05 Thread Irit Katriel


Irit Katriel  added the comment:

The error messages are different now:

>>> class C: pass
...
>>> c = C()
>>> c.__class__ = 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __class__ must be set to a class, not 'int' object
>>> c.__class__ = object
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __class__ assignment only supported for mutable types or ModuleType 
subclasses
>>>

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-07-05 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


--
nosy: +sir-sigurd
nosy_count: 8.0 -> 9.0
pull_requests: +25593
pull_request: https://github.com/python/cpython/pull/27033

___
Python tracker 

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



[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Irit Katriel


Irit Katriel  added the comment:

+ PEP 489 authors.

--
nosy: +iritkatriel, ncoghlan, petr.viktorin, scoder

___
Python tracker 

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



[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Stefan Behnel


Stefan Behnel  added the comment:

Could you explain a bit why you want to subclass "PyModuleObject" in C? Why 
isn't a Python subclass or an independent (non-module) C extension type enough?

--

___
Python tracker 

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



[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Stefan Behnel


Change by Stefan Behnel :


--
components: +C API -Interpreter Core
type:  -> enhancement
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue23609] Export PyModuleObject in moduleobject.h

2021-07-05 Thread Stefan Behnel


Stefan Behnel  added the comment:

I only just noticed that the original request is from 2015. My guess is that 
this is a resolved problem, given the available options. I'll close this ticket 
as outdated. Please comment if this is still an issue.

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

___
Python tracker 

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



[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-07-05 Thread miss-islington


miss-islington  added the comment:


New changeset 7ac7a0c0f03c60934bc924ee144db170a0e0161f by Sergey Fedoseev in 
branch 'main':
bpo-44022: Fix Sphinx role in NEWS entry (GH-27033)
https://github.com/python/cpython/commit/7ac7a0c0f03c60934bc924ee144db170a0e0161f


--

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-05 Thread Steve Dower


Steve Dower  added the comment:


New changeset 1b133ab8412e4f6a53914212df7a7656f376256d by Steve Dower in branch 
'main':
bpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on 
Windows (GH-26984)
https://github.com/python/cpython/commit/1b133ab8412e4f6a53914212df7a7656f376256d


--

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43388] shutil._fastcopy_sendfile() makes wrong (?) assumption about sendfile() return value

2021-07-05 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Wouldn't this create infinite loop if a file cannot be fully copied for some 
reason?

--
nosy: +andrei.avk

___
Python tracker 

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



[issue43388] shutil._fastcopy_sendfile() makes wrong (?) assumption about sendfile() return value

2021-07-05 Thread Lorenz Hüdepohl

Lorenz Hüdepohl  added the comment:

Sure, as written it would. As I said: Error handling etc. left out for clarity, 
just to point out the new structure.

--

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-05 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +25595
pull_request: https://github.com/python/cpython/pull/27035

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks, I tried this and it works beautifully!

--

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Very much so. Irit, do you want to give it a try? (Note there are helpful 
instructions now in Python/adaptive.md.)

--

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-05 Thread Irit Katriel


Irit Katriel  added the comment:

Sure, I'll have a look.

--

___
Python tracker 

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



[issue44567] venv fails when called from within long path on Windows

2021-07-05 Thread schwaerz


New submission from schwaerz :

When trying to create a venv from within a long path name in Windows 10 (long 
paths enabled in the registry), python crashes. Used python 3.9.6.

When reducing the path length by one character, it starts working.
When disabling the long path support in Windows, I get an error message about 
paths being too long.

btw.: I can see same / similar behavior when using virtualenv/pipenv/poetry 
(did not try any other venv-like tooling...)

For the instructions please check the following snippet:

d:\slave\workspace\1--folder-with-232-character-absolute-path-length232>python
 -m venv .venv
Error: Command 
'['d:\\slave\\workspace\\1--folder-with-232-character-absolute-path-length232\\.venv\\Scripts\\python.exe',
 '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit 
status 3221226505.

%Errorlevel% sometimes was 1 and sometimes was -1073740791 (0xc409). 
Unfortunately I cannot recalled what I had to do to get the latter one... I 
tried with python 3.8.0, too. Same behavior.

--
components: Windows
messages: 397000
nosy: paul.moore, schwaerz, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: venv fails when called from within long path on Windows
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can that be fixed by changing test_pydoc?

--

___
Python tracker 

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



[issue43384] Include regen-stdlib-module-names in regen-all

2021-07-05 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This can be closed based on PR comment by nascheme.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 51a29c42f10bd9368db9a21f2f63319be2e30b95 by Ken Jin in branch 
'3.9':
[3.9] bpo-44562: Remove invalid PyObject_GC_Del from error path of 
types.GenericAlias … (GH-27016) (GH-27028)
https://github.com/python/cpython/commit/51a29c42f10bd9368db9a21f2f63319be2e30b95


--

___
Python tracker 

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



[issue43453] docs: runtime_checkable example refers to changed behavior in 3.10

2021-07-05 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 17f94e28882e1e2b331ace93f42e8615383dee59 by andrei kulakov in 
branch 'main':
bpo-43453: Update and re-add example to typing runtime_checkable (#27013)
https://github.com/python/cpython/commit/17f94e28882e1e2b331ace93f42e8615383dee59


--
nosy: +gvanrossum

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-05 Thread Steve Dower


Steve Dower  added the comment:


New changeset f3289a50503ed1a809d77fb03744bdcc7b9f1093 by Steve Dower in branch 
'3.10':
bpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on 
Windows (GH-26984)
https://github.com/python/cpython/commit/f3289a50503ed1a809d77fb03744bdcc7b9f1093


--

___
Python tracker 

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



[issue44479] Windows build doesn't regenerate some files

2021-07-05 Thread Steve Dower


Steve Dower  added the comment:

Great! I backported to 3.10, but we never took the other changes back to 3.9 so 
it can stop there.

--
assignee:  -> steve.dower
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 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



[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-05 Thread Daniel Fleischman


Daniel Fleischman  added the comment:

Thank you for your reply. I didn't know that this was the expected behavior 
(found it at https://wiki.python.org/moin/TimeComplexity):

"For these operations, the worst case n is the maximum size the container ever 
achieved, rather than just the current size. For example, if N objects are 
added to a dictionary, then N-1 are deleted, the dictionary will still be sized 
for N objects (at least) until another insertion is made."

Thank you for pointing out! 

I still disagree with this design since it's not how a person using a hash map 
expects it to behave. That said, this link clearly shows that it's *not* a bug, 
and that we just have different opinions on what is the best trade-off between 
space, code complexity, and speed, especially on something as ubiquitous as a 
dictionary.

Just one final attempt to gain support for my idea before I close the issue. 
When I proposed a linked list I didn't mean an "intro to programming" linked 
list, with pointers and a new malloc for every node. I meant simply adding two 
fields to PyDictKeyEntry with the indices of the next and previous valid 
entries. There would be a tiny memory overhead, and we would get a data 
structure that behaves how one would reasonably expect it to (compare with hash 
table found in the standard libraries of other languages. It's usually 
unexpected for an operation in a data structure to take time proportional to 
its historical value).

I will close this issue in two days if there are no further replies. Thank you 
for the discussion!

--

___
Python tracker 

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



[issue44568] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-07-05 Thread tongxiaoge

New submission from tongxiaoge :

I have reproduced this problem in the latest versions of Python 3.8.10 and 
3.9.6. Python 3.8.5 does not have this problem, other versions are not tested. 
The failure log is as follows:
[  457s] 0:02:34 load avg: 9.29 Re-running test_ssl in verbose mode
[  457s] test_ssl: testing with 'OpenSSL 1.1.1f  31 Mar 2020' (1, 1, 1, 6, 15)
[  457s]   under 
'Linux-4.19.36-vhulk1907.1.0.h748.eulerosv2r8.aarch64-aarch64-with-glibc2.17'
[  457s]   HAS_SNI = True
[  457s]   OP_ALL = 0x8054
[  457s]   OP_NO_TLSv1_1 = 0x1000
[  457s] test__create_stdlib_context (test.test_ssl.ContextTests) ... ok
[  457s] test_cert_store_stats (test.test_ssl.ContextTests) ... ok
[  457s] test_check_hostname (test.test_ssl.ContextTests) ... ok
[  457s] test_ciphers (test.test_ssl.ContextTests) ... ok
[  457s] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: 
Segmentation fault
[  457s] 
[  457s] Current thread 0x8e225010 (most recent call first):
[  457s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/ssl.py", line 
483 in __new__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 1126 in 
test_constructor
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 650 in 
_callTestMethod
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 693 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 753 in 
__call__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in 
__call__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in 
__call__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/runner.py", line 176 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 
2030 in _run_suite
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 
2152 in run_unittest
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 4848 in 
test_main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 234 in _runtest_inner2
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 270 in _runtest_inner
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 153 in _runtest
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 193 in runtest
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
318 in rerun_failed_tests
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
694 in _main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
637 in main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
715 in main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 46 in 
_main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 50 in 

[  457s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 
87 in _run_code
[  457s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 
194 in _run_module_as_main
[  457s] /var/tmp/rpm-tmp.gGVNgB: line 50: 2329201 Segmentation fault  
(core dumped) WITHIN_PYTHON_RPM_BUILD= LD_LIBRARY_PATH=$(pwd)/build/debug 
$(pwd)/build/debug/python -m test.regrtest -wW --slowest -j0 -x test_distutils 
-x test_bdist_rpm -x test_gdb -x test_socket -x test_asyncio
[  457s] error: Bad exit status from /var/tmp/rpm-tmp.gGVNgB (%check)

--
components: Tests
messages: 397008
nosy: sxt1001
priority: normal
severity: normal
status: open
title: test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: 
Segmentation fault
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue43453] docs: runtime_checkable example refers to changed behavior in 3.10

2021-07-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary

2021-07-05 Thread Ammar Askar


New submission from Ammar Askar :

During the implementation of PEP 657, Terry Jan Reedy pointed out that in the 
format method of traceback.StackSummary there are two roles being fulfilled, 
there is some logic to handle omitting repeated lines involved in recursive 
calls and then the core per-frame formatting logic:
 
https://github.com/python/cpython/blob/17f94e28882e1e2b331ace93f42e8615383dee59/Lib/traceback.py#L484-L503

To allow the per-line formatting to be overridden easily, these lines should be 
split into a separate method.

--
assignee: ammar2
components: Library (Lib)
messages: 397009
nosy: BTaskaya, ammar2, pablogsal, terry.reedy
priority: normal
severity: normal
status: open
title: traceback.py: Allow customization of per-frame line formatting in 
StackSummary
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



[issue43950] Include column offsets for bytecode instructions

2021-07-05 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25597
pull_request: https://github.com/python/cpython/pull/27037

___
Python tracker 

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



[issue44567] venv fails when called from within long path on Windows

2021-07-05 Thread Eryk Sun


Eryk Sun  added the comment:

The secure CRT string functions such as wcscpy_s() and wcscat_s() invoke the 
invalid parameter handler if the destination string is too small. This defaults 
to a fastfail that terminates with the status code 0xC409, subcode 5 
(FAST_FAIL_INVALID_ARG).

We're using buffers sized MAXPATHLEN+1 in PC/getpathp.c, which supports 256 
characters plus a terminating null. We could increase the buffer size, but bear 
in mind that Windows itself doesn't completely support running applications 
from a long path. So you may still hit road blocks.

--
nosy: +eryksun

___
Python tracker 

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



[issue44567] venv fails when called from within long path on Windows

2021-07-05 Thread schwaerz


schwaerz  added the comment:

I see.

Reading 
https://docs.python.domainunion.de/3/using/windows.html#removing-the-max-path-limitation
 I thought that the long paths on Win10 are supposed to be supported in general.

Is there any blocker in particular which I should keep in mind?

--

___
Python tracker 

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



[issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary

2021-07-05 Thread Ammar Askar


Change by Ammar Askar :


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

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

We could easily do what Ken did in PR-26811, and add 
"warnings.filterwarnings("default", category=DeprecationWarning)" to the test, 
but I would like to understand what is going on first. It seems the warnings 
are generated by test_builtin_with_more_than_four_children, which doesn't 
operate on typing directly. Here is a repro, without tests:

srittau@blitz:~/Projekte/cpython (typing-io *)$ ./python -Wall
Python 3.11.0a0 (heads/main:17f94e2888, Jul  5 2021, 19:19:04) [GCC 8.3.0] on 
linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydoc
>>> import typing
>>> doc = pydoc.TextDoc()
>>> x = doc.docclass(object)
/home/srittau/Projekte/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.io 
is deprecated, import directly from typing instead. typing.io will be removed 
in Python 3.12.
  if not cls.__name__.startswith("_") and cls.__module__ == "builtins"),
/home/srittau/Projekte/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.re 
is deprecated, import directly from typing instead. typing.re will be removed 
in Python 3.12.
  if not cls.__name__.startswith("_") and cls.__module__ == "builtins"),
>>> 

Same warning when calling "help(object)". This is not great. I assume that it 
is somehow related to pydoc.docclass() iterating over the the items of typing, 
but only if typing was imported. Please not that "io" and "re" are not part of 
typing.__all__.

I will investigate more.

--

___
Python tracker 

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



[issue4600] __class__ assignment: new-style? heap? == confusing

2021-07-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Change by Sebastian Rittau :


--
pull_requests: +25599
pull_request: https://github.com/python/cpython/pull/27039

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

pr-27039 suppresses warnings when accessing `typing.{re,io}.__module__`, which 
should fix this warning.

--

___
Python tracker 

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



[issue44567] venv fails when called from within long path on Windows

2021-07-05 Thread Steve Dower


Steve Dower  added the comment:

It enables it for accessing from within Python, but doesn't enable Python 
itself to be installed into a long path. And because a venv is essentially an 
installation, they're included in that. (Possibly %PYTHONPATH% entries are too.)

I haven't checked how widely MAXPATHLEN is used, but it may be safe enough to 
just raise it. However, I think that's going to have a memory impact, because 
the paths used for initialization are kept around for the whole length of the 
application now. It might be okay though, not sure how many paths are kept.

I'm still keen to see the whole getpath implementation replaced with Python 
code (with suitably injected native helpers), which would make it much easier 
for us to use dynamically allocated strings of any length. The current 
implementation is a way off being able to handle this.

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

___
Python tracker 

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



[issue44567] venv fails when called from within long path on Windows

2021-07-05 Thread Steve Dower


Steve Dower  added the comment:

Oh, and there's no harm in adding a note to that doc section explicitly 
pointing out that it doesn't enable CPython itself to be installed to a long 
path, and it may not enable packages to be imported from long paths in all 
scenarios (as it's very feasible that some 3rd party DLLs won't handle long 
paths).

--

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Why not just change "typing.io" to "typing"?

--

___
Python tracker 

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



[issue43384] Include regen-stdlib-module-names in regen-all

2021-07-05 Thread Neil Schemenauer


Change by Neil Schemenauer :


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

___
Python tracker 

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



[issue4600] __class__ assignment error message confusing

2021-07-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I neglected to mention above what c is.  I Irit guessed right as 

>>> class C: pass
... 
>>> c = C()

is what I (also) usually do for examples and testing.

Removing "new-style" elsewhere solved the issue with the error message for 
"ob.__class__ = non_class_object".  The new error message for "ob.__class__ = 
someclass" replaces 'heap' with 'mutable'.  But it can still be confusing as 
the qualification in

__class__ assignment only supported for mutable types or ModuleType subclasses

applies to both type(ob) and someclass and the same error is given if either 
does not qualify.  The use of the plural 'types' allows but does not mandate 
this interpretation.  Also, "mutable types" means that the types are mutable, 
not their instances.  Although 'list' is sometimes referred to as a 'mutable 
type' because its instances are, 'list' itself is not mutable and does not 
qualify here.

I am closing this issue, which is about the error message, because the new 
message is accurate when understood.  I cannot think of any better one-line 
message.  Explaining the background needed to understand should be done 
elsewhere.  

Andre, I nosied you in case the above would help you improve Friendly's 
explanation of this error.  I was a bit confused myself until I did more 
experiments.

Note: Even when type(ob) and someclass both 'qualify', the assignment will fail 
if instances are 'incompatible'.  Let M be a subclass of types.ModuleType.

c.__class__ = M  # fails with

TypeError: __class__ assignment: 'M' object layout differs from 'C'

The difference is obvious by looking as dir(c) and dir(M('somename')).

--
nosy: +aroberge
title: __class__ assignment: new-style? heap? == confusing -> __class__ 
assignment error message confusing
versions: +Python 3.11 -Python 3.3

___
Python tracker 

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Sebastian Rittau


Sebastian Rittau  added the comment:

typing.io is not referenced in either the tests or the implementation for 
pydoc. What happens is basically: typing.io is a class, so its derived from 
object. When formatting the docstring for object, the formatter queries the 
__module__ attribute of all sub-classes of object, including typing.io, so that 
it can include the sub-classes in its output:

--

Help on class object in module builtins:

class object
 |  The base class of the class hierarchy.
 |  
 |  When called, it accepts no arguments and returns a new featureless
 |  instance that has no instance attributes and cannot be given any.
 |  
 |  Built-in subclasses:
 |  anext_awaitable
 |  async_generator
 |  async_generator_asend
 |  async_generator_athrow
 |  ... and 88 other subclasses
 |  
[...]

--

Before the PR this failed, as accessing any typing.io.__module__ printed the 
warning.

--

___
Python tracker 

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



[issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code).

2021-07-05 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> I still disagree with this design since it's not 
> how a person using a hash map expects it to behave.

All mapping data structures have tradeoffs.  For the core dict type, we chose a 
structure that benefits most Python users most of the time.  If a user expects 
that the core dict type magically handles all cases optimally, that is a bug in 
their expectation, not a bug in Python.  

For the atypical pattern shown in slow_dictionary(), we recommend choosing a 
different data structure such as an OrderedDict or simply storing the keys in a 
deque.  This isn't a blow-off answer -- the stated goal of the collections 
module is to offer "specialized container datatypes providing alternatives to 
Python’s general purpose built-in containers, dict, list, set, and tuple."  
Those alternatives have different performance characteristics that may better 
serve particular access patterns.

Thanks for the suggestion, but this is not a bug.  It is an intentional design 
decision.  Changing the dict implementation to a linked list would make your 
case perform better but would make most users worse off.

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



[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-07-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks for the explanation. Let's reopen the issue for now.

--
status: closed -> open

___
Python tracker 

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



[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue43453] docs: runtime_checkable example refers to changed behavior in 3.10

2021-07-05 Thread miss-islington


miss-islington  added the comment:


New changeset 846cc4d28025ac4319069ec3c6db9526c75efd40 by Miss Islington (bot) 
in branch '3.10':
bpo-43453: Update and re-add example to typing runtime_checkable (GH-27013)
https://github.com/python/cpython/commit/846cc4d28025ac4319069ec3c6db9526c75efd40


--

___
Python tracker 

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



[issue43453] docs: runtime_checkable example refers to changed behavior in 3.10

2021-07-05 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue44566] StopIteration subclass suppressed by contextlib.contextmanager

2021-07-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
components: +Library (Lib)
title: StopIteration subclass raised in body of 'with' statement suppressed -> 
StopIteration subclass suppressed by contextlib.contextmanager
type:  -> behavior
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue44558] operator.countOf `is` / `==` inconsistency

2021-07-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue44547] fraction.Fraction does not implement __int__.

2021-07-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I am wondering whether one of __int__ or __trunc__ should be deprecated.

I would not miss __trunc__.

--
nosy: +rhettinger

___
Python tracker 

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



[issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build

2021-07-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build

2021-07-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset f64de53ff01e734d48d1d42195443d7d1646f220 by Serhiy Storchaka in 
branch 'main':
bpo-44563: Fix error handling in tee.fromiterable() (GH-27020)
https://github.com/python/cpython/commit/f64de53ff01e734d48d1d42195443d7d1646f220


--

___
Python tracker 

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



[issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build

2021-07-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25601
pull_request: https://github.com/python/cpython/pull/27042

___
Python tracker 

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



[issue44570] 3.10.0b3 doesn't trace line events for return in some cases

2021-07-05 Thread Ned Batchelder


New submission from Ned Batchelder :

(from https://github.com/nedbat/coveragepy/issues/1184)

This code runs the return statement on line 17 twice.  The second time, there 
is a "line" event and then a "return" event for that line.  But the first time, 
there is only a "return" event:

--- 8< ---
import linecache, sys

def trace(frame, event, arg):
# The weird globals here is to avoid a NameError on shutdown...
if frame.f_code.co_filename == globals().get("__file__"):
lineno = frame.f_lineno
print("{} {}: {}".format(event[:4], lineno, linecache.getline(__file__, 
lineno).rstrip()))
return trace

def foo(x):
if x:
try:
1/(x - 1)
except ZeroDivisionError:
pass

return x

def test_foo():
for i in range(2):
foo(i)

print(sys.version)
sys.settrace(trace)
test_foo()
-

I get this output with 3.10.0b3:

3.10.0b3 (default, Jun 18 2021, 06:43:38) [Clang 12.0.0 (clang-1200.0.32.29)]
call 19: def test_foo():
line 20: for i in range(2):
line 21: foo(i)
call 10: def foo(x):
line 11: if x:
retu 17: return x
line 20: for i in range(2):
line 21: foo(i)
call 10: def foo(x):
line 11: if x:
line 12: try:
line 13: 1/(x - 1)
exce 13: 1/(x - 1)
line 14: except ZeroDivisionError:
line 15: pass
line 17: return x
retu 17: return x
line 20: for i in range(2):
retu 20: for i in range(2):


Shouldn't there be a "line" event for both invocations?

--
components: Interpreter Core
keywords: 3.10regression
messages: 397024
nosy: Mark.Shannon, nedbat
priority: normal
severity: normal
status: open
title: 3.10.0b3 doesn't trace line events for return in some cases
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



[issue44571] itertools: takedowhile()

2021-07-05 Thread pavel-lexyr


New submission from pavel-lexyr :

As described in the documentation, itertools.takewhile() returns all the 
elements until the first one that does not match the provided criterion. In 
case of a destructive iterator, or one with side effects, not yielding an 
element downstream may render takewhile() unsuitable for use.

Proposed is itertools.takedowhile() - an alternate function that yields the 
first false element as well, and returns after. The behaviour is identical 
otherwise.

--
messages: 397025
nosy: pavel-lexyr, rhettinger
priority: normal
severity: normal
status: open
title: itertools: takedowhile()
type: enhancement

___
Python tracker 

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



[issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build

2021-07-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 324b93295fd81133d2dd597c3e3a0333f6c9d95b by Miss Islington (bot) 
in branch '3.9':
bpo-44563: Fix error handling in tee.fromiterable() (GH-27020) (GH-27042)
https://github.com/python/cpython/commit/324b93295fd81133d2dd597c3e3a0333f6c9d95b


--

___
Python tracker 

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



[issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build

2021-07-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 645e527298b1f24625783338076330037d860162 by Miss Islington (bot) 
in branch '3.10':
bpo-44563: Fix error handling in tee.fromiterable() (GH-27020) (GH-27041)
https://github.com/python/cpython/commit/645e527298b1f24625783338076330037d860162


--

___
Python tracker 

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



[issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build

2021-07-05 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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-05 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +25602
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/27043

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-05 Thread Irit Katriel


Change by Irit Katriel :


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



[issue44571] itertools: takedowhile()

2021-07-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion.  I agree that the loss of the non-matching element 
is an irritant.  The suggestion to return the first false element would solve 
that problem but is itself hard to work with.  The result would be difficult to 
reason about because all the elements are except one are true, the last is 
false, and you can't know that you have gotten a false element until one more 
call to next() to determine that no more elements are forthcoming.

Also, I'm reluctant to create any variants for takewhile() or dropwhile().  
Those have been the least successful itertools.  If I had it to do over again, 
they would not have been included.  For the most part, generator based 
solutions are superior in terms of readability, flexibility, and performance.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue44571] itertools: takedowhile()

2021-07-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
components: +Library (Lib)
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



[issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module

2021-07-05 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue35277] Upgrade bundled pip/setuptools

2021-07-05 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the comment. While the original intent of the issue was resolved (by 
updating the bundled pip), Serhiy's point about the size of the repo increasing 
is still an issue but there is a more recent issue, Issue36608, with a proposed 
change that addresses that aspect.

--
nosy: +ned.deily
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Replace bundled pip and setuptools with a downloader in the 
ensurepip module

___
Python tracker 

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



[issue44571] itertools: takedowhile()

2021-07-05 Thread pavel-lexyr


pavel-lexyr  added the comment:

I see. If the syntax allows for better ways to do it now, perhaps a move 
towards deprecation would be a better idea then? This would agree with the Zen.

Also, please elaborate more on the generator-based solutions you have in mind. 
The suggestion stems from a very real use case - and the lambda function we 
ended up using looks like a poor hack.

--

___
Python tracker 

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



[issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7

2021-07-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Here is my previous attempt at this, for reference:

https://github.com/python/cpython/pull/9853

--
nosy: +pablogsal

___
Python tracker 

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



[issue44570] 3.10.0b3 doesn't trace line events for return in some cases

2021-07-05 Thread Sergey B Kirpichev


Change by Sergey B Kirpichev :


--
nosy: +Sergey.Kirpichev

___
Python tracker 

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



[issue43895] Unnecessary Cache of Shared Object Handles

2021-07-05 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith, twouters
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