[issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow

2020-08-11 Thread wyz23x2


wyz23x2  added the comment:

+1. I observe it too.

--
nosy: +wyz23x2

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Should not such changes be widely discussed on the Python-Dev mailing list 
before merging?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Good catch! Do you mind to provide a PR for this William?

--
keywords: +easy (C)
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue41525] Python '--help' has corrupted text.

2020-08-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 2.0 -> 3.0
pull_requests: +20964
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21836

___
Python tracker 

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



[issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow

2020-08-11 Thread Zachary Ware


Change by Zachary Ware :


--
assignee:  -> steve.dower
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue10486] http.server doesn't set all CGI environment variables

2020-08-11 Thread Maarten


Maarten  added the comment:

The CGI examples of urwid (see 
http://urwid.org/manual/displaymodules.html#cgi-web-display-module-web-display) 
don't work on http.server because of missing meta variables.

Using cgitb, I found out that the webdriver expects the environment variable 
`HTTP_X_URWID_METHOD` to be set. The javascript sets the "X-Urwid-Method" 
header (using XmlHttpRequest), but these are not visible by the CGI python 
script.

So some scripts extra Meta-Variables neet to be set.

I think section 4.1.18 applied because it is a http header that is being set. 
The sections says that these meta-variables are optional though.

I argue that having access to extra headers is useful.

--
nosy: +maarten

___
Python tracker 

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



[issue10399] AST Optimization: inlining of function calls

2020-08-11 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


--
nosy: +Yonatan Goldschmidt

___
Python tracker 

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



[issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow

2020-08-11 Thread Peter Lovett


New submission from Peter Lovett :

"Setup was successful" dialog box text overflows the box, and last line can't 
be read.

--
components: Installation
files: Python 3.9.0rc1 setup successful overflow dialog box.PNG
messages: 375206
nosy: PeterL777
priority: normal
severity: normal
status: open
title: Python 3.9.0rc1 "setup successful" dialog box overflow
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49383/Python 3.9.0rc1 setup successful 
overflow dialog box.PNG

___
Python tracker 

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



[issue41525] Python '--help' has corrupted text.

2020-08-11 Thread Peter Lovett


Peter Lovett  added the comment:

Also appearing in 3.9.0rc1 AMD64
I think it's transliterated Unicode, rather than an actual corruption. I'm on 
Win10, so it might be a Windows command shell issue (although it is showing bad 
in cmd, PS7 and PS5).
Help messages should be plain ASCII to avoid this issue.

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



[issue41525] Python '--help' has corrupted text.

2020-08-11 Thread William Pickard

New submission from William Pickard :

Running Python's '--help' argument yields some corrupted text:
"-X dev: enable CPythonâ?Ts â?odevelopment modeâ??, introducing additional 
runtime"

--
components: Interpreter Core
messages: 375204
nosy: WildCard65
priority: normal
severity: normal
status: open
title: Python '--help' has corrupted text.
type: behavior
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



[issue41475] Make __future__.annotations default 3.10 in What's New 3.7

2020-08-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20963
pull_request: https://github.com/python/cpython/pull/21835

___
Python tracker 

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-11 Thread William Meehan


New submission from William Meehan :

The existing implementation of PyOS_mystricmp increments both pointers as long 
as the first string hasn't reached the end yet. If the second string ends 
first, then we increment past the null byte. If there is a difference in the 
middle of the two strings, then the result actually compares the following pair 
of letters.

e.g.
PyOS_mystricmp("a", "\0") => 0 (should be positive)
PyOS_mystricmp("foo", "fro") => 0 (should be negative)

Similarly, PyOS_mystrnicmp increments the pointers in a condition before 
breaking out of the loop. It's possible to increment the first pointer without 
incrementing the second, and the result is the character past the null byte.

e.g.
PyOS_mystrnicmp("\0a", "\0b", 2) => 97 (should be negative)

--
components: C API
messages: 375203
nosy: wmeehan
priority: normal
severity: normal
status: open
title: PyOS_mystricmp advances pointers too far
type: behavior
versions: Python 3.10, Python 3.5, 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



[issue40994] Very confusing documenation for abc.Collections

2020-08-11 Thread Sydney Pemberton


Sydney Pemberton  added the comment:

If you look at the Jupyter notebook it should be fairly clear but to
summarize here is the issue:

class collections.abc.Container
class collections.abc.Hashable
class collections.abc.Sized
class collections.abc.Callable
ABCs for classes that provide respectively the
methods __contains__(), __hash__(), __len__(), and __call__().

This should become

class collections.abc.Container
ABC for classes that provide the method __contains__().
class collections.abc.Hashable
 ABC for classes that provide the method __hash__().
class collections.abc.Sized
ABC for classes that provide the method __len()__.
class collections.abc.Callable
ABC for classes that provide the method __call__().

--

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread Edward K Ream


Edward K Ream  added the comment:

You're welcome. It was a pleasure working with you all on this issue.

I enjoyed learning the PR workflow, and I enjoyed the discussion of the merits.

One last comment. Like everything in life, links and their implied endorsements 
are provisional. If a link ever becomes problematic, I would expect the python 
devs to remove it.

--

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks!

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

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset d1d6a1c6abf76b27c247ead8a8872011db77cf58 by Guido van Rossum in 
branch '3.9':
[3.9] bpo-41504: Add links to asttokens, leoAst, LibCST and parso to ast docs 
(GH-21773) (GH-21830)
https://github.com/python/cpython/commit/d1d6a1c6abf76b27c247ead8a8872011db77cf58


--

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> They are both descriptors, but cached_property is not a data descriptor.

I think this is one of the key reasons this should not return "True" for 
isinstance(A.b, property). Also, cached_property does not allow you to 
implement a setter or a deleter.

The docs say "Similar to property()" but not "the same as property()"

--
nosy: +pablogsal

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread William Pickard


William Pickard  added the comment:

In the lru_cache example, I think property is using the result of 
'lru_cache(c)', which in turns returns a property instance, not a subtype 
instance.

--
nosy: +WildCard65

___
Python tracker 

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



[issue41522] IDLE: configdialog tab icons

2020-08-11 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I think we can agree that making the dialogs and in particular the settings 
dialog more visually inviting is a good thing. However, two problems are 
priority and differing aesthetic opinions.  Some thoughts off the top of my 
head...

I consider revising tab contents a higher priority.  One thing is redoing the 
Highlights (Colors) and Keys pages using Mark's ideas from 5 years ago. At the 
time, Configdialog was a giant class with 70 methods and no tests.  3 years 
ago, Cheryl and I (with a bit of help from Louie Lu), split the class into a 
dialog class and classes for each tab, and added unit tests with, now, 94% 
coverage.

Also, the dialog is now too tall to fit in the space Apple allows to apps on my 
small Macbook Air notebook.  (See General comment below.)

As for the tabs themselves.  If left, 'Tabs' should be 'Indent', but the 
setting should be moved to General, which needs to be split into two pages (and 
classes) and tabs as there are other things to add.

I think 'Highlights' should be 'Colors', as 'syntax coloring' only loosely fits 
'important parts' or 'lightened parts'.  Comments are colored separately so 
that they can be ignored.  Ditto, sometimes, for strings.

As for the icons, I don't think that the examples add much info.  Hence they 
seem like noise to me.  I think that the plug, possibly on an extension cord, 
fits best *because* it is so concordant with the text label.

If we do use images, I might consider emoji that get rendered on most systems.  
Tk *will* display b/w astral emoji just fine in a read-only context.  Example: 
"\U0001f40d = "  This might be appropriate icon for one of the splits of 
General.  (Or we can create images that combine images and text.)

We could also consider creative typography.  'Fonts' in bold italic and varying 
size letters might better suggest 'font choice'.  Ditto for 'Colors' in 
multiple colors.  Boxing the 'K' of "Keys" in a key image or maybe even 
[K][E][Y]s might be interesting.

Now that we are using ttk widgets for dialogs, I have thought about somehow 
using Python yellow and blue in an IDLE dialog style.  But something else is 
always a higher priority.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread Bernát Gábor

Bernát Gábor  added the comment:

I think they're implemented differently and have slightly different semantics, 
but they're equal from a user point of view most of the time 樂

--
nosy: +Bernát Gábor

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy:  -Jeffrey.Kintscher

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo


Ramesh Sahoo  added the comment:

Thank Steven for correcting and guiding me.

--

___
Python tracker 

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



[issue37296] pdb next vs __next__

2020-08-11 Thread Irit Katriel


Irit Katriel  added the comment:

Do you mean the python version? 

(Pdb) import sys
(Pdb) sys.version
'3.10.0a0 '

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are not much things common to property and cached_property. 
cached_property does not have attributes fget, fset, fdel. They are both 
descriptors, but cached_property is not a data descriptor.

--

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread Bernat Gabor


Bernat Gabor  added the comment:

I understand under the hood they're differenet, however I think cached_property 
wanted to be a shorter/better version of  @property@lru_cache which does 
passes this check. Tools expecting properties to pass that check now need to 
extend their check... and similarly now is no longer enough to use isinstance 
property to check if something is a property.

--

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No, cached_property is a completely different class.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33786] @asynccontextmanager doesn't work well with async generators

2020-08-11 Thread Joshua Oreman


Joshua Oreman  added the comment:

This doesn't appear to have been backported to 3.7, even though it's in 3.6.6 
and 3.8.0a0.

--
nosy: +Joshua Oreman, lukasz.langa

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-11 Thread Bernat Gabor


New submission from Bernat Gabor :

from functools import cached_property, lru_cache

class A:
@property
def a(self): return ''

@cached_property
def b(self): return ''

@property
@lru_cache
def c(self):
return ""


print(isinstance(A.a, property))
print(isinstance(A.b, property))
print(isinstance(A.c, property))

True
False
True

I feel like cached property should be of type property, not?

--
messages: 375188
nosy: Bernat Gabor
priority: normal
severity: normal
status: open
title: functools.cached_property does not satisfy the property check
versions: Python 3.10, 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



[issue41475] Make __future__.annotations default 3.10 in What's New 3.7

2020-08-11 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5de00f63d47b5aa1714ad2d88772ad55b10feea0 by Miss Islington (bot) 
in branch '3.9':
bpo-41475: Fix note in "What's new in 3.7" (GH-21733) (#21832)
https://github.com/python/cpython/commit/5de00f63d47b5aa1714ad2d88772ad55b10feea0


--

___
Python tracker 

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



[issue41522] IDLE: configdialog tab icons

2020-08-11 Thread E. Paine


New submission from E. Paine :

Currently, the tabs on the configdialog's Notebook only have a text 
description. I propose we add icons to the tabs to make them a little more 
colourful, new-user-friendly, etc.

I have drafted a version which uses icons found in the Public Domain (I can 
provide links if this would be helpful - I believe the changes I have made 
would be covered under the CLA) resized to a height of 25px (see attached). The 
shown icons are meant more as a demonstration of this feature than a "I want 
these particular icons in the patch" but feel these make the dialog seem more 
inviting.

I have nosied Mark Roseman as this idea came from the sort of changes described 
on the IDLE modernisation case study (https://tkdocs.com/tutorial/idle.html)

--
assignee: terry.reedy
components: IDLE
files: idle-tab-icons.png
messages: 375186
nosy: epaine, markroseman, taleinat, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: configdialog tab icons
type: enhancement
versions: Python 3.10, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49382/idle-tab-icons.png

___
Python tracker 

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



[issue41475] Make __future__.annotations default 3.10 in What's New 3.7

2020-08-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20962
pull_request: https://github.com/python/cpython/pull/21833

___
Python tracker 

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



[issue41475] Make __future__.annotations default 3.10 in What's New 3.7

2020-08-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41475] Make __future__.annotations default 3.10 in What's New 3.7

2020-08-11 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 76643c10ede2813ca921464fe839e81caee21a84 by Ram Rachum in branch 
'master':
bpo-41475: Fix note in "What's new in 3.7" (#21733)
https://github.com/python/cpython/commit/76643c10ede2813ca921464fe839e81caee21a84


--

___
Python tracker 

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



[issue41191] PyType_FromModuleAndSpec is not mentioned in 3.9 What's new

2020-08-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault

2020-08-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

Closing; please re-open if you have more info.

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



[issue41129] setup.py test for macOS SDK files may incorrectly classify files in other file systems

2020-08-11 Thread Andrew


Andrew  added the comment:

Hi Ronald. The basic idea is that >= macOS 10.15.1 Apple has made most of the 
filesystem read only on a folder by folder basis. They separate user-writable 
onto a separate filesystem, treat it like a disk, and they mount it under 
/System/Volumes/ as "Data". Likewise, I think the idea is that other volumes 
get mounted under /System/Volumes, however, since "/System/Volumes/Data" is now 
"firmlinked" to root, I imagine you can find mounts to the writable filesystem 
under "/System/Volumes/Data/Volumes" which firmlinks to /Volumes.

About the read-only system volume in macOS Catalina:
https://support.apple.com/en-us/HT210650

More info on the container / firmlink scheme
https://bombich.com/kb/ccc5/working-apfs-volume-groups

--

___
Python tracker 

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



[issue41520] codeop: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise.

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not 
raise. -> codeop: 3.8.5 regression, warnings.simplefilter('error', 
SyntaxWarning) does not raise.

___
Python tracker 

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



[issue41520] 3.8.5 regression, warnings.simplefilter('error', SyntaxWarning) does not raise.

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-11 Thread STINNER Victor

STINNER Victor  added the comment:

test.test_asyncio.test_events.SelectEventLoopTests.test_create_server_ssl_verified
 fails randomly and emits an "unraisable exception".

Logs:

+ /home/vstinner/python/master/python -m test --matchfile /tmp/tmpz2f1v5aq 
test_asyncio --fail-env-changed -v
== CPython 3.10.0a0 (heads/master:0ee0b2938c, Aug 11 2020, 15:50:20) [GCC 8.3.1 
20191121 (Red Hat 8.3.1-5)]
== Linux-4.18.0-193.14.3.el8_2.aarch64-aarch64-with-glibc2.28 little-endian
== cwd: /home/vstinner/python/master/build/test_python_585912æ
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 7.50 Run tests sequentially
0:00:00 load avg: 7.50 [1/1] test_asyncio
test_create_server_ssl_verified 
(test.test_asyncio.test_events.SelectEventLoopTests) ... 
/home/vstinner/python/master/Lib/test/support/__init__.py:597: ResourceWarning: 
unclosed 
  gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Task was destroyed but it is pending!
task:  
wait_for=()]>>
   
/home/vstinner/python/master/Lib/asyncio/sslproto.py:320: ResourceWarning: 
unclosed transport 
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Warning -- Unraisable exception
Exception ignored in: 
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 321, in 
__del__
self.close()
  File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 316, in 
close
self._ssl_protocol._start_shutdown()
  File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 590, in 
_start_shutdown
self._abort()
  File "/home/vstinner/python/master/Lib/asyncio/sslproto.py", line 731, in 
_abort
self._transport.abort()
  File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 678, 
in abort
self._force_close(None)
  File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 729, 
in _force_close
self._loop.call_soon(self._call_connection_lost, exc)
  File "/home/vstinner/python/master/Lib/asyncio/base_events.py", line 746, in 
call_soon
self._check_closed()
  File "/home/vstinner/python/master/Lib/asyncio/base_events.py", line 510, in 
_check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
/home/vstinner/python/master/Lib/asyncio/selector_events.py:702: 
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
ERROR
/home/vstinner/python/master/Lib/unittest/case.py:620: ResourceWarning: 
unclosed

 
  outcome.errors.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback

==
ERROR: test_create_server_ssl_verified 
(test.test_asyncio.test_events.SelectEventLoopTests)
--
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/test_asyncio/test_events.py", 
line 1110, in test_create_server_ssl_verified
proto.transport.close()
AttributeError: 'NoneType' object has no attribute 'close'

--

Ran 1 test in 0.218s

FAILED (errors=1)
/home/vstinner/python/master/Lib/asyncio/sslproto.py:320: ResourceWarning: 
unclosed transport 
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Fatal error on SSL transport
protocol: 
transport: <_SelectorSocketTransport closing fd=6>
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 
236, in _runtest_inner2
test_runner()
  File "/home/vstinner/python/master/Lib/test/libregrtest/runtest.py", line 
211, in _test_module
support.run_unittest(tests)
  File "/home/vstinner/python/master/Lib/test/support/__init__.py", line 1082, 
in run_unittest
_run_suite(suite)
  File "/home/vstinner/python/master/Lib/test/support/__init__.py", line 974, 
in _run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/test_asyncio/test_events.py", 
line 1110, in test_create_server_ssl_verified
proto.transport.close()
AttributeError: 'NoneType' object has no attribute 'close'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/asyncio/selector_events.py", line 916, 
in write
n = self._sock.send(data)
ConnectionResetError: 

[issue38912] test_asyncio altered the execution environment

2020-08-11 Thread STINNER Victor


STINNER Victor  added the comment:

On the AArch64 RHEL8 buildbot, I managed to reproduce a ENV_CHANGED issue with 
only these two test_asyncio tests:

test.test_asyncio.test_events.SelectEventLoopTests.test_create_server_ssl_verify_failed
test.test_asyncio.test_events.SelectEventLoopTests.test_create_server_ssl_verified

I'm running a bisect for like 2 hours... The bug is really hard to trigger :-(

--

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a0b57b3317d6653255415af5228c94485aa57a0d by Victor Stinner in 
branch '3.9':
bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718) 
(GH-21827)
https://github.com/python/cpython/commit/a0b57b3317d6653255415af5228c94485aa57a0d


--

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

The master commit was e3c971ccfa58afcb2656b71b95e10b9703f2ad32 (somehow because 
the commit message didn't contain the bpo-41504 tag the automation didn't work 
flawlessly).

--

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 7b3ceaa71051d811bfee0b62ef9cb0fd2121c7ee by Miss Islington (bot) 
in branch '3.8':
[3.8] bpo-41504: Add links to asttokens, leoAst, LibCST and parso to ast docs 
(GH-21773) (GH-21829)
https://github.com/python/cpython/commit/7b3ceaa71051d811bfee0b62ef9cb0fd2121c7ee


--

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum
nosy_count: 4.0 -> 5.0
pull_requests: +20959
pull_request: https://github.com/python/cpython/pull/21830

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20958
pull_request: https://github.com/python/cpython/pull/21829

___
Python tracker 

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



[issue41504] Add links to asttokens, leoAst, LibCST and Parso to ast.rst

2020-08-11 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-08-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Issue 41314 changed the __future__ annotations default version to 3.10.  
3.10.0a1 is scheduled for next Oct 5, less than 2 months from now.  It would be 
good if PR 20434 were merged before that.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41503] Race between setTarget and flush in logging.handlers.MemoryHandler

2020-08-11 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue41475] Make __future__.annotations default 3.10 in What's New 3.7

2020-08-11 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: __future__.annotations set to become default in Python 4.0? -> Make 
__future__.annotations default 3.10 in What's New 3.7
versions:  -Python 3.7

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor

STINNER Victor  added the comment:

Another rationale from "Inclusive Chromium code":

Terms such as “blacklist” and “whitelist” reinforce the notion that black==bad 
and white==good. That Word Black, by Langston Hughes illustrates this problem 
in a lighthearted, if somewhat pointed way. These terms can usually be replaced 
by “blocklist” and “allowlist” without changing their meanings, but particular 
instances may need other replacements.

https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md

--

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


STINNER Victor  added the comment:

"While the etymology of the words isn't steeped in racial undertones or history 
like other problematic tech word choices, there is no harm in changing them to 
synonyms that as just as understandable and avoid the question entirely"

https://web.archive.org/web/20180921225759/https://github.com/facebook/react/issues/13604#issuecomment-419884422

--

___
Python tracker 

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



[issue38912] test_asyncio altered the execution environment

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20956
pull_request: https://github.com/python/cpython/pull/21827

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20955
pull_request: https://github.com/python/cpython/pull/21826

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0ee0b2938cb606151d8d287472c838044bad4a0e by Victor Stinner in 
branch 'master':
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823)
https://github.com/python/cpython/commit/0ee0b2938cb606151d8d287472c838044bad4a0e


--

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread miss-islington


miss-islington  added the comment:


New changeset fabd7bb8e0450f16ed5c5c0ad575aa413d65712d by Victor Stinner in 
branch 'master':
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)
https://github.com/python/cpython/commit/fabd7bb8e0450f16ed5c5c0ad575aa413d65712d


--
nosy: +miss-islington

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20954
pull_request: https://github.com/python/cpython/pull/21825

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20953
pull_request: https://github.com/python/cpython/pull/21824

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread Christian Heimes


Christian Heimes  added the comment:

+1

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40994] Very confusing documenation for abc.Collections

2020-08-11 Thread Irit Katriel


Irit Katriel  added the comment:

Can you be more specific about what you found confusing? What is the 
documentation bug? What do you mean by "this point in the documentation"?

Even better, can you suggest how to rewrite the documentation to make it 
clearer?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20952
pull_request: https://github.com/python/cpython/pull/21823

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue41521] Replace whitelist/blacklist with allowlist/denylist

2020-08-11 Thread STINNER Victor


New submission from STINNER Victor :

I propose to replace whitelist/blacklist with allowlist/denylist. The terms 
whitelist and blacklist can be associated to color skins which isn't the 
intent. To avoid confusion, I propose to use neutral terms: allowlist and 
denylist. Moreover, as a french person (english is not my first language, but 
french), "allow" and "deny" are even more explicit to me than "white "and 
"black".

The intent is to make the Python community more welcoming and more diverse by 
avoiding to make some people uncomfortable.

Many other projects already replaced whitelist/blacklist with 
allowlist/denylist:

* GitLab: https://gitlab.com/gitlab-org/gitlab/-/issues/7554
* React: 
https://github.com/facebook/react/commit/8a8d973d3cc5623676a84f87af66ef9259c3937c
* Mediawiki: https://phabricator.wikimedia.org/T254646
* GitHub: 
https://thenextweb.com/dd/2020/06/15/github-plans-to-replace-racially-insensitive-terms-like-master-and-whitelist/
* Google Chrome: 
https://9to5google.com/2020/06/12/google-android-chrome-blacklist-blocklist-more-inclusive/
* etc.

See also:

* Carolyn Stransky's "Humanizing Your Documentation" presentation:
https://speakerdeck.com/carolstran/humanizing-your-documentation-full-talk
* bpo-34605: "Avoid master/slave terminology"

Attached PRs replace whitelist/blacklist with allowlist/denylist.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 375170
nosy: docs@python, vstinner
priority: normal
severity: normal
status: open
title: Replace whitelist/blacklist with allowlist/denylist
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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1d541c25c8019f7a0b80b3e1b437abe171e40b65 by Mohamed Koubaa in 
branch 'master':
bpo-1635741: Port multiprocessing ext to multiphase init (GH-21378)
https://github.com/python/cpython/commit/1d541c25c8019f7a0b80b3e1b437abe171e40b65


--

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-08-11 Thread Peixing Xin


Change by Peixing Xin :


--
pull_requests: +20950
pull_request: https://github.com/python/cpython/pull/21821

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Tue, Aug 11, 2020 at 07:16:20AM +, Ramesh Sahoo wrote:

> for i in stack:
> print("inside if Popped =",stack.pop(stack.index(i)))

You are mutating the list while you iterate over it. This is prone to 
cause trouble. Here's is a much smaller and simpler demonstration:

items = [1, 2, 3, 4, 5]
for index, value in enumerate(items):
print(f"index: {index}, value: {value}, items: {items}")
if value == 2:
x = items.pop(index)
print(f"after popping 2: {items}")

which has output:

index: 0, value: 1, items: [1, 2, 3, 4, 5]
index: 1, value: 2, items: [1, 2, 3, 4, 5]
after popping 2: [1, 3, 4, 5]
index: 2, value: 4, items: [1, 3, 4, 5]
index: 3, value: 5, items: [1, 3, 4, 5]

If you trace the code execution in your head, you will see that this is 
correct behaviour: Python is walking the list from position to position, 
but you removed one of the values so everything shifts and you end up 
skipping a value, because it moves before the loop can reach it.

The lesson here is:

Don't mutate a list that you are iterating over if you can avoid it. It 
you cannot avoid it, you can avoid problems by iterating in reverse, and 
only mutating the part of the list you have already processed.

But better to avoid mutation altogether.

So not a bug. Python is doing exactly what you told it to do.

--

___
Python tracker 

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



[issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g)

2020-08-11 Thread wyz23x2


Change by wyz23x2 :


--
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue41169] socket.inet_pton raised when pass an IPv6 address like "[::]" to it

2020-08-11 Thread wyz23x2


Change by wyz23x2 :


--
versions: +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



[issue22893] IDLE: __future__ does not work in startup code.

2020-08-11 Thread wyz23x2


Change by wyz23x2 :


--
title: Idle: __future__ does not work in startup code. -> IDLE: __future__ does 
not work in startup code.

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2020-08-11 Thread wyz23x2


wyz23x2  added the comment:

Since '/' was introduced in Python 3.8, support for positional parameters 
should be supported too.

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



[issue41513] Scale by power of two in math.hypot()

2020-08-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

Fine by me in principle; I haven't had a chance to look at the code yet.

While we're doing this, any chance we could special-case the two-argument hypot 
to use the libm hypot directly? On many platforms the libm hypot will be 
correctly rounded, or close to it. There was a noticeable accuracy regression 
for two-argument hypot when hypot gained the ability to support multiple 
arguments.

--

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo


Ramesh Sahoo  added the comment:

Additional note: 

The following program completes all 5 iterations.  

#!/usr/bin/python3
stack = [s for s in range(5)]
c = 0
for i in stack:
  c += 1
  print(f"{'='*10} loop {c} {'='*10}")
  if i == 0 or i == 1 or i == 2:
print(f"{i}\n")
  else:
print(f"{i}\n")


$ python3 test1.py 
== loop 1 ==
0

== loop 2 ==
1

== loop 3 ==
2

== loop 4 ==
3

== loop 5 ==
4

--

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo


Ramesh Sahoo  added the comment:

Hi all,

Thanks for your valuable response. I would like to inform you that I found this 
issue while playing with the following code. This is reproducible with Python 
3.8. 

Please find the following details and let me know if I am doing something 
wrong. 


[Using for loop popping elements]

import sys
stack,braces = [],{'(':')','{':'}','[':']'}
stack = [s for s in "(([])"]
c = 0
print(f"Python version: {sys.version}")
print(f"Before for loop:\nbraces.keys = {braces.keys()}\nbraces.items = 
{braces.items()}\nstack = {stack}\n\n")

for i in stack:
c += 1
print(f"{'='*10} loop {c} {'='*10}")
print("just after for loop stack =",stack)
print(f"Just after for loop i =",i)
print(f"Just after for loop: Is i'{i}' found in braces.keys:{i in 
braces.keys()}")

if i in braces.keys():
print(f"inside if i = {i}")
print("inside if stack =",stack)
print("inside if Popped =",stack.pop(stack.index(i)))
print(f"inside if after popped stack = {stack}\n")
continue

else:
print(f"in else: Is i'{i}' found in braces.keys:{i in braces.keys()}")
print(f"in else stack = {stack}\n")


[Program Output]

$ python3 test1.py 

Python version: 3.8.0 (default, Nov 14 2019, 22:29:45) 
[GCC 5.4.0 20160609]

Before for loop:
braces.keys = dict_keys(['(', '{', '['])
braces.items = dict_items([('(', ')'), ('{', '}'), ('[', ']')])
stack = ['(', '(', '[', ']', ')']

== loop 1 ==
just after for loop stack = ['(', '(', '[', ']', ')']
Just after for loop i = (
Just after for loop: Is i'(' found in braces.keys:True
inside if i = (
inside if stack = ['(', '(', '[', ']', ')']
inside if Popped = (
inside if after popped stack = ['(', '[', ']', ')']

== loop 2 ==
just after for loop stack = ['(', '[', ']', ')']
Just after for loop i = [
Just after for loop: Is i'[' found in braces.keys:True
inside if i = [
inside if stack = ['(', '[', ']', ')']
inside if Popped = [
inside if after popped stack = ['(', ']', ')']

== loop 3 ==
just after for loop stack = ['(', ']', ')']
Just after for loop i = )
Just after for loop: Is i')' found in braces.keys:False
in else: Is i')' found in braces.keys:False
in else stack = ['(', ']', ')']


[Summary]

stack = ['(', '(', '[', ']', ')']
=> [loop 1] is correct where the right element "(" has been popped.

['(', '[', ']', ')']
=> [loop 2] "(" element should have been popped but "[" chosen to be popped. 
This seems to be incorrect.

=> There must be 5 iterations(3 in if block and 2 in else block) but loop 
completed with 3 iterations(2 in if and one in else).  


I am not sure if I am doing something wrong or it is a buggy behavior. 



[Popping elements manually gives correct behavior]

import sys
print(f"Python Version: {sys.version}")

stack,braces = [],{'(':')','{':'}','[':']'}
stack = [s for s in "(([])"]

print(f"Original:\nbraces.keys = {braces.keys()}\nbraces.items = 
{braces.items()}\nstack = {stack}\n\n")

# Popping '('
print(f"Popped {stack.pop(stack.index('('))}")
print(f"stack after popping '(' = {stack}")

# Popping '('
print(f"Popped {stack.pop(stack.index('('))}")
print(f"stack after popping '(' = {stack}")

# Popping '['
print(f"Popped {stack.pop(stack.index('['))}")
print(f"stack after popping '[' = {stack}")


[Program Output]
Python Version: 3.8.0 (default, Nov 14 2019, 22:29:45) 
[GCC 5.4.0 20160609]
Original:
braces.keys = dict_keys(['(', '{', '['])
braces.items = dict_items([('(', ')'), ('{', '}'), ('[', ']')])
stack = ['(', '(', '[', ']', ')']
Popped (
stack after popping '(' = ['(', '[', ']', ')']
Popped (
stack after popping '(' = ['[', ']', ')']
Popped [
stack after popping '[' = [']', ')']

--
status: closed -> open
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo


Change by Ramesh Sahoo :


--
resolution: works for me -> 

___
Python tracker 

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