[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Python shell uses  to evaluate while IDLE uses . Is that the 
problem?

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue44028] Request for locals().update() to work, it is

2021-05-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> loading the entire game or DNN (from STDIN) can be simply put into one line 
> as `locals().update(eval(sys.stdin.read()))`

This is how you get command injection attacks.

https://owasp.org/www-community/attacks/Command_Injection

https://cwe.mitre.org/data/definitions/77.html

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I'm not sure if this helps, but this is the relevant tree of callers:

suggestions.c: _Py_Offer_Suggestions() (the expected behavior) is only 
referenced by
pythonrun.c: print_exception(), which is only referenced by
pythonrun.c: print_exception_recursive(), which is only referenced by itself and
pythonrun.c: _PyErr_Display(), which is referenced by:
- threadmodule.c: thread_excepthook_file()
- pythonrun.c: PyErr_Display()
pythonrun.c: PyErr_Display() is referenced by:
- pythonrun.c: _PyErr_PrintEx()
- pythonrun.c: _Py_FatalErr_PrintExc()
- _testcapimodule.c: exception_print()
- sysmodule.c: sys_excepthook_impl() (Python's sys.excepthook)
pythonrun.c: _PyErr_PrintEx() is referenced by:
- pythonrun.c: PyErr_PrintEx() is referenced by
- pythonrun.c: PyErr_Print()
- pylifecycle.c: new_interpreter()
- pythonrun.c _PyErr_Print() is referenced by
- ceval.c:_Py_FinishPendingCalls()
- pylifecycle.c: init_importlib_external()
- pylifecycle.c: init_interp_main()

--

___
Python tracker 

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



[issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read()

2021-05-04 Thread Jonathan Schweder


Jonathan Schweder  added the comment:

@jcolo

Awesome to hear that you were able to run the example, in fact I got in the 
same trap, thinking the same that the example should carry the server and 
client side, I guess we can improve the documentation to avoid it, I'll sent a 
PR to make the improvement.

--

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

PyErr_Display() grabs the current sys.stderr and writes to that, but it looks 
like IDLE never gets to call PyErr_Display().

--

___
Python tracker 

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



[issue44028] Request for locals().update() to work, it is

2021-05-04 Thread wang xuancong


wang xuancong  added the comment:

Of course, I am aware of that. As elite-level Python programmers, we should all 
be aware of security issues whenever we deal with exec() and eval().

--

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

It looks like Lib/idlelib/run.py : print_exception() re-implements the 
traceback, rather than relying on sys.excepthook

--

___
Python tracker 

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



[issue43666] AIX: Lib/_aix_support.py may break in a WPAR environment

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44029] PEP 624: Remove Py_UNICODE APIs

2021-05-04 Thread Inada Naoki


New submission from Inada Naoki :

Ref: https://www.python.org/dev/peps/pep-0624/

--
components: C API
messages: 392862
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 624: Remove Py_UNICODE APIs
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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Indeed, this change enables the feature for IDLE, though I'm not sure what it 
breaks.

diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 07e9a2bf9c..319b16f311 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -569,7 +569,7 @@ def runcode(self, code):
 self.user_exc_info = sys.exc_info()  # For testing, hook, viewer.
 if quitting:
 exit()
-if sys.excepthook is sys.__excepthook__:
+if False:
 print_exception()
 else:
 try:

--

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Does the test suite run succesfully?

--

___
Python tracker 

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



[issue44029] PEP 624: Remove Py_UNICODE APIs

2021-05-04 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue37605] CI should not depend on gmane response

2021-05-04 Thread robin


robin  added the comment:

In other news, news.gmane.org is now news.gmane.io; see also 
https://bugs.python.org/issue39343

--
nosy: +eriker

___
Python tracker 

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



[issue43666] AIX: Lib/_aix_support.py may break in a WPAR environment

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7a92beea2cb13db3e42d39b169e124fa3b89dc36 by Miss Islington (bot) 
in branch '3.9':
bpo-43666: Lib/_aix_support.py routines may fail in a WPAR environment 
(GH-25095) (#25880)
https://github.com/python/cpython/commit/7a92beea2cb13db3e42d39b169e124fa3b89dc36


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 2046fb35e4e0986523bd0f6214fc318a414c8b97 by Miss Islington (bot) 
in branch '3.10':
bpo-44001: improve Literal documentation (GH-25877) (#25882)
https://github.com/python/cpython/commit/2046fb35e4e0986523bd0f6214fc318a414c8b97


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24559
pull_request: https://github.com/python/cpython/pull/25885

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e1bcc88a502aa0239b6bcc4da3fe024307fd27f4 by Miss Islington (bot) 
in branch '3.10':
bpo-38352: Add to typing.__all__ (GH-25821) (#25884)
https://github.com/python/cpython/commit/e1bcc88a502aa0239b6bcc4da3fe024307fd27f4


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 00726e51ade10c7e3535811eb700418725244230 by Miss Islington (bot) 
in branch '3.9':
bpo-38352: Add to typing.__all__ (GH-25821) (#25885)
https://github.com/python/cpython/commit/00726e51ade10c7e3535811eb700418725244230


--

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Fix merged to main (3.11), 3.10, and 3.9. Not applicable to older Pythons as 
they are security fixes only.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6

___
Python tracker 

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



[issue42083] PyStructSequence_NewType broken in 3.8

2021-05-04 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +24560
pull_request: https://github.com/python/cpython/pull/25886

___
Python tracker 

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



[issue44030] Markup with_traceback code example

2021-05-04 Thread Terry J. Reedy

New submission from Terry J. Reedy :

.../Doc/library/exceptions.rst, lines 99-105 has

  original ``SomeException`` had we allowed it to propagate to the caller.

 try:
 ...
 except SomeException:
 tb = sys.exc_info()[2]
 raise OtherException(...).with_traceback(tb)

The code example with no markup except indents does not work because without a 
new indent, the last line is merged with the preceding one as part of the same 
paragraph.

https://docs.python.org/3.10/library/exceptions.html#BaseException.with_traceback

traceback of the original SomeException had we allowed it to propagate 
to the caller.

try:

…
except SomeException:

tb = sys.exc_info()[2] raise 
OtherException(…).with_traceback(tb)

Note also the uneven line spacing, which is different for me here with Firefox 
that in the web page (also with Firefox).  Something different is needed, but I 
do not know what.

--
assignee: docs@python
components: Documentation
messages: 392871
nosy: docs@python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Markup with_traceback code example
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

(Shreyan, the fake filenames are not relevant.)

By default, sys.excepthook is sys.__excepthook is .  So by default IDLE runcode calls print_exception, which call 
cleanup_traceback for each traceback printed.  This function makes  two 
important changes to the traceback.

First, it removes traceback lines that are not present when running in the 
C-coded REPL, because IDLE does some functions with Python code.  The result is 
that IDLE tracebacks nearly always equal REPL tracebacks.

Second, for Shell code, IDLE add cached code lines.  Compare

>>> a = b
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'b' is not defined

to

>>> a = b
Traceback (most recent call last):
  File "", line 1, in 
a = b
NameError: name 'b' is not defined
>>> 

We are not going to stop using print_exception.  Note that it is normal for 
IDEs to modify tracebacks.


The 'is' is false when user change excepthook.  The false branch was recently 
added to run user excepthooks.

Pablo, I checked an AttributeError instance and the missing phrase is not 
present.  Why is it hidden from Python code.  Why not add the rest of the 
message to the message?  Or at least add it to the tuple or an attribute.  Or 
add a .get_suggestion method to exception objects, like .with_traceback.

--

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-05-04 Thread Michał Górny

Michał Górny  added the comment:

I hate to be the bearer of bad news but I've already found this change to be 
breaking tests of botocore and django.  In both cases, the test failure is 
apparently because upstream used to reject URLs after finding newlines in the 
split components, and now they're silently stripped away.

Filed bugs:
https://github.com/boto/botocore/issues/2377
https://code.djangoproject.com/ticket/32713

Note that I'm not saying the change should be reverted.

--
nosy: +mgorny

___
Python tracker 

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



[issue43001] python3.9.1python3.9.1 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


--
title: python3.9.1 test_embed test_tabnanny failed -> python3.9.1python3.9.1 
test_embed test_tabnanny failed

___
Python tracker 

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



[issue43001] python3.9.1 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


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

___
Python tracker 

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



[issue42083] PyStructSequence_NewType broken in 3.8

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43001] python3.8.9, python3.9.1 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


--
versions: +Python 3.8

___
Python tracker 

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



[issue43001] python3.8.9, python3.9.1 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S

Alexei S  added the comment:

python 3.8.9 also show compile problems
my system: Linux Mint 20.1 Cinnamon (Cinnamon 4.8.6)
kernel 5.8.0-48-generic
$uname -a
Linux home 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 
x86_64 x86_64 x86_64 GNU/Linux

I tried to execute problem code from tabnanny in PyCharm - that's ok
from test.support import (captured_stderr, captured_stdout, script_helper, 
findfile, unlink)


def validate_cmd(self, *args, stdout="", stderr="", partial=False):
"""Common function to assert the behaviour of command line interface."""
_, out, err = script_helper.assert_python_ok('-m', 'tabnanny', *args)
# Note: The `splitlines()` will solve the problem of CRLF(\r) added
# by OS Windows.
out = out.decode('ascii')
err = err.decode('ascii')
if partial:
for std, output in ((stdout, out), (stderr, err)):
_output = output.splitlines()
for _std in std.splitlines():
with self.subTest(std=_std, output=_output):
self.assertIn(_std, _output)
else:
self.assertListEqual(out.splitlines(), stdout.splitlines())
self.assertListEqual(err.splitlines(), stderr.splitlines())

def test_command_usage(self):
path = findfile('~/Загрузки/Python-3.8.9/Lib/test/tabnanny.py')
stderr = f"Usage: {path} [-v] file_or_directory ..."

self.validate_cmd(stderr=stderr)

--
title: python3.9.1python3.9.1 test_embed test_tabnanny failed -> python3.8.9, 
python3.9.1 test_embed test_tabnanny failed
Added file: https://bugs.python.org/file50006/make_test_3.8.9.log

___
Python tracker 

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



[issue37605] CI should not depend on gmane response

2021-05-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

nntp.rst, line 23, has already been updated to "s = NNTP('news.gmane.io').  But 
that also occasionally fails to respond.  I have not seen any test failures 
recently, so maybe something else has changes.  Should this be closed pending 
current failures?

--
versions: +Python 3.11 -Python 2.7, 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



[issue44025] Match doc: Clarify '_' as a soft keyword

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43001] python3.8.9, python3.9.1 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


Added file: https://bugs.python.org/file50007/log_make_test 3.9.2.log

___
Python tracker 

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



[issue43001] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


--
title: python3.8.9, python3.9.1 test_embed test_tabnanny failed -> python3.8.9, 
python3.9.2 test_embed test_tabnanny failed

___
Python tracker 

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



[issue43953] InitVar should not be available on a @dataclass-decorated class

2021-05-04 Thread Eric V. Smith

Eric V. Smith  added the comment:

I don’t see any way of changing this behavior, so I’m going to close this issue.

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

___
Python tracker 

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



[issue44025] Match doc: Clarify '_' as a soft keyword

2021-05-04 Thread miss-islington


miss-islington  added the comment:


New changeset ae4f8574993c85f9dc6fe60e6a25d65f688705e6 by Miss Islington (bot) 
in branch '3.10':
bpo-44025: Clarify when '_' is a keyword. (GH-25873)
https://github.com/python/cpython/commit/ae4f8574993c85f9dc6fe60e6a25d65f688705e6


--

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Pablo, I checked an AttributeError instance and the missing phrase is not 
> present

This cannot be included in the AttributeError because of performance reasons. 
These errors will be thrown naturally all over the place without this meaning 
that the interpreter will finish so we can only compute these safely on the 
except hook. 

We also discarded mutating the attribute error because it can make some stuff 
crash if the exception happens on a thread and that doesn't imply full program 
termination.

--

___
Python tracker 

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



[issue44026] IDLE doesn't offer "Did you mean?" for AttributeError and NameError

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I don't feel comfortable adding a public API to get the message either in the 
traceback or the exception, at least for the time being.

--

___
Python tracker 

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



[issue43742] tcp_echo_client in asyncio streams example does not work. Hangs for ever at reaser.read()

2021-05-04 Thread Jonathan Schweder


Change by Jonathan Schweder :


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

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


Added file: https://bugs.python.org/file50009/log_make 3.9.2.log

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S

New submission from Alexei S :

Python 3.9.2 make test
== Tests result: FAILURE then FAILURE ==

396 tests OK.

2 tests failed:
test_embed test_tabnanny

27 tests skipped:
test_bz2 test_curses test_dbm_gnu test_dbm_ndbm test_devpoll
test_gdb test_idle test_ioctl test_kqueue test_lzma test_msilib
test_ossaudiodev test_readline test_smtpnet test_ssl
test_startfile test_tcl test_tix test_tk test_ttk_guionly
test_ttk_textonly test_turtle test_winconsoleio test_winreg
test_winsound test_zipfile64 test_zoneinfo

2 re-run tests:
test_embed test_tabnanny

Total duration: 10 min 58 sec
Tests result: FAILURE then FAILURE
make: *** [Makefile:1199: test] Error 2

python 3.8.9 also show compile problems
my system: Linux Mint 20.1 Cinnamon (Cinnamon 4.8.6)
kernel 5.8.0-48-generic
$uname -a
Linux home 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 
x86_64 x86_64 x86_64 GNU/Linux

I tried to execute problem code from tabnanny in PyCharm - that's ok
from test.support import (captured_stderr, captured_stdout, script_helper, 
findfile, unlink)


def validate_cmd(self, *args, stdout="", stderr="", partial=False):
"""Common function to assert the behaviour of command line interface."""
_, out, err = script_helper.assert_python_ok('-m', 'tabnanny', *args)
# Note: The `splitlines()` will solve the problem of CRLF(\r) added
# by OS Windows.
out = out.decode('ascii')
err = err.decode('ascii')
if partial:
for std, output in ((stdout, out), (stderr, err)):
_output = output.splitlines()
for _std in std.splitlines():
with self.subTest(std=_std, output=_output):
self.assertIn(_std, _output)
else:
self.assertListEqual(out.splitlines(), stdout.splitlines())
self.assertListEqual(err.splitlines(), stderr.splitlines())

def test_command_usage(self):
path = findfile('~/Загрузки/Python-3.8.9/Lib/test/tabnanny.py')
stderr = f"Usage: {path} [-v] file_or_directory ..."

self.validate_cmd(stderr=stderr)

--
components: Tests
files: log_configure 3.9.2.log
messages: 392880
nosy: asholomitskiy84, terry.reedy, vstinner, wingarmac
priority: normal
severity: normal
status: open
title: python3.8.9, python3.9.2 test_embed test_tabnanny failed
type: compile error
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50008/log_configure 3.9.2.log

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


Added file: https://bugs.python.org/file50010/log_make_test 3.9.2.log

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


Added file: https://bugs.python.org/file50011/log_make_test 3.8.9.log

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Alexei S  added the comment:

this problem was announced also in 43001
https://bugs.python.org/issue43001?@ok_message=%D0%98%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5%D0%BD%D1%8B%20%D0%B0%D1%82%D1%80%D0%B8%D0%B1%D1%83%D1%82%D1%8B%20%D0%B7%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%B8%D0%B5%20%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82%D0%B0%20issue%2043001&@template=item

--

___
Python tracker 

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



[issue43001] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-04 Thread Alexei S


Change by Alexei S :


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

___
Python tracker 

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



[issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record

2021-05-04 Thread Safihre


Safihre  added the comment:

Understandable, as the feature freeze was yesterday :)

Just like to note that we have a 100.000 or so users (which I know is very 
little compared to overal number of Python users) of our application that this 
could really help.
 
We have used a lot of CPU cycles over the past year doing many repeated 
'recv(16384)' for SSL-sockets.

Thank you!

--

___
Python tracker 

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



[issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record

2021-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

You could try to convince Pablo. He is the release manager for 3.10. He can 
grant exceptions.

I also included Benjamin, Nathaniel, and Victor in the nosy list. They have a 
deeper understanding of the network I/O layer than me. I mostly take care of 
the crypto and X.509 part of the module.

--
nosy: +benjamin.peterson, njs, pablogsal, vstinner

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44014] Fix error in Enum documentation.

2021-05-04 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44014] Fix error in Enum documentation.

2021-05-04 Thread Łukasz Langa

Change by Łukasz Langa :


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



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

2021-05-04 Thread Petr Viktorin


Petr Viktorin  added the comment:

Sorry for not getting to this sooner, but 5 days is really tight for such a 
change.


With -S/-I, It would be great if sys.path only included packages installed as 
part of the OS, and not those installed by `sudo pip`. (Or `pip --user`, but 
that's covered).

It seems that with the current patch, pip will install into site-packages and 
there's no way to disable/change site-packages. Is that the case?

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue43075] ReDoS in urllib.request

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ada14995870abddc277addf57dd690a2af04c2da by Miss Islington (bot) 
in branch '3.7':
bpo-43075: Fix ReDoS in urllib AbstractBasicAuthHandler (GH-24391) (#25249)
https://github.com/python/cpython/commit/ada14995870abddc277addf57dd690a2af04c2da


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-05-04 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +24566
pull_request: https://github.com/python/cpython/pull/25892

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

3.8 is in security fixes mode but I'll happily take this for 3.9.

--
nosy: +lukasz.langa
versions:  -Python 3.8

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-05-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24567
pull_request: https://github.com/python/cpython/pull/25893

___
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

2021-05-04 Thread Filipe Laíns

Filipe Laíns  added the comment:

> My biggest concern is with the bare "import _vendor_config", which I'd prefer 
> to have restricted to a fixed location, rather than being influenced by 
> environment variables and other options. We already have an issue with 
> readline being imported from anywhere it can be found.

Oh, I share the same concern! Though users could already mess up Python pretty 
badly by shadowing/overwriting parts of it, so I didn't thought it would be 
that big of an issue. Is there a way to achieve this while still allowing us to 
do everything we want?

> Sorry for not getting to this sooner, but 5 days is really tight for such a 
> change.

No worries. It was my fault, I should have been more attentive to the Python 
release timeline.

> With -S/-I, It would be great if sys.path only included packages installed as 
> part of the OS, and not those installed by `sudo pip`. (Or `pip --user`, but 
> that's covered).

Perhaps we could add an option to enable only vendor site schemes?

> It seems that with the current patch, pip will install into site-packages and 
> there's no way to disable/change site-packages. Is that the case?

I mean, there is, though not as straightforward as -S/-I. I was planning on 
using it to build the distro entrypoint scripts, so that they only include the 
distro packages.

$ python -S
> site.addsitedir(sysconfig.get_path('purelib', 'vendor'))
> site.addsitedir(sysconfig.get_path('platlib', 'vendor'))

As I mentioned above, we could add a cli flag to do essentially the same.

--

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Ned Batchelder


Ned Batchelder  added the comment:

Thanks, tip of pytest works for me.  Is this error going to happen for everyone 
testing with 3.10b1?  If so, can we get a release of pytest?

--

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8655521de8760e8a695bcce92937800c079ea2b2 by Miss Islington (bot) 
in branch '3.10':
bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) 
(#25893)
https://github.com/python/cpython/commit/8655521de8760e8a695bcce92937800c079ea2b2


--

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 91cb1e20e6a432b8b2c1b5db37b03c84b15384fa by Miss Islington (bot) 
in branch '3.9':
bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) 
(#25890)
https://github.com/python/cpython/commit/91cb1e20e6a432b8b2c1b5db37b03c84b15384fa


--

___
Python tracker 

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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-05-04 Thread Łukasz Langa

Change by Łukasz Langa :


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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4bb0a815ef2b683af75f43ab20d52eaffe78b436 by Miss Islington (bot) 
in branch '3.10':
bpo-42686: Enable SQLite math functions in Windows build (GH-24053) (#25892)
https://github.com/python/cpython/commit/4bb0a815ef2b683af75f43ab20d52eaffe78b436


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:

Merged into 3.10 and 3.11.

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



[issue42083] PyStructSequence_NewType broken in 3.8

2021-05-04 Thread Petr Viktorin


Change by Petr Viktorin :


--
nosy: +petr.viktorin
nosy_count: 5.0 -> 6.0
pull_requests: +24568
pull_request: https://github.com/python/cpython/pull/25896

___
Python tracker 

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



[issue42083] PyStructSequence_NewType broken in 3.8

2021-05-04 Thread Petr Viktorin


Petr Viktorin  added the comment:

Changing PyType_FromSpec* to accept NULL has an issue: extensions built and 
tested with 3.9.5 would not work with the earlier 3.9s.

I'll send a PR to fix just PyStructSequence_NewType.

--

___
Python tracker 

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



[issue38352] In typing docs, note explicit import needed for IO and Pattern/Match

2021-05-04 Thread Jelle Zijlstra

Jelle Zijlstra  added the comment:

@Łukasz thanks for your merging spree!

I'm actually not sure this should go into 3.9. Seems potentially dangerous that 
people upgrading from an earlier 3.9 patch release will now see new names 
injected into their namespace if they do `from typing import *`.

--

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>  Is this error going to happen for everyone testing with 3.10b1?

3.10.0b1 includes both of these PRs so people testing the beta should not get 
affected. That's why I marked this as release blocker.

--

___
Python tracker 

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



[issue43349] [doc] incorrect tuning(7) manpage link

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4b90c8f17603e7ab4e4568cc8b9d5de4f8099973 by Miss Islington (bot) 
in branch '3.9':
closes bpo-43349: Fix tuning(7) manpage hyperlink. (GH-24680) (#25694)
https://github.com/python/cpython/commit/4b90c8f17603e7ab4e4568cc8b9d5de4f8099973


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Ned Batchelder


Ned Batchelder  added the comment:

The pytest failure still happens with 3.10.0b1 and pytest 6.2.3.  I'm asking if 
pytest can make a release to update.

--

___
Python tracker 

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



[issue27823] Change bare AttributeError messages to be more informative

2021-05-04 Thread Anilyka Barry


Anilyka Barry  added the comment:

I'd forgotten that I did that. Looking back on it, this is indeed not a good 
change. Since there hasn't been any traction on in for 5 years, I think it's 
safe to say it's not something people want.

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



[issue42083] PyStructSequence_NewType broken in 3.8

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ec18362f6a7fdc02f9f982872fc1006bca31627d by Petr Viktorin in 
branch '3.9':
[3.9] bpo-42083: Allow NULL doc in PyStructSequence_NewType (#25896)
https://github.com/python/cpython/commit/ec18362f6a7fdc02f9f982872fc1006bca31627d


--

___
Python tracker 

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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-05-04 Thread Alexei S


Change by Alexei S :


Added file: https://bugs.python.org/file50012/log_make_test 3.8.9.log

___
Python tracker 

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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-05-04 Thread Alexei S


Change by Alexei S :


Added file: https://bugs.python.org/file50013/log_make_test 3.9.2.log

___
Python tracker 

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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-05-04 Thread Alexei S


Alexei S  added the comment:

I have opened the same issue
https://bugs.python.org/issue44031

--
nosy: +asholomitskiy84

___
Python tracker 

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



[issue42083] PyStructSequence_NewType broken in 3.8

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Steve, thank you for your invaluable investigation. Thanks Petr for a better 
fix - your issue didn't come to my mind at the time.

Since all PRs have landed and the fix should arrive in Python 3.9.6, I am 
closing this issue. Please don't hesitate to reopen this if anyone feels it 
needs revisiting. Thanks!

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



[issue42067] Type annotation in for-loops

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

@pablo, may I close this issue as 'not a bug'? I think it looks like a feature 
request that belongs on https://discuss.python.org/c/ideas/ or 
https://mail.python.org/mailman3/lists/python-ideas.python.org/ instead. What 
do you think?

--
nosy: +pablogsal

___
Python tracker 

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



[issue42067] Type annotation in for-loops

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

Definitely one for Python ideas.
Quite a good idea though.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue43054] What does the existence of a struct in a header file imply about the C-API

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

Thanks for the responses.
Probably nothing to do for now.

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



[issue38135] Depth first search in compile.c creates wrong BB order for certain CFG.

2021-05-04 Thread Mark Shannon


Mark Shannon  added the comment:

This seems to have been fixed sometime.

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



[issue44032] Store locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-04 Thread Mark Shannon


New submission from Mark Shannon :

Currently, the local variables (inc. cell and free vars) for functions and the 
evaluation stack are kept in per-activation chunks in the frame object. This is 
not a good design for modern hardware.
The local variables and stack are amongst the hottest memory in the VM and 
should be stored in a contiguous stack in memory.

Allocating a per-thread stack would improve memory locality considerably, and 
pave the way to allocating heap objects for function activations lazily, only 
when needed for debugging and introspection.

Generators would still need heap allocated locals and stack, but that would be 
no worse than currently.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 392906
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Store locals and evaluation stack should be stored in a contiguous, 
per-thread stack
type: performance

___
Python tracker 

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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-04 Thread Mark Shannon


Change by Mark Shannon :


--
title: Store locals and evaluation stack should be stored in a contiguous, 
per-thread stack -> Function locals and evaluation stack should be stored in a 
contiguous, per-thread stack

___
Python tracker 

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



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Hi Miguel, with reference to 
https://github.com/python/cpython/pull/25760#issuecomment-830338306, Guido 
rejected the PR because he said that the current docs are correct.

This is a major point of confusion for many people, but here's why a single 
feature can be added in 2 versions: PEP 484 (Type Hints) was initially accepted 
as 'Provisional' (you can see what this means in PEP 1). To spare you the 
details, it's a special pass for typing.py to add new features in point 
releases, and to backport new features to older versions - even if they aren't 
bugfixes! This goes against what most of CPython allows (new features usually 
aren't allowed to be backported). However, at the time, typing.py was pretty 
new, so there wasn't much existing code to break anyways.

Another example is asyncio. Which has since lost its provisional status a long 
time ago AFAIK. typing.py became de-facto non-provisional in 3.7, though PEP 
484 hasn't been updated yet. This is why you may see stuff overlapping between 
3.5 and 3.6.

I hope you learnt something cool :). Hope to see you around contributing to 
other parts of CPython!

--
nosy: +kj
resolution:  -> not a bug
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



[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2021-05-04 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Jelle, thanks for fixing up the docs. You're right here - anything that can be 
an element in a frozenset or used as a key in a dict works. And the current 
docs for sets says that means anything hashable: 
https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset

If you feel anything's amiss. Please don't hesitate to re-open this issue.

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



[issue42067] Type annotation in for-loops

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Thanks for your input Mark!

--
components:  -Build
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-05-04 Thread Rahul Kumaresan


Rahul Kumaresan  added the comment:

Hello Ken Jin, Thanks for this clarification!

--

___
Python tracker 

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



[issue43624] Add underscore as a decimal separator for string formatting

2021-05-04 Thread Terry Davis


Terry Davis  added the comment:

If no one else has any comments, I'll assume there is consensus and start 
working on this. I have not contributed to CPython before, nor have I worked on 
production C code, so it may be a while before I get anywhere.

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



[issue43355] __future__.annotations breaks inspect.signature()

2021-05-04 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Python 3.10 will add an eval_str= argument to inspect.signature() that lets you 
evaluate string annotations. I don't think it makes sense to change anything in 
the bugfix branches, so I propose that this issue be closed.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue43978] Incorrect "versionadded" info in typing.NoReturn documentation

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

To answer the person who posted this on docs mailing list, after much 
investigation, it seems that this made it into 3.7.0, 3.5.4 and 3.6.2 .

Here's the 3.7.0 (alpha) commit for the initial implementation of 
typing.NoReturn:
https://github.com/python/cpython/commit/f06e0218ef6007667f5d61184b85a81a0466d3ae

The backport to 3.6 (at the time, this was 3.6.2rc1):
https://github.com/python/cpython/commit/e612c28513b406779d187e5f816445c7d40d292b

The backport to 3.5 (at the time, this was 3.5.4rc1):
https://github.com/python/cpython/commit/4b15e45895ca56ac5f7837cacb8cd3ccc26d1f66

I'm sorry if I got anything wrong (this is somewhat confusing for me too).

--

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +24569
pull_request: https://github.com/python/cpython/pull/25897

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Ken Jin


Ken Jin  added the comment:

Well something was amiss: the 3.9 backport PR ;-).

Sorry for closing this issue too early. I didn't notice there was still one 
more to go.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> The pytest failure still happens with 3.10.0b1 and pytest 6.2.3.

What I am missing? 3.10.0b1 includes the fixes for this issue, no? Is it 
because the fixes still require some changes in the source? If that's the case, 
we should mention it in the What's New

> I'm asking if pytest can make a release to update.

In any case, shouldn't that be requested in the pytest issue tracker?

--

___
Python tracker 

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



[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Anthony Sottile


Anthony Sottile  added the comment:

I've released pytest 6.2.4 for the other breakage (which is unrelated to this 
bpo -- it was the asname source position issue)

--

___
Python tracker 

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



[issue44001] typing.Literal: args must be hashable, not immutable

2021-05-04 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ab0a54adad8ddf488ccfb92970be9e4027673d19 by Jelle Zijlstra in 
branch '3.9':
[3.9] bpo-44001: improve Literal documentation (GH-25877). (#25897)
https://github.com/python/cpython/commit/ab0a54adad8ddf488ccfb92970be9e4027673d19


--

___
Python tracker 

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



[issue44033] Adding multiple keys of the same name to a dict doesn't raise an exception

2021-05-04 Thread Shreyan Avigyan


New submission from Shreyan Avigyan :

Adding multiple keys of the same name to a dict should raise an exception but 
instead causes a different behavior. For example consider this code,

>>> d = {"x" : "First value", "x" : "Second value", "y" : "Third value"}

One would expect a error because there two keys with the same name or that 
Python will add "x" : "First value" and will skip "x" : "Second value". But the 
result is opposite,

>>> d
{'x': 'Second value', 'y': 'Third value'}

Is this a bug or is this an intended behavior? (I may have missed out 
information related to this in the documentation. Kindly correct me if that's 
the case.)

--
messages: 392918
nosy: shreyanavigyan
priority: normal
severity: normal
status: open
title: Adding multiple keys of the same name to a dict doesn't raise an 
exception
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

I have installed autoconf-archive and autoconf 2.69 and tried to regenerate the 
configure script and it fails:


$ ls /share/aclocal/ax_* | wc -l
572

$ autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
, 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

$ autoreconf -v -f -i
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /opt/bb/bin/autoconf --force
autoreconf: running: /opt/bb/bin/autoheader --force
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'

$ ./configure
configure: error: Please install autoconf-archive package and re-run autoreconf

--
messages: 392920
nosy: christian.heimes, pablogsal
priority: normal
severity: normal
status: open
title: Regenerating the configure script fails even if dependencies are 
satisfied

___
Python tracker 

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



[issue44034] Incorrect type casting of float into int

2021-05-04 Thread Backbench Family


New submission from Backbench Family :

y = int(1.999) # fifteen decimal points
print(y)
1   # output is 1

y = int(1.) # sixteen decimal points
print(y)
2   # output is 2
It shows 1 when we type fifteen decimal whereas when we add sixteen decimal 
points the output becomes 2.

--
components: Windows
messages: 392919
nosy: hbutt4319, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Incorrect type casting of float into int
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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Reverting 
https://github.com/python/cpython/commit/5d6e8c1c1a5f667cdce99cb3c563ac922198678d
 works

--

___
Python tracker 

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



[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also:

grep -r AX_C_FLOAT_WORDS_BIGENDIAN /share/aclocal/
ax_c_float_words_bigendian.m4:#   AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], 
[ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
ax_c_float_words_bigendian.m4:AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
ax_c_float_words_bigendian.m4:])# AX_C_FLOAT_WORDS_BIGENDIAN

--

___
Python tracker 

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



[issue44036] asyncio SSL server can be DOSed, event loop gets blocked: busy loops and uses 100% CPU

2021-05-04 Thread ghost43


New submission from ghost43 :

This is about a potential DOS vector that can get an asyncio server serving SSL 
connections to enter a busy loop and hang. To recover the server (python 
process) needs to be restarted.

See downstream report at https://github.com/spesmilo/electrumx/issues/92

ElectrumX is server software that serves JSON-RPC requests either directly over 
plaintext TCP or over SSL/TLS (no HTTP involved). The server code is written 
using asyncio. The most popular client is also written using python+asyncio. 
However, there are other server implementations (e.g. in Rust), and other 
clients (e.g. in javascript, scala, java). The servers are part of a federated 
network and peer with each other.

In the last 1+ year, server operators have started reporting that the python 
process (of ElectrumX) sporadically hangs: it uses 100% CPU and stops serving 
clients or accepting new connections. The only way we could find to recover is 
restarting the server (the python process); waiting for even days did not help, 
python was stuck. The hang seemed to mostly happen on busy servers that serve 
several thousands of concurrent sessions, and even on those only happened e.g. 
once a month. So the hang was difficult to reproduce.

Nevertheless we observed that the hang only happens if it is the asyncio server 
that handles SSL, i.e. if the server operator put nginx in front of the python 
process and handles SSL termination in nginx, they would be unaffected. One 
server operator whose server at one point hanged multiple times a day confirmed 
this, and reported that nginx subsequently started logging lines like this:
```
2021/01/11 02:28:30 [crit] 21#21: *437620 SSL_shutdown() failed (SSL: 
error:14094123:SSL routines:ssl3_read_bytes:application data after close 
notify) while proxying connection, client: REDACTED, server: 0.0.0.0:50002, 
upstream: "127.0.0.1:50213", bytes from/to client:81/205, bytes from/to 
upstream:205/0
```

Over these last months, the hang has been reproduced on many different python 
versions by different people, e.g. 3.7.1, 3.7.5, 3.8.5, 3.9.1, 3.9.4.

A few days ago, many servers hanged almost simultaneously, and when restarted, 
they would soon hang again at most a few hours later. Presumably someone either 
flooded the network with buggy clients, or it might have been an attack. 
Anyway, this allowed me to look into this better. I set up gdb and waited. This 
was on ubuntu 20.04 with python 3.8.5 and openssl=1.1.1f-1ubuntu2.3.

It seems the event loop thread is stuck in a busy loop.
The deepest common stack frame looks to be at
https://github.com/python/cpython/blob/v3.8.5/Lib/asyncio/sslproto.py#L675

```
(gdb) py-bt
Traceback (most recent call first):
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 535, in feed_appdata

  File "/usr/lib/python3.8/asyncio/sslproto.py", line 675, in 
_process_write_backlog
ssldata, offset = self._sslpipe.feed_appdata(data, offset)
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 599, in _write_appdata
self._process_write_backlog()
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 387, in write
self._ssl_protocol._write_appdata(data)
  File "/usr/local/lib/python3.8/dist-packages/aiorpcx/rawsocket.py", line 118, 
in write
self._asyncio_transport.write(framed_message)
  File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 153, 
in _send_message
await self.transport.write(message)
  File "/usr/local/lib/python3.8/dist-packages/aiorpcx/session.py", line 496, 
in _throttled_request
await self._send_message(message)
  
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 2627, in _run_once
--Type  for more, q to quit, c to continue without paging--
  File "/usr/lib/python3.8/asyncio/base_events.py", line 826, in run_forever
None, getaddr_func, host, port, family, type, proto, flags)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in 
run_until_complete
self.run_forever()
  File "/usr/lib/python3.8/asyncio/runners.py", line 299, in run
  File "/usr/local/bin/electrumx_server", line 35, in main
asyncio.run(controller.run())
  File "/usr/local/bin/electrumx_server", line 43, in 
main()
```
```
(gdb) py-list
 530except (SystemExit, KeyboardInterrupt):
 531raise
 532except BaseException as e:
 533self._fatal_error(e, 'SSL error in data received')
 534return
>535
 536for chunk in ssldata:
 537self._transport.write(chunk)
 538
 539for chunk in appdata:
 540if chunk:
```
```
(gdb) py-locals
self = <_SSLPipe(_context=, 
_server_side=True, _server_hostname=None, _state='WRAPPED', 
_incoming=<_ssl.MemoryBIO at remote 0x7f09cc0925b0>, _outgoing=<_ssl.MemoryBIO 
at remote 0x7f09b919c430>, _sslobj=) at remote 0x7f09db428910>, _need_s

[issue44035] Regenerating the configure script fails even if dependencies are satisfied

2021-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

Dpes /opt/bb/bin/autoconf pick up the files in /share/aclocal? Both are rather 
unusual file locations.

--

___
Python tracker 

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



  1   2   >