[issue43664] Long computations in pdb.run() lead to segfault

2021-04-05 Thread Xinmeng Xia


Xinmeng Xia  added the comment:

pdb.run() seems crashing different positions of Python (Python/ast_opt.c:488 
for pdb.run, Python/ast_opt.c:494 for compile()). But the commit 
364d0d20f924071b749e5a889eca22628f4892a3, PR 23744, bpo-42609 for compile() 
also fix this bug in pdb.run(). Should we close this issue and mark it as 
fixed? 



$ gdb ./python
(gdb) run
Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> compile("1+2" * 100, "-", "exec")

Program received signal SIGSEGV, Segmentation fault.
0x0063aedc in astfold_expr (node_=0xf5707d0, ctx_=0x76282450, 
state=0x7fffd608) at Python/ast_opt.c:494
494 CALL(astfold_expr, expr_ty, node_->v.BinOp.left);
(gdb) run
Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
>>> pdb.run("1+2"*100)

Program received signal SIGSEGV, Segmentation fault.
0x0063ac8f in astfold_expr (node_=0xf59b810, ctx_=0x761f7c30, 
state=0x7fffd1c8) at Python/ast_opt.c:488
488 {
(gdb)


$gdb 
'/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/python' 
(gdb) run
Python 3.10.0a3+ (default, Apr  6 2021, 11:24:27) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> compile("1+2" * 100, "-", "exec")
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded during compilation
>>> import pdb
>>> pdb.run("1+2"*100)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/Lib/pdb.py",
 line 1597, in run
Pdb().run(statement, globals, locals)
  File 
"/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/Lib/bdb.py",
 line 577, in run
cmd = compile(cmd, "", "exec")
RecursionError: maximum recursion depth exceeded during compilation

--

___
Python tracker 

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



[issue43599] Setting long domain of locale.dgettext() crashes Python interpreter

2021-04-05 Thread Christian Heimes


Christian Heimes  added the comment:

The crash occurs inside glibc's dgettext() implementation. Its man page does 
not list any limitation for domain or msgid length. This looks like a bug in 
glibc.

#0  0x77c57a8f in __dcigettext () from /lib64/libc.so.6
#1  0x0058a235 in _locale_dgettext_impl (in=0x7fffea64d8e0 "", 
domain=0x7fffe874e040 
"absabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsab"...,
 module=) at ./Modules/_localemodule.c:662

--
nosy: +christian.heimes

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-05 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +23946
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25207

___
Python tracker 

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



[issue43739] Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.

2021-04-05 Thread Shreyan Avigyan


New submission from Shreyan Avigyan :

In the example code of the Extending Python with C/C++ documentation the 
pmodule variable (that stores the return value of PyImport_ImportModule) was 
never declared. The PR(s) attached to this issue fixes it by declaring and 
initializing the pmodule variable. This issue is common in all the 
documentation versions. The first PR will be for documentation version 3.10. If 
it's accepted then I would request other developers to submit PRs for 
documentation 3.9, 3.8, 3.7 and 3.6 because I'm having a problem switching to 
those branches (I'm continuously facing the problem "HEAD detached" if I switch 
to those branches).

Thanking you

With Regards

--
assignee: docs@python
components: Documentation
messages: 390281
nosy: docs@python, shreyanavigyan
priority: normal
severity: normal
status: open
title: Fixing the example code in Doc/extending/extending.rst to declare and 
initialize the pmodule variable to be of the right type.
type: compile error
versions: Python 3.10, 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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43599] Setting long domain of locale.dgettext() crashes Python interpreter

2021-04-05 Thread Xinmeng Xia


Xinmeng Xia  added the comment:

Attached testing results of gdb and valgrind. (No error is reported for 
locale.dgettext('abs'*10,''))


$gdb ./python
(gdb) run
>>> locale.dgettext('abs'*1000,'')

Program received signal SIGSEGV, Segmentation fault.
__dcigettext (
domainname=domainname@entry=0xadb030 
"absabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsabsab"...,
 msgid1=msgid1@entry=0x77fc09a0 "", msgid2=msgid2@entry=0x0, 
plural=plural@entry=0, n=n@entry=0, category=category@entry=5) at 
dcigettext.c:675
675 dcigettext.c: No such file or directory.
(gdb)


valgrind
~$ PYTHONMALLOC=malloc_debug valgrind python
Memcheck, a memory error detector
==4870== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4870== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==4870== Command: /home/xxm/Desktop/apifuzz/Python-3.10.0a6/python
==4870== 
Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> locale.dgettext('abs'*1000,'')
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'locale' is not defined
>>> import locale
>>> locale.dgettext('abs'*1000,'')
==4870== Warning: client switching stacks?  SP change: 0x1ffefff5c0 --> 
0x1ffd363220
==4870==  to suppress, use: --max-stackframe=3032 or greater
==4870== Invalid write of size 8
==4870==at 0x5797E88: __dcigettext (dcigettext.c:675)
==4870==  Address 0x1ffd363218 is on thread 1's stack
==4870== 
==4870== 
==4870== Process terminating with default action of signal 11 (SIGSEGV)
==4870==  Access not within mapped region at address 0x1FFD363218
==4870==at 0x5797E88: __dcigettext (dcigettext.c:675)
==4870==  If you believe this happened as a result of a stack
==4870==  overflow in your program's main thread (unlikely but
==4870==  possible), you can try to increase the size of the
==4870==  main thread stack using the --main-stacksize= flag.
==4870==  The main thread stack size used in this run was 8388608.
==4870== Invalid write of size 8
==4870==at 0x4A2867A: _vgnU_freeres (vg_preloaded.c:57)
==4870==  Address 0x1ffd363210 is on thread 1's stack
==4870== 
==4870== 
==4870== Process terminating with default action of signal 11 (SIGSEGV)
==4870==  Access not within mapped region at address 0x1FFD363210
==4870==at 0x4A2867A: _vgnU_freeres (vg_preloaded.c:57)
==4870==  If you believe this happened as a result of a stack
==4870==  overflow in your program's main thread (unlikely but
==4870==  possible), you can try to increase the size of the
==4870==  main thread stack using the --main-stacksize= flag.
==4870==  The main thread stack size used in this run was 8388608.
==4870== 
==4870== HEAP SUMMARY:
==4870== in use at exit: 35,310,749 bytes in 35,706 blocks
==4870==   total heap usage: 87,221 allocs, 51,515 frees, 44,733,752 bytes 
allocated
==4870== 
==4870== LEAK SUMMARY:
==4870==definitely lost: 0 bytes in 0 blocks
==4870==indirectly lost: 0 bytes in 0 blocks
==4870==  possibly lost: 35,173,680 bytes in 34,899 blocks
==4870==still reachable: 137,069 bytes in 807 blocks
==4870== suppressed: 0 bytes in 0 blocks
==4870== Rerun with --leak-check=full to see details of leaked memory
==4870== 
==4870== For lists of detected and suppressed errors, rerun with: -s
==4870== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

--

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-04-05 Thread miss-islington


miss-islington  added the comment:


New changeset b132be8b43afa739b7eda271b82711d64a83da4f by Miss Islington (bot) 
in branch '3.8':
bpo-43176: Fix processing of empty dataclasses (GH-24484)
https://github.com/python/cpython/commit/b132be8b43afa739b7eda271b82711d64a83da4f


--

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-04-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23945
pull_request: https://github.com/python/cpython/pull/25206

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-04-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43176] Dataclasses derived from empty frozen bases skip immutability checks

2021-04-05 Thread miss-islington


miss-islington  added the comment:


New changeset 376ffc6ac491da74920aed1b8e35bc371cb766ac by Iurii Kemaev in 
branch 'master':
bpo-43176: Fix processing of empty dataclasses (GH-24484)
https://github.com/python/cpython/commit/376ffc6ac491da74920aed1b8e35bc371cb766ac


--
nosy: +miss-islington

___
Python tracker 

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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

@shreyanavigyan: Thank you for your efforts to improve Python!

--
resolution:  -> wont fix

___
Python tracker 

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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Yeah...I agree. Therefore this issue is resolved and I will close this issue 
now. Thanks everyone for the advice.

With Regards

--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-05 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23943
pull_request: https://github.com/python/cpython/pull/25204

___
Python tracker 

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



[issue27815] Make SSL suppress_ragged_eofs default more secure

2021-04-05 Thread Joshua Bronson


Change by Joshua Bronson :


--
nosy: +jab

___
Python tracker 

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



[issue43689] difflib: mention other "problematic" characters in documentation

2021-04-05 Thread Tim Peters


Tim Peters  added the comment:

Terry, your suggested replacement statement looks like an improvement to me. 
Perhaps the longer explanation could be placed in a footnote.

Note that I'm old ;-) I grew up on plain old ASCII, decades & decades ago, and 
tabs are in fact the only "characters" I've had a problem with in doctests. But 
then, e.g., I never in my life used goofy things like ASCII "form feed" 
characters, or NUL bytes, or ... in text either.

I don't use Unicode either, except to the extent that Python forces me to when 
I'm sticking printable ASCII characters inside string quotes ;-)

--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 4663e5f39e9f872dcd69545f293e832d5855d084 by Inada Naoki in branch 
'master':
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25190)
https://github.com/python/cpython/commit/4663e5f39e9f872dcd69545f293e832d5855d084


--

___
Python tracker 

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



[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-04-05 Thread Inada Naoki


Change by Inada Naoki :


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



[issue43689] difflib: mention other "problematic" characters in documentation

2021-04-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I have an alternate replacement:  "These lines can be confusing if the 
sequences contain tab characters or other characters that result in the 
indicator symbols in these lines being mislocated."

Or leave the current sentence as is.

Explanation with the details omitted from the above:
In 3.x, strings are unicode.  Even if one uses a fixed pitch font for the ascii 
subset, a majority of characters will be rendered either in a different fixed 
pitch or with variable pitch.  And on a graphics screen that is not simulating 
a fixed-pitch text terminal (such as Windows console), the so-called 
double-wide East Asian characters are not really double wide but more like 1.6 
times as wide.  The details depend on the OS, the font, and perhaps the font 
size.  One can explore this in the font sample box for the Font tab of the IDLE 
settings dialog.  The problems include chars less than 'one space', down to 0 
wide.  For general unicode, ^ marking does not work.  Syntax error marking has 
the same problem and there is no general solution.  

Tab is an example of a character that is either displayed as a variable space 
or a fixed double space ('\t') or larger.  If we were to make a change, we 
should mention, as above, that many non-ascii chars are as especially confusing 
as tabs.

In your example above, the caret at least points to the right space.  It 
correctly indicates some difference beyond the visible end - a non-visible 
whitespace difference.

--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset fb78692f2ad5ee4747f13a73943fbf134b637669 by Inada Naoki in branch 
'master':
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25189)
https://github.com/python/cpython/commit/fb78692f2ad5ee4747f13a73943fbf134b637669


--

___
Python tracker 

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



[issue23470] OpenBSD buildbot uses wrong stdlib

2021-04-05 Thread Ned Deily


Change by Ned Deily :


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



[issue42128] Structural Pattern Matching (PEP 634)

2021-04-05 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset f84d5a113680c5a6aaaf9130aed7a34d611748ff by Brandt Bucher in 
branch 'master':
bpo-42128: __match_args__ can't be a list anymore (GH-25203)
https://github.com/python/cpython/commit/f84d5a113680c5a6aaaf9130aed7a34d611748ff


--

___
Python tracker 

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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-05 Thread Ma Lin


Ma Lin  added the comment:

ping

--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 3d4af4a876e679431c6a3751667ded63cc6f66c1 by Inada Naoki in branch 
'master':
bpo-43651: Fix EncodingWarning in sysconfig (GH-25192)
https://github.com/python/cpython/commit/3d4af4a876e679431c6a3751667ded63cc6f66c1


--

___
Python tracker 

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



[issue42128] Structural Pattern Matching (PEP 634)

2021-04-05 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +23942
pull_request: https://github.com/python/cpython/pull/25203

___
Python tracker 

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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Eric V. Smith

Eric V. Smith  added the comment:

I agree with Ned. This is why I'm not sure it’s worth changing the message: 
googling gives good information, and the exact thing to do in order resolve 
this (if it’s even possible) is dependent on a number of factors that the code 
raising the exception can’t know.

--

___
Python tracker 

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



[issue43738] Clarify public name of curses.window

2021-04-05 Thread Ryan McCampbell


New submission from Ryan McCampbell :

Until 3.8 the curses window class was not directly available in code, but now 
it is available as `_curses.window`. This is not explicitly stated in the 
documentation (although it is consistent with how the method signatures are 
written). It is useful to have a public name for the type to aid IDE's with 
explicit type annotations, i.e.

@curses.wrapper
def main(stdscr: curses.window):
stdscr.addstr(...)

See https://github.com/python/typeshed/pull/5180, which adds this name to type 
hints in the typeshed project.

This name should be more clearly documented so programmers can annotate the 
type without worrying that it may change (which will cause a runtime error 
unless it is quoted).

--
assignee: docs@python
components: Documentation
messages: 390266
nosy: docs@python, rmccampbell7
priority: normal
severity: normal
status: open
title: Clarify public name of curses.window
type: enhancement
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative

2021-04-05 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> the result is different from other languages which is why it can be 
> surprising.

Maybe the other languages should be documenting their surprising result, which 
fails to preserve the identity?

> Do we - add a warning to the [tutorial] page, or should we link to a new page 
> that details and explains the behavior.

Neither. Warnings are for *dangerous or risky behaviour*, this is neither. And 
we surely don't need an entire new page just to document a minor piece of 
arithmetic behaviour.

The behaviour (although not the rationale for it) is already documented here:

https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations

although not here:

https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex

You could add a note to the table at the second link, and a FAQ next to this:

https://docs.python.org/3/faq/programming.html#why-does-22-10-return-3

--
nosy: +steven.daprano

___
Python tracker 

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



[issue43737] Documentation of modulo operator should document behaviour clearly when second operator is negative

2021-04-05 Thread Anthony Flury


New submission from Anthony Flury :

The behavior of a%b when a is positive and b is negative can be suprising. 

I understand that the behavior is so that the identity 

a = (a//b)*b + a%b 

can be preserved regardless of the signs of a or b.

but the result is different from other languages which is why it can be 
surprising.

I would be happy to do the grunt work to make the changes if some can suggest 
where.

Do we - add a warning to the 
https://docs.python.org/3/tutorial/introduction.html#numbers page, or should we 
link to a new page that details and explains the behavior. Which is more 
'pythonic' in terms of documentation ?

--
messages: 390264
nosy: anthony-flury
priority: normal
severity: normal
status: open
title: Documentation of modulo operator should document behaviour clearly when 
second operator is negative

___
Python tracker 

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



[issue43684] Add combined opcodes

2021-04-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

So dynamically, I see about 0.5% of all opcodes are ADD_INT, so higher than 
statically (which was 0.1%) but still small enough that I'm abandoning work on 
ADD_INT.

I've got a branch where I'm adding POP_JUMP_IF_NONE and POP_JUMP_IF_NOT_NONE 
(which capture if x is None, if x is not None) but the static count there is 
still pretty low, around 0.2% statically. These numbers are remarkably stable 
-- I get 0.2% exactly for mypy, 0.18% for the stdlib. (A bit more in the 
azure-cli source code: 0.35%.)

I expect that the dynamic count here would be a bit higher too: without running 
it, I'd expect around 1%, if we take it that the average loop does about 5 
iterations -- my results for ADD_INT would lead to that conclusion, and this 
was independently verified by an Instagram blog post from 2017. 
(https://instagram-engineering.com/profiling-cpython-at-instagram-89d4cbeeb898, 
search for "loopyness")

Is that enough to persevere? I really don't know.

I have a few other potential opcode combinations, RETURN_CONST and RETURN_NONE, 
but since those (by definition) don't occur in a loop, I'm even less optimistic 
about the value of those.

We really should optimize things like LOAD_FAST + LOAD_FAST, which occurs much 
more frequently. However the way to encode that combination is pretty gross, 
and I'd rather do that another time.

--

___
Python tracker 

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



[issue43736] asyncio create_task() odd behavior

2021-04-05 Thread Zachary Ware


Zachary Ware  added the comment:

You missed something :)

By immediately awaiting the result of `create_task`, you're synchronizing 
thing.  It's the same as just rearranging the lines of the first example to:

t0 = create_task(task("T0", 10))
print("starting tasks ...")
await t0
t1 = create_task(task("T1", 10))
await t1

Basically, `t1` simply doesn't exist yet when you ask `t0` to run to completion.

--
nosy: +zach.ware
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue23470] OpenBSD buildbot uses wrong stdlib

2021-04-05 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Is the OpenBSD buildbot still active? If no, this issue can be closed.

(I can't find the OpenBSD buildbot on https://buildbot.python.org/all/#/)

--
nosy: +erlendaasland

___
Python tracker 

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



[issue43736] asyncio create_task() odd behavior

2021-04-05 Thread Yanghao Hua


New submission from Yanghao Hua :

This code runs perfectly fine with expected behavior: two tasks created, 
executed in an interleaved manner:

from time import time
from asyncio import run, create_task, sleep

async def task(name, n): 
for i in range(n):
print(f"task-{name}: ", i, time())
await sleep(1)

async def top():
t0 = create_task(task("T0", 10))
t1 = create_task(task("T1", 10))
print("starting tasks ...")
await t0
await t1

run(top())

Output:
starting tasks ...
task-T0:  0 1617656271.6513114
task-T1:  0 1617656271.6513336
task-T0:  1 1617656272.6526577
task-T1:  1 1617656272.652813
task-T0:  2 1617656273.654187
task-T1:  2 1617656273.6543217
task-T0:  3 1617656274.655706
task-T1:  3 1617656274.6558387
task-T0:  4 1617656275.65722
task-T1:  4 1617656275.657355
task-T0:  5 1617656276.6587365
task-T1:  5 1617656276.6588728
task-T0:  6 1617656277.660276
task-T1:  6 1617656277.6604114
task-T0:  7 1617656278.6617858
task-T1:  7 1617656278.66192
task-T0:  8 1617656279.6633058
task-T1:  8 1617656279.6634388
task-T0:  9 1617656280.6648436
task-T1:  9 1617656280.6649704

However, with slightly modified `async def top()`, things become executing 
sequentially:

async def top():
print("starting tasks ...")
await create_task(task("T0", 10))
await create_task(task("T1", 10))

Output:
starting tasks ...
task-T0:  0 1617656306.1343822
task-T0:  1 1617656307.1357212
task-T0:  2 1617656308.1369958
task-T0:  3 1617656309.1384225
task-T0:  4 1617656310.1398354
task-T0:  5 1617656311.1412706
task-T0:  6 1617656312.1427014
task-T0:  7 1617656313.1441336
task-T0:  8 1617656314.143
task-T0:  9 1617656315.1468768
task-T1:  0 1617656316.1482618
task-T1:  1 1617656317.1496553
task-T1:  2 1617656318.151089
task-T1:  3 1617656319.1525192
task-T1:  4 1617656320.153974
task-T1:  5 1617656321.1554224
task-T1:  6 1617656322.1568594
task-T1:  7 1617656323.1582792
task-T1:  8 1617656324.1597185
task-T1:  9 1617656325.1611636

This breaks the behavior expectation, where created tasks should have been 
executing in parallel. It seems if a created task is immediately awaited, it is 
not returning to the top() immediately, and instead, it executes the task and 
waited until it finishes.

Is this a bug, or did I miss something?

Thank you.

--
components: asyncio
messages: 390260
nosy: asvetlov, yanghao.py, yselivanov
priority: normal
severity: normal
status: open
title: asyncio create_task() odd behavior
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-04-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks for the fix!

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 028d5286d4255195ba6715e1aeb4bffed6b0279e by Miss Islington (bot) 
in branch '3.9':
bpo-20503: Show how isinstance() works with ABC registered classes. (GH-25175) 
(GH-25202)
https://github.com/python/cpython/commit/028d5286d4255195ba6715e1aeb4bffed6b0279e


--

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 013c30e5fcee449cee63354d34585d6111782c82 by Miss Islington (bot) 
in branch '3.9':
bpo-36470: Allow dataclasses.replace() to handle InitVars with default values 
(GH-20867) (GH-25200)
https://github.com/python/cpython/commit/013c30e5fcee449cee63354d34585d6111782c82


--

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset bdee2a389e4b10e1c0ab65bbd4fd03defe7b2837 by Miss Islington (bot) 
in branch '3.8':
bpo-36470: Allow dataclasses.replace() to handle InitVars with default values 
(GH-20867) (GH-25201)
https://github.com/python/cpython/commit/bdee2a389e4b10e1c0ab65bbd4fd03defe7b2837


--

___
Python tracker 

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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Ned Deily


Ned Deily  added the comment:

"Install a supported _curses library"

That's not correct advice. _curses is the name of the support module written in 
C in the Python Standard Library. If it is not available to import in an 
installation, it's most likely because the build of the module failed because 
the third-party libraries that implement curses functionality was not installed 
or not found during the build. How you install the third-party curses library 
varies greatly by platform or distribution. Some distributions have multiple 
variants of curses packages, ones with just libraries and others ("-dev" 
packages) that include header files necessary for Python to build its _curses 
module.  The Dev Guide has some information on dependencies in general and the 
details for _curses are in the code in setup.py.  It's also possible that the 
distributor has broken Python curses support out into a separate package. So 
it's not easy to provide a message with a useful specific suggestion; there are 
just too many cases.

--

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-04-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 7bc25ec7276db2a81e7823671a74eeb8aa6b4542 by Raymond Hettinger in 
branch 'master':
bpo-20503: Show how isinstance() works with ABC registered classes. (GH-25175)
https://github.com/python/cpython/commit/7bc25ec7276db2a81e7823671a74eeb8aa6b4542


--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-04-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

LGTM.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-04-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-04-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23940
pull_request: https://github.com/python/cpython/pull/25201

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-04-05 Thread miss-islington


miss-islington  added the comment:


New changeset 75220674c07abfc90c2cd7862d04cfa2e2354450 by Zackery Spytz in 
branch 'master':
bpo-36470: Allow dataclasses.replace() to handle InitVars with default values 
(GH-20867)
https://github.com/python/cpython/commit/75220674c07abfc90c2cd7862d04cfa2e2354450


--
nosy: +miss-islington

___
Python tracker 

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



[issue36470] dataclasses.replace raises an exception if InitVar with default argument is not provided.

2021-04-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23939
pull_request: https://github.com/python/cpython/pull/25200

___
Python tracker 

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



[issue41837] Upgrade installers to OpenSSL 1.1.1j

2021-04-05 Thread Ned Deily


Ned Deily  added the comment:

Now updated to OpenSSL 1.1.1k in Issue43631

--
priority: deferred blocker -> 
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed
superseder:  -> Update to OpenSSL 1.1.1k

___
Python tracker 

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



[issue43087] ctypes documentation error

2021-04-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 14829b09eb652f457cf837836909169746a810f0 by Zackery Spytz in 
branch 'master':
bpo-43087: Fix error in ctypes "Incomplete Types" doc (GH-24404)
https://github.com/python/cpython/commit/14829b09eb652f457cf837836909169746a810f0


--
nosy: +terry.reedy

___
Python tracker 

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



[issue43087] ctypes documentation error

2021-04-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23938
pull_request: https://github.com/python/cpython/pull/25199

___
Python tracker 

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



[issue43087] ctypes documentation error

2021-04-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-05 Thread Bartosz


Bartosz  added the comment:

Done so: https://github.com/python/cpython/pull/25197

Signed the CLA thing too, it seems it'll take a while to update tho.

--

___
Python tracker 

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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Is this issue ready for a PR?

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-04-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

To me it looks simpler though. The locals and cells are already stored in a 
single array, f_localsplus (which also contains the evaluation stack). There 
are various complications in ceval.c to translate cell indexes to indexes in 
this array (ein particular the extra local variable 'freevars', which weighs 
down the stack frame).

Making the interpreter simpler by moving things to the compiler also makes it 
easier for the C compiler to optimize the code of the interpreter better.

--
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-05 Thread Bartosz


Change by Bartosz :


--
pull_requests: +23936
pull_request: https://github.com/python/cpython/pull/25197

___
Python tracker 

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



[issue17305] IDNA2008 encoding is missing

2021-04-05 Thread Christian Heimes


Christian Heimes  added the comment:

The issue has been waiting for contributions for 8 years now. So far nobody has 
shown an interested to address the problem and contribute an IDNA 2008 codec to 
Python's standard library.

--

___
Python tracker 

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



[issue43728] Change the exception message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
title: Change the exception type and message raised when _curses is not found. 
-> Change the exception message raised when _curses is not found.

___
Python tracker 

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



[issue38794] Setup: support linking openssl statically

2021-04-05 Thread Lukas Vacek


Lukas Vacek  added the comment:

Thanks for the explanation of the secret workings behind the scenes.

What a productive and polite response.

--

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Is this confirmed? If yes then I'll open a PR on 
https://github.com/python/cpython

--

___
Python tracker 

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



[issue22538] turtledemo two_canvases reversion

2021-04-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you.  I had forgotten about this.  It also works as advertised in the 
module docstring on Windows, 3.8 and 3.10.  There has been no change to the 
code, so a patch to turtle itself must have fixed the problem.

--
resolution:  -> out of date
stage: test needed -> 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



[issue27129] Wordcode, part 2

2021-04-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing as this is fixed. Feel free to reopen if there is something missing

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-05 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

> "migrate to a supported platform" is almost never practical advice. If we 
> make any change, I'd just say it's not supported on this platform. Or maybe 
> "you may be running on platform that is not supported by curses".

Ok...So what about a message like this :-
ModuleNotFoundError: _curses library not found. Install a supported _curses 
library to use the curses module (The _curses library may not be supported on 
your platform).

--

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

While I wouldn't object to tweaking the message associated with the exception, 
I'm not sure it's necessary. Googling "curses modulenotfound" gives a number of 
hits that have good information about the issue. Is there really a practical 
problem that's being solved here?

"migrate to a supported platform" is almost never practical advice. If we make 
any change, I'd just say it's not supported on this platform. Or maybe "you may 
be running on platform that is not supported by curses".

--

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

> Is installing _curses possible, on any supported platform? Or would a better 
> message say that curses is not supported on this platform?

No _curses can't be installed on any platform. I don't know about macOS but 
_curses can be installed on Windows and Linux (and presumably any UNIX-based 
OS). On Windows, Christoph Gohlke's unofficial curses, windows-curses and lot's 
of libraries allows us to use _curses library. Though I think curses can't be 
used directly on Windows cmd or powershell. Terminals provided by the Mingw-w64 
project, the Cygwin project, etc., most presumably support curses library. WSL 
terminal also seem to support curses (ncurses). 

So what about a error message like this :-

ModuleNotFoundError: _curses library not found. Install a supported _curses 
library to use the curses module or migrate to a supported platform.

N.B.: UniCurses library may work with Windows cmd or powershell because it 
wraps up the PDCurses library on Windows which was developed specifically to 
work with Windows. Though UniCurses actually can't be used with the Python 
built-in module curses. We have to specifically import 'unicurses' to use it.

--

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

> ModuleNotFoundError: _curses library not found. Install a supported _curses 
> library to use the curses module.

Is installing _curses possible, on any supported platform? Or would a better 
message say that curses is not supported on this platform?

--
nosy: +eric.smith

___
Python tracker 

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



[issue2889] curses for windows (alternative patch)

2021-04-05 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result"

2021-04-05 Thread Thomas Cavalli


Change by Thomas Cavalli :


--
resolution:  -> works for me
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



[issue41570] Add DearPyGui to faq/gui.rst

2021-04-05 Thread Irit Katriel


Irit Katriel  added the comment:

Did you have someone in mind? If you want a stranger to pick it up it might 
help if you explain on the issue what you are suggesting to change and why you 
closed the PR.

--

___
Python tracker 

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



[issue41570] Add DearPyGui to faq/gui.rst

2021-04-05 Thread Jonathan Hoffstadt

Jonathan Hoffstadt  added the comment:

I hoped someone else could complete it it. 

Sent from my iPhone

> On Apr 4, 2021, at 10:03 AM, Irit Katriel  wrote:
> 
> 
> New submission from Irit Katriel :
> 
> Jonathan, I see you closed the PR. Did you intend to close this issue as well?
> 
> --
> nosy: +iritkatriel
> status: open -> pending
> 
> ___
> Python tracker 
> 
> ___

--
status: pending -> open

___
Python tracker 

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



[issue43084] curses.window.enclose() should return bool

2021-04-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue43084] curses.window.enclose() should return bool

2021-04-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b1dc1aacf8b0f319024a1a3ce91d395956537c11 by Serhiy Storchaka in 
branch 'master':
bpo-43084: Return bool instead of int from curses.window.enclose() (GH-24398)
https://github.com/python/cpython/commit/b1dc1aacf8b0f319024a1a3ce91d395956537c11


--

___
Python tracker 

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



[issue43734] PEP 597: pdb uses locale encoding for pdbrc file

2021-04-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> pdb uses the locale encoding for .pdbrc

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-05 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23934
pull_request: https://github.com/python/cpython/pull/25192

___
Python tracker 

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



[issue43735] PEP 597: os.popen() and pipes uses locale encoding

2021-04-05 Thread Inada Naoki


Change by Inada Naoki :


--
title: os.popen() and pipes uses locale encoding -> PEP 597: os.popen() and 
pipes uses locale encoding

___
Python tracker 

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



[issue43735] os.popen() and pipes uses locale encoding

2021-04-05 Thread Inada Naoki


New submission from Inada Naoki :

os.popen() and pipes module doesn't have `encoding` parameter. They use the 
default (locale) encoding implicitly.

As PEP 597, subprocess module won't emit EncodingWarning for PIPEs in Python 
3.10.
Like that, we should just add `encoding=None` parameter but don't emit  
EncodingWarning.

--
components: Library (Lib)
messages: 390234
nosy: methane
priority: normal
severity: normal
status: open
title: os.popen() and pipes uses locale encoding
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



[issue43734] PEP 597: pdb uses locale encoding for pdbrc file

2021-04-05 Thread Inada Naoki


New submission from Inada Naoki :

I think we should use UTF-8 for pdbrc files because the default encoding of 
Python source files is UTF-8.

--
components: Library (Lib)
messages: 390233
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: pdb uses locale encoding for pdbrc file
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



[issue43733] PEP 597: netrc uses locale encoding.

2021-04-05 Thread Inada Naoki


New submission from Inada Naoki :

https://github.com/python/cpython/blob/c8e5eb904e12010d2302364e1037c24a30f5e241/Lib/netrc.py#L29

Can we change the encoding="utf-8" and errors="replace"?

IMHO, comments are source of UnicodeDecodeError. So we can open file with 
binary mode and skip comments without decoding it.
But we need to decode non-comment lines lines with some encoding anyway.

--
components: Library (Lib)
messages: 390232
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: netrc uses locale encoding.
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



[issue43732] PEP 597: mailcap uses locale encoding

2021-04-05 Thread Inada Naoki


New submission from Inada Naoki :

mailcap.getcaps() uses locale encoding.
https://github.com/python/cpython/blob/c8e5eb904e12010d2302364e1037c24a30f5e241/Lib/mailcap.py#L33

As my understanding, RFC 1524 uses only ASCII characters.
Can we change the encoding to ASCII or UTF-8?

--
components: Library (Lib)
messages: 390231
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: mailcap uses locale encoding
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



[issue22538] turtledemo two_canvases reversion

2021-04-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

What about only changing the error message to make it a little bit 
informational? Something like :-

ModuleNotFoundError: _curses library not found. Install a supported _curses 
library to use the curses module.

--

___
Python tracker 

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



[issue38263] [Windows] multiprocessing: DupHandle.detach() race condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE)

2021-04-05 Thread Jesvi Jonathan


Jesvi Jonathan  added the comment:

File "c:/Users/jesvi/Documents/GitHub/Jesvi-Bot-Telegram/scripts/main.py", line 
144, in thread_test
p.start()
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py",
 line 121, in start
self._popen = self._Popen(self)
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py",
 line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py",
 line 327, in _Popen
return Popen(process_obj)
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\popen_spawn_win32.py",
 line 93, in __init__
reduction.dump(process_obj, to_child)
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py",
 line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_thread.lock' object
Traceback (most recent call last):
  File "", line 1, in 
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py",
 line 107, in spawn_main
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py",
 line 107, in spawn_main
new_handle = reduction.duplicate(pipe_handle,
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py",
 line 79, in duplicate
new_handle = reduction.duplicate(pipe_handle,
  File 
"C:\Users\jesvi\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py",
 line 79, in duplicate
return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid
return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid

--
nosy: +jesvi22j
type: behavior -> compile error
versions:  -Python 3.10, Python 3.9

___
Python tracker 

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



[issue22538] turtledemo two_canvases reversion

2021-04-05 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

FYI, the running the two_canvases example from turtledemo works fine with 
Python 3.10 on macOS.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

The curses module is not supported on all platforms is very clear. But 
beginners may seem to think that their python was not installed properly and 
then they would go around looking for answer. To make it clear I was thinking 
of how about changing just the message and if required then the type (maybe 
CursesNotFoundError exception class derived from ModuleNotFoundError class) so 
that the error message became a little bit informational. The message could be 
like "_curses library not installed. Install a supported curses library to use 
the curses module" or something like that? 

The exception right now looks like this :-

ModuleNotFoundError: No module named '_curses'

What about something like this :-

CursesNotFoundError: "_curses library not installed. Install a supported curses 
library to use the curses module."

N.B.: The curses library still can be used on Windows by using the UniCurses 
library or Christoph Gohlke's unofficial curses or some other third party 
library.

--

___
Python tracker 

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



[issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result"

2021-04-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ezio.melotti, rhettinger

___
Python tracker 

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



[issue43731] PEP 597: logging.basicConfig() uses locale encoding.

2021-04-05 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue43729] Tutorial Documentation for 3.1.1. Numbers missing "result"

2021-04-05 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
keywords: +patch
nosy: +erlendaasland
nosy_count: 2.0 -> 3.0
pull_requests: +23933
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25191

___
Python tracker 

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



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

ModuleNotFoundError is the correct exception. Its purpose is to be raised for 
missed modules.

I do not know about macOS, but the curses module is not supported on Windows, 
so it is expected to get ModuleNotFoundError.

Some distributions can provide some stdlib modules (like tkinter, or distutils, 
or tests) as separate packages.

--
nosy: +brett.cannon, eric.snow, ncoghlan, ned.deily, ronaldoussoren, 
serhiy.storchaka

___
Python tracker 

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



[issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question?

2021-04-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue43730] Tutorial Documentation for 4.7.3.2. Positional-Only Parameters, no "/" question?

2021-04-05 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Quoting 
https://docs.python.org/3.10/tutorial/controlflow.html#positional-only-parameters:
"Positional-only parameters are placed before a / (forward-slash). The / is 
used to logically separate the positional-only parameters from the rest of the 
parameters. If there is no / in the function definition, there are no 
positional-only parameters."

Note the preposition in the first sentence: Positional-only parameters are 
placed _before_ a forward slash.

See also the examples: 
https://docs.python.org/3.10/tutorial/controlflow.html#function-examples


AFAICS, the docs are clear and understandable.

Suggesting closing this as "not a bug".

--
nosy: +erlendaasland, zach.ware

___
Python tracker 

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