[issue42492] [unittest] Missing docs for context manager attributes

2020-11-28 Thread Jason Yundt


New submission from Jason Yundt :

The documentation talks about how assertRaises, assertRaisesRegex, assertWarns, 
and assertWarnsRegex can be used as context managers. It also talks about the 
attributes of those context managers. Some attributes aren't documented. For 
example, the warning attribute of the assertRaises or assertRaisesRegex context 
manager isn't documented.

--
assignee: docs@python
components: Documentation, Tests
messages: 382012
nosy: docs@python, jayman
priority: normal
severity: normal
status: open
title: [unittest] Missing docs for context manager attributes
type: enhancement
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



[issue42491] Tkinter wait_visibility hanging when used in thread

2020-11-28 Thread E. Paine


E. Paine  added the comment:

You make very good points but sadly it is not that simple. The issue is 
described in detail in the comment found in Modules/_tkinter.c:178. A good 
summary is probably the comment for Tkapp_Call (Modules/_tkinter.c:1522).

--

___
Python tracker 

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



[issue42466] asyncio loop.getaddrinfo raises RuntimeError

2020-11-28 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> wont fix
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



[issue42347] loop.call_exception_handler documentation is lacking

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Partially addressed by https://github.com/python/cpython/pull/21735

--

___
Python tracker 

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



[issue42392] remove the deprecated 'loop' parameter asyncio API

2020-11-28 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
title: remove the 'loop' parameter from __init__ in all classes in 
asyncio.locks -> remove the deprecated 'loop' parameter asyncio API

___
Python tracker 

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



[issue38599] Deprecate creation of asyncio object when the loop is not running

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Fixed by #42392

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
superseder:  -> remove the deprecated 'loop' parameter asyncio API
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



[issue41241] Unnecessary Type casting in 'if condition'

2020-11-28 Thread miss-islington


miss-islington  added the comment:


New changeset 5b0194ed31376382da63ad5b10271a4acc4a80e8 by Wansoo Kim in branch 
'master':
bpo-41241: Unnecessary Type casting in 'if condition' (GH-21396)
https://github.com/python/cpython/commit/5b0194ed31376382da63ad5b10271a4acc4a80e8


--
nosy: +miss-islington

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +22420
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23538

___
Python tracker 

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



[issue11107] Cache constant "slice" instances

2020-11-28 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Batuhan Taskaya opened a duplicate issue #42454.  Since it includes PR-23496, 
with some review, and at least as much discussion, I am closing this issue, 
contrary to normal policy.

Worthwhile? Batuhan found about 10 constant slices in 3200 PyPI packages, 
and 3-50% speedup.

Rémi asked "Couldn't [slices] hash like a tuple (start, stop, step)?"
Batuhad used the tuple analogy - hashability and hash depends on components.  
See PR for details.

Josh: the PR defines TYPE_SLICE as ':'.

--
nosy: +terry.reedy
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Move slice creation to the compiler for constants

___
Python tracker 

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



[issue42392] remove the 'loop' parameter from __init__ in all classes in asyncio.locks

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset e4fe303b8cca525e97d44e80c7e53bdab9dd9187 by Yurii Karabas in 
branch 'master':
bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess 
(GH-23521)
https://github.com/python/cpython/commit/e4fe303b8cca525e97d44e80c7e53bdab9dd9187


--

___
Python tracker 

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



[issue42488] Mathematical error

2020-11-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The ^ operator is bitwise-xor (exclusive-or), not exponentiation.

Stop wasting our time by posting false bug reports. This is now your fifth 
incorrect bug report in a row. Once or twice can be forgiven that you didn't 
know better.

Please stop reporting bugs until you have checked with **at least one** of 
Stackoverflow, Reddit's /r/learnpython, one of the Python IRC channels, or the 
tutor mailing list, and confirmed that it is really a bug and not your own 
error.

--
nosy: +steven.daprano
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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-28 Thread Christopher Snowhill


Christopher Snowhill  added the comment:

And I can't report it to Homebrew, either, since they refuse to acknowledge bug 
reports against beta versions of the OS. I guess I can bug them when 11.1 
becomes a stable release, by which time I'll probably be on 11.2.

I'll file Feedback with Apple, too, as they're more likely to actually know 
what's going on.

--

___
Python tracker 

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



[issue42491] TKinter hanging intermittently - sometimes throwing exception

2020-11-28 Thread Steve Carll


New submission from Steve Carll :

I'm having a problem with an application that uses threads and TKinter. 
Sometimes everything works fine but there are 2 errors that I can't seem to 
figure out why they are happening. The first error is the GUI completely 
locking up with no text cursor in the textbox. The second problem is a crash 
after the input has been entered.
I have created a bare minimum test application that demonstrates the problem. 
The problems are easily reproducible.
I've attached a simpleteTKinter test application that I created using Page. 
I've also attached 3 screen captures. 
1. threadTest-OK.jpg is proper behavior
2. threadTest-Hung.jpg shows the unresponsive application
3. threadTest-Exception.jpg shows the exception thrown when input window is 
closed
It looks like a race condition to me. I've tried putting in delays and using 
after but I can't seem to work around it. 
Am I doing something wrong here?

--
components: Tkinter
files: threadTest.zip
messages: 381990
nosy: spcmicro
priority: normal
severity: normal
status: open
title: TKinter hanging intermittently - sometimes throwing exception
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49631/threadTest.zip

___
Python tracker 

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



[issue41562] StreamReaderProtocol inheritance

2020-11-28 Thread Dan Pascu


Dan Pascu  added the comment:

While it may not be affected at a functional level (at least not in a way I can 
see right now), it is confusing when reading that code.

Isn't clarity and avoiding confusion a desired trait for core python code?

What about all these recommendations from the Zen of Python?

Beautiful is better than ugly.
Simple is better than complex.
Flat is better than nested.
Readability counts.
If the implementation is hard to explain, it's a bad idea.

--

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread Chuan Lotus


New submission from Chuan Lotus :

In python 3.9.1 documentation tutorial 5.1,the method list.sort(key=None, 
reverse=False) lacks '*' before 'key=None', which may be confused.

--
components: macOS
messages: 381984
nosy: lotus_chuan, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Wrong method signature in python Documentation
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



[issue42490] Business Logical Error

2020-11-28 Thread Nishant Gautam


Change by Nishant Gautam :


--
type:  -> security

___
Python tracker 

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



[issue42490] Business Logical Error

2020-11-28 Thread Nishant Gautam


New submission from Nishant Gautam :

Python does not understand not condition

--
files: main.py
messages: 381987
nosy: Kshitish
priority: normal
severity: normal
status: open
title: Business Logical Error
versions: Python 3.8
Added file: https://bugs.python.org/file49630/main.py

___
Python tracker 

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



[issue42490] Business Logical Error

2020-11-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Nishant Gautam does not understand not condition.

This is your sixth incorrect bug report in a row. Please stop. This is not a 
help desk to correct your mistakes.

a == 10 and (b != (not(11))) and b == a

--> True and (b != False) and True
--> True and True and True
--> True

--
nosy: +steven.daprano
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



[issue42469] Space in re's {min, max} should raise an error, rather than fail silently

2020-11-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Pending further information, I believe that expecting '{1, 4}' to be 
interpreted as an re quantifier involves two mental errors: a) thinking that 
the domain specific re language allows optional whitespace and b) thinking that 
'{' is a special character only used for quantifier patterns.  I propose 
changes directed at both errors.

In Python code, a space ' ' is always special (indent, required separator, 
optional separator) except in comments and strings.  In the latter, a space is 
ordinary except as seen otherwise by reader, including humans.  Functions that 
read a string as Python code make them special again.  AFAIK, re functions 
always see spaces as ordinary unless the re.VERBOSE compile flag is passed, and 
even then they are only sometimes ignored.

Suggestion 1. Because this is contrary to human habit, put a special disclaimer 
at the end of the 2-sentence paragraph beginning "Some characters, like '|' or 
'(', are special."  Add something like "Space ' ' is always ordinary, like 'c' 
is.  Do not put one where a 'c' could not go."

"The special characters are:" is misleading because the special bracketed 
quantifier patterns that follow are composed of ordinary characters. (See 
below.)

Suggestion 2.  Add 'and patterns' after 'characters'.  Or put the quantifier 
patterns after a separate header.

'[' is special in that it always begins a set pattern.  ']' is always special 
when preceded by '['.  It is an error if the set is not closed with ']'. In 
particular, compile('[') raises.

'{' and }' are different.  They are not special by themselves anymore than 
digits and ',' are, whereas within quantifier patterns, all characters, not 
just '{' and '}', have special interpretations. In particular, compile('{') 
matches instead of raising like '[' does.
>>> re.findall('{', 'a{b')
['{']

Only a complete quantifier pattern is special.  As near as I can tell, 
re.compile act at least as if it tries to match '{\d*(,\d*)?}' (with re.ASCII 
flag to only allow ascii digits?) when it encounters '{'.  If this fails, it 
continues with '{' treated as ordinary.  So '{1, 4}', '{1,c4}', '{ 1,4}', 
'{1,4x}', and '{0x33}' are all compiled as sequences of 6 ordinary characters 
that match themselves.

Suggestion 3.  Somewhere say that '{' and '}' are ordinary unless there is a 
complete quantifier match, with nothing but digits[,digits] between '{}', with 
nothing else, including ' ', added.
---

Turning '{' into a special character by making it an error when it does not 
begin a quantifier would break all intentional uses of '{' as ordinary.  I 
don't see making '{' sort-of special by sometimes raising and sometime not by a 
new special rule to be much better.  In particular, I don't like having only 
extra ' 's or other whitespace raise.  AFAIK, re is unforgiving of any extra 
chars, not just spaces.

The re.VERBOSE causes whitespace to be sometimes be ignored.  The list of 
situations when not ignored does not, to me, obviously include quantifiers.  
But it should.

>>> re.findall("""d{1,4}""", '', re.X)
['']
>>> re.findall("""d{1, 4}""", '', re.X)
[]

Suggestion 4. Say so, by adding 'or quantifier' after 'character class'

--
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue41241] Unnecessary Type casting in 'if condition'

2020-11-28 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue39096] "Format Specification Mini-Language" doc mistake for Decimal

2020-11-28 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



[issue42454] Move slice creation to the compiler for constants

2020-11-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I closed #11107 in favor of this issue.  Some of the discussion and concerns 
(like slice hashing) was similar.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-28 Thread Wyko ter Haar


Wyko ter Haar  added the comment:

You bet. Totally forgot when I was replying on my phone :)

--

___
Python tracker 

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



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Library (Lib)

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
versions: +Python 3.8, Python 3.9

___
Python tracker 

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



[issue41756] Do not always use exceptions to return result from coroutine

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Can we close the issue?

--
nosy: +asvetlov

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 4498e98a6bdf017d3b65fa679baf4c797909beb6 by Miss Islington (bot) 
in branch '3.8':
bpo-34215: Clarify IncompleteReadError message when "expected" is None 
(GH-21925) (#23540)
https://github.com/python/cpython/commit/4498e98a6bdf017d3b65fa679baf4c797909beb6


--

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset d41ec65ab7411e877ca33d05e8c900feca530635 by Zackery Spytz in 
branch 'master':
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538)
https://github.com/python/cpython/commit/d41ec65ab7411e877ca33d05e8c900feca530635


--
nosy: +asvetlov

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22424
pull_request: https://github.com/python/cpython/pull/23542

___
Python tracker 

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



[issue41562] StreamReaderProtocol inheritance

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Fixing a non-broken thing is not a world-class idea, I think.

--

___
Python tracker 

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



[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-28 Thread Ronald Oussoren


Change by Ronald Oussoren :


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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22422
pull_request: https://github.com/python/cpython/pull/23540

___
Python tracker 

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



[issue42491] Tkinter wait_visibility hanging when used in thread

2020-11-28 Thread Steve Carll


Steve Carll  added the comment:

Thank you to epaine for the quick reply.
IMHO this should be elevated and addressed.
TKinter not working well with threads appears to be a well known problem that a 
lot of developers have encountered and have had to work around.
The use of threads is not something that should be avoided, but rather used 
when needed in the appropriate manner. They've been around for a long time and 
work well in many development environments on a multitude of platforms.
I think it's time to make TKinter thread safe. Just my opinion...

--

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread miss-islington


miss-islington  added the comment:


New changeset cc5eb935c79bae13def91965e5fb7e8346d9dea1 by Miss Islington (bot) 
in branch '3.9':
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538)
https://github.com/python/cpython/commit/cc5eb935c79bae13def91965e5fb7e8346d9dea1


--

___
Python tracker 

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



[issue42478] ipaddress.IPv4network.interfaces()

2020-11-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Wyko, when responding by email, please delete the message you are responding 
to, as it is redundant when posted to the web page.

--
nosy: +ncoghlan, terry.reedy
stage:  -> test needed
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



[issue42471] Slowdown in socket tests noticed since Py3.8

2020-11-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Should this be closed as 'not a bug'?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue42491] Tkinter wait_visibility hanging when used in thread

2020-11-28 Thread E. Paine


E. Paine  added the comment:

I agree this is a race condition, and have narrowed the issue down to 
wait_visibility with the following also hanging indefinitely (tested against 
the master branch):

import threading
import tkinter as tk
def create_tp():
t = tk.Toplevel()
t.wait_visibility()
root = tk.Tk()
tk.Button(root, text="Create", command=lambda:
  threading.Thread(target=create_tp).start()).pack()
root.mainloop()

I agree this is a race condition (presumably between wait_visibility and window 
render) and am pretty sure there is nothing either us or the Tk team can do 
(IMO, this issue should be closed - though thank you for reporting it).
Similar behaviour to issue-42142, though I don't believe threading is used 
there.

> Am I doing something wrong here?
Using threads?! tkinter is known to not like threads and there are several bugs 
which can cause the Python interpreter to crash.

--
nosy: +epaine, serhiy.storchaka
title: TKinter hanging intermittently - sometimes throwing exception -> Tkinter 
wait_visibility hanging when used in thread
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 8085f742f4adfbc85f13fc734dfab036aa23acfb by Zackery Spytz in 
branch 'master':
bpo-34215: Clarify IncompleteReadError message when "expected" is None 
(GH-21925)
https://github.com/python/cpython/commit/8085f742f4adfbc85f13fc734dfab036aa23acfb


--

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread miss-islington


miss-islington  added the comment:


New changeset e1c669b7ed18a81bfaa349726424ff5de9485f0a by Miss Islington (bot) 
in branch '3.8':
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538)
https://github.com/python/cpython/commit/e1c669b7ed18a81bfaa349726424ff5de9485f0a


--

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue34215] streams.py:IncompleteReadError message is unclear when expected is None

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset df6c8bcffef3380869c8f76317610ce452880b25 by Miss Islington (bot) 
in branch '3.9':
bpo-34215: Clarify IncompleteReadError message when "expected" is None 
(GH-21925) (GH-23539)
https://github.com/python/cpython/commit/df6c8bcffef3380869c8f76317610ce452880b25


--

___
Python tracker 

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



[issue42489] Wrong method signature in python Documentation

2020-11-28 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
assignee:  -> docs@python
components: +Documentation -macOS
nosy: +docs@python
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



[issue42477] ip_interface addition and subtraction changes netmask

2020-11-28 Thread E. Paine


Change by E. Paine :


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



[issue42383] Pdb does not correclty restart the target if it changes the current directory

2020-11-28 Thread E. Paine


Change by E. Paine :


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



[issue42406] Importing multiprocessing breaks pickle.whichmodule

2020-11-28 Thread E. Paine


Change by E. Paine :


--
nosy: +davin, pitrou
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



[issue41879] Outdated description of async iterables in documentation of async for statement

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Both mentioned links have the correct code.
They use sync __aiter__ and async __anext__

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



[issue31904] Python should support VxWorks RTOS

2020-11-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aa1b8a168d8b8dc1dfc426364b7b664501302958 by pxinwr in branch 
'master':
bpo-31904: Fix test_os.test_getcwd_long_path() failure for VxWorks (GH-20256)
https://github.com/python/cpython/commit/aa1b8a168d8b8dc1dfc426364b7b664501302958


--
nosy: +vstinner

___
Python tracker 

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



[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Austin Scola


New submission from Austin Scola :

I think it would be more useful for the pathlib.Path.__eq__ method to test the 
normalized path (not sure if normalized is the right terminology here).

As a concrete example I think that `PosixPath('/foo')` should equal 
`PosixPath('/foo/../foo')`. This is because functionally the two paths are 
equivalent.

--
components: Library (Lib)
messages: 382015
nosy: ascola
priority: normal
severity: normal
status: open
title: pathlib.Path.__eq__ should test normalized path
type: behavior

___
Python tracker 

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



[issue42464] Pathlib resolve() resolves non-existent ".." components with strict=False

2020-11-28 Thread E. Paine


Change by E. Paine :


--
nosy: +serhiy.storchaka
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



[issue41818] Lib/pty.py major revision

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 74311aeb45b52cc145d27d9fca99f01874d6882d by Soumendra Ganguly in 
branch 'master':
bpo-41818: Fix test_master_read() so that it succeeds on all platforms that 
either raise OSError or return b"" upon reading from master (GH-23536)
https://github.com/python/cpython/commit/74311aeb45b52cc145d27d9fca99f01874d6882d


--

___
Python tracker 

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



[issue42494] struct.unpack_from return 2 values instead of one

2020-11-28 Thread Sébastien Lemetter

New submission from Sébastien Lemetter :

Hi,

I am using an old version, but maybe you can still help me. I am using the ROS 
operating system, and there, the unpack_from function is used for reading 
values from bags.
When I try to read uint16 with the function pointcloud2.readpoint(), it returns 
2 values instead of 1, and I couldn t understand why. Since this readpoint() is 
from the official pointcloud2 package from ros, and unpack_from is from 
official struct package, I don t think I could do many error here. In the 
screenshot, you can see that the inputs parameters seems ok. I am reading a 
field from my bag which is 2 bytes, and the offset (12) make also sense (4th 
value after 3 floats).



def read_points(cloud, field_names=None):

"""

Read points from a L{sensor_msgs.PointCloud2} message.

 

@param cloud: The point cloud to read from.

@type  cloud: L{sensor_msgs.PointCloud2}

@param field_names: The names of fields to read. If None, read all fields. 
[default: None]

@type  field_names: iterable

@param skip_nans: If True, then don't return any point with a NaN value.

@type  skip_nans: bool [default: False]

@param uvs: If specified, then only return the points at the given 
coordinates. [default: empty list]

@type  uvs: iterable

@return: Generator which yields a list of values for each point.

@rtype:  generator

"""

assert isinstance(cloud, roslib.message.Message) and cloud._type == 
'sensor_msgs/PointCloud2', 'cloud is not a sensor_msgs.msg.PointCloud2'

fmt = _get_struct_fmt(cloud.is_bigendian, cloud.fields, field_names)

print('fmt size ' , str(struct.calcsize(fmt)))

print('cloud.height ' , str(cloud.height))

print('cloud.row_step ' , str(cloud.row_step))

width, height, point_step, row_step, data, isnan = cloud.width, 
cloud.height, cloud.point_step, cloud.row_step, cloud.data, math.isnan

unpack_from = struct.Struct(fmt).unpack_from

 

for v in range(height):

offset = row_step * v

for u in range(width):  

yield unpack_from(data, offset)

offset += point_step

def callback(data):

print("pointcloud size is %d bytes" % len(data.data))

pointCloudArray_a = [1,2,3,4,5]

#print((data.data.size))

for indoux in range(4):

print("==")

print(indoux)

pointCloudArray_a[indoux] = np.array(list((read_points2(data, 
field_names=(fields_PI6[indoux])

Here my mail again if you need more infos:
sebal...@gmail.com

thanks,

--
files: getIntensity.png
messages: 382017
nosy: sebaleme
priority: normal
severity: normal
status: open
title: struct.unpack_from return 2 values instead of one
type: behavior
Added file: https://bugs.python.org/file49632/getIntensity.png

___
Python tracker 

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



[issue42494] struct.unpack_from return 2 values instead of one

2020-11-28 Thread Sébastien Lemetter

Sébastien Lemetter  added the comment:

I forgot, here is my configuration:

Ubuntu 18.04
Ros Melodic
Python 2.7

--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-11-28 Thread Andy Dirnberger


Change by Andy Dirnberger :


--
nosy: +dirn

___
Python tracker 

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



[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Eryk Sun


Eryk Sun  added the comment:

The __eq__ method would have to do a full resolve(), which is expensive and may 
fail. One can't simply resolve "/foo/symlink/.." as "/foo", where "symlink" is 
a filesystem symlink. The target has to be resolved before ".." is evaluated, 
and the link may be invalid or inaccessible. This isn't relevant in Windows 
because it normalizes ".." components in an opened path with string-based 
processing before passing the path to the kernel. But, for consistency, one 
would have to resolve symlinks before comparing paths in Windows as well.

I think if you need this in-depth comparison, it's better to call resolve() 
manually when paths aren't superficially equal.

--
nosy: +eryksun

___
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-11-28 Thread miss-islington


miss-islington  added the comment:


New changeset a86a274b7224a5069f82c2d2cdd1f499d9c8dc22 by pxinwr in branch 
'master':
bpo-31904: add shell requirement for test_pipes (GH-23489)
https://github.com/python/cpython/commit/a86a274b7224a5069f82c2d2cdd1f499d9c8dc22


--
nosy: +miss-islington

___
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-11-28 Thread miss-islington


miss-islington  added the comment:


New changeset 6a273fdc2a36f52fb70359149eff014f1b6b08d4 by pxinwr in branch 
'master':
bpo-31904: skip some tests related to fifo on VxWorks (GH-23473)
https://github.com/python/cpython/commit/6a273fdc2a36f52fb70359149eff014f1b6b08d4


--

___
Python tracker 

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



[issue13337] IGNORE_CASE doctest option flag

2020-11-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FWIW, while i'm never a fan of doctests, this would also help reduce the impact 
of other golden value tests where different platforms capitalize their error 
messages or not.

--
nosy: +gregory.p.smith
versions: +Python 3.10 -Python 3.3

___
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-11-28 Thread miss-islington


miss-islington  added the comment:


New changeset 00a6568ba37f0d815289776a51af46d0eac27384 by pxinwr in branch 
'master':
bpo-31904: remove libnet dependency from detect_socket() for VxWorks (GH-23394)
https://github.com/python/cpython/commit/00a6568ba37f0d815289776a51af46d0eac27384


--

___
Python tracker 

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



[issue42406] Importing multiprocessing breaks pickle.whichmodule

2020-11-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

gross / nice find :)

--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker 

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



[issue42494] struct.unpack_from return 2 values instead of one

2020-11-28 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Hi Sébastien,

This is a bug tracker for reporting bugs, not a help desk to help with your 
code. There are many community resources to help you debug your code, but this 
is not one of them. You can try:

* Reddit's /r/learnpython
* the Python-list mailing list or news group 
https://mail.python.org/mailman/listinfo/python-list or comp.lang.python
* The Python Discuss forums https://discuss.python.org/c/users/7
* various IRC channels https://www.python.org/community/irc/
* other forums https://www.python.org/community/forums/

There may be others. However I guess you probably need ROS specific forums.

It may help to read these first:

https://stackoverflow.com/help/minimal-reproducible-example

http://www.sscce.org/

http://catb.org/~esr/faqs/smart-questions.html

If there is a problem with pointcloud2.readpoint returning two values when you 
expected one, you should check the pointcloud2 documentation, or the ROS 
project, and report the bug to them.

I'm going to close this as "Third Party", as any bug is most likely in the 
pointcloud2 library, or your own code.

Unfortunately, even if it turns out to be a bug in struct.unpack_from, although 
I don't understand why you think it might be, we aren't accepting any bug 
reports for Python 2, it is no longer maintained. Please upgrade to Python 3.9 
and see if that fixes the problem.

Please note that your sample code gives a function "read_points" but the 
callback calls a different function "read_points2".

--
nosy: +steven.daprano
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Austin Scola


Austin Scola  added the comment:

Okay, thank you for the explanation Eryk. It makes sense to me now why __eq__ 
doesn't attempt to compare something other than just the parts of the path.

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



[issue39116] StreamReader.readexactly() raises GeneratorExit on ProactorEventLoop

2020-11-28 Thread Matthew


Matthew  added the comment:

Let me preface this by declaring that I am very new to Python async so it is 
very possible that I am missing something seemingly obvious. That being said, 
I've been looking at various resources to try to understand the internals of 
asyncio and it hasn't led to any insights on this problem thus far.
-

This all sounds quite similar to an experience I am dealing with. I'm working 
with pub sub within aioredis which internally uses a StreamReader with a 
function equivalent to readexactly. This all started from debugging "Task was 
destroyed but it is pending!" to which attempted fixes led to multiple 
"RuntimeError: aclose(): asynchronous generator is already running" errors.

I did the same thing, adding try excepts everywhere in my code to understand 
what was happening and this led me to identifying that a regular async function 
would raise GeneratorExit during await. However, even if I suppress this, the 
caller awaiting on this function would also raise a GeneratorExit. Suppressing 
this exception at the top level leads to an unsuspecting (to me) error 
"coroutine ignored GeneratorExit".

I understand that GeneratorExit is raised in unfinished generators when garbage 
collected to handle cleanup. And I understand that async functions are 
essentially a generator in the sense that they yield when they await. So, if 
the entire coroutine were garbage collected this might trigger GeneratorExit in 
each nested coroutine. However, from all of my logging I am sure that prior to 
the GeneratorExit, nothing returns  upwards so there should still be valid 
references to every object.

I'll include some errors below, in case they may be of relevance:

=== Exception in await of inner async function ===
Traceback (most recent call last):
  File ".../site-packages/uvicorn/protocols/http/httptools_impl.py", line 165, 
in data_received
self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 196, in 
httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserUpgrade: 858

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../my_code.py", line 199, in wait_for_update
return await self.waiter.wait_for_value()
GeneratorExit

=== Exception when suppressing GeneratorExit on the top level ===
Exception ignored in: 
Traceback (most recent call last):
  File ".../site-packages/websockets/protocol.py", line 229, in __init__
self.reader = asyncio.StreamReader(limit=read_limit // 2, loop=loop)
RuntimeError: coroutine ignored GeneratorExit

--
nosy: +matthew

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-28 Thread Christopher Snowhill


Christopher Snowhill  added the comment:

Sorry about that. I didn't know that Big Sur support wasn't added until 
post-3.9.0. I'll check if Brew has a newer version now, and even if not, if I 
can install a Git version for testing.

Incidentally, the error is occuring inside either the Tk or Tcl frameworks, and 
it's not a version that Brew supplies. Like the system copies of Python 2 and 
3, Brew links its builds against the system Tcl and Tk frameworks, which appear 
to have some bugs in the beta.

Thanks for testing, though.

--

___
Python tracker 

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



[issue42500] status() crashes on Python3.9 and 3.10

2020-11-28 Thread Xinmeng Xia


New submission from Xinmeng Xia :

This program can work well on Python 3.5.2 and Python2.7 with the following 
output.
"Invalid Entry, try again"


However it will crash on Python3.9.0rc1, 3.10.0a2 with the following error 
message:
"
Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
Python runtime state: initialized

Current thread 0x7fc4b679b700 (most recent call first):
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 38 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  File "/home/xxm/Desktop/methodfuzzer/error/error1.py", line 39 in status
  ...
Aborted (core dumped)
"

--
components: Interpreter Core
files: error1.py
messages: 382042
nosy: xxm
priority: normal
severity: normal
status: open
title: status() crashes on Python3.9 and 3.10
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file49635/error1.py

___
Python tracker 

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



[issue41818] Lib/pty.py major revision

2020-11-28 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
pull_requests: +22425
pull_request: https://github.com/python/cpython/pull/23546

___
Python tracker 

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



[issue13337] IGNORE_CASE doctest option flag

2020-11-28 Thread Justin Baum


Change by Justin Baum :


--
keywords: +patch
nosy: +justinba1010
nosy_count: 3.0 -> 4.0
pull_requests: +22426
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23547

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-28 Thread Ned Deily


Ned Deily  added the comment:

If Homebrew links against the Apple-supplied Tcl and Tk frameworks, which are 
in /System/Library/Frameworks, all bets are off as those are deprecated and 
hopelessly out-of-date versions of Tcl/Tk 8.5. If tkinter is linked to Tcl and 
Tk frameworks in /Library/Frameworks and there are Tcl and Tk frameworks there, 
those are not supplied by Apple; they are either installed by Homebrew from 
somewhere else (ActiveTcl or perhaps built from source). It can be confusing 
trying to determine which instance of Tcl or Tk tkinter is actually using at 
runtime on macOS.  The command:

python3.9 -m test.pythoninfo

will display the patch level of Tk in use.  There is some more detail of how it 
all works here: https://www.python.org/download/mac/tcltk/

--

___
Python tracker 

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



[issue41879] Outdated description of async iterables in documentation of async for statement

2020-11-28 Thread Nick Gaya


Nick Gaya  added the comment:

As described above, the issue is in the textual description, not the code 
snippet. I have opened a GitHub PR with a fix.

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

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-28 Thread Christopher Snowhill


Christopher Snowhill  added the comment:

That command also crashes with the same error. And I already verified with 
otool -L on the tkinter shared object file that it does indeed link the 
/System/Library/Frameworks version of both Tcl and Tk.

In fact, if I remember correctly, Homebrew's entire stance is to import and 
build as little as possible, always preferring to link to system bundled 
frameworks, no matter what. Maybe they'll rethink this one.

--

___
Python tracker 

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



[issue41879] Outdated description of async iterables in documentation of async for statement

2020-11-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

You are right.

--

___
Python tracker 

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



[issue42493] pathlib.Path.__eq__ should test normalized path

2020-11-28 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> rejected
type: behavior -> enhancement

___
Python tracker 

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



[issue42495] socket.gethostbyaddr raises error if invalid unicode in hosts

2020-11-28 Thread Peter Hunt


New submission from Peter Hunt :

If the hosts file contains invalid unicode, then the socket module will break 
when attempting to get the list of hosts. This renders modules such as Flask 
and Django unusable.

Background:
I had a mapping to localghost 
(https://twitter.com/rfreebern/status/1214560971185778693), and Docker 
incorrectly rewrote the hosts file during installation, turning it from 
"127.0.0.1 xn--9q8h" to "127.0.0.1 xn-9q8h".
The socket module was not able to handle that, and was failing with a 
UnicodeDecodeError in Python 3.6+ as it attempted to list the addresses for 
"127.0.0.1".

How to reproduce:
# Add "127.0.0.1 xn-9q8h" to C:/Windows/System32/drivers/etc/hosts

>>> socket.gethostbyaddr('127.0.0.1')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 2: 
invalid start byte

Expected:
In Python 2.7 - 3.5, it returns 'xn\u20139q8h'.
I feel returning "xn-9q8h" as a string would be best, but ignoring it could 
be an option.
An alternative would be to raise socket.error.

Full traceback from Flask as an example:

Traceback (most recent call last):
File "__init__.py", line 285, in 
app.run()
File 
"C:\Users\Peter\AppData\Roaming\Python\Python37\site-packages\flask\app.py", 
line 990, in run
run_simple(host, port, self, **options)
File 
"C:\Users\Peter\AppData\Roaming\Python\Python37\site-packages\werkzeug\serving.py",
 line 1052, in run_simple
inner()
File 
"C:\Users\Peter\AppData\Roaming\Python\Python37\site-packages\werkzeug\serving.py",
 line 1005, in inner
fd=fd,
File 
"C:\Users\Peter\AppData\Roaming\Python\Python37\site-packages\werkzeug\serving.py",
 line 848, in make_server
host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
File 
"C:\Users\Peter\AppData\Roaming\Python\Python37\site-packages\werkzeug\serving.py",
 line 740, in __init__
HTTPServer.__init__(self, server_address, handler)
File "C:\Program Files\Python37\lib\socketserver.py", line 452, in __init__
self.server_bind()
File "C:\Program Files\Python37\lib\http\server.py", line 139, in 
server_bind
self.server_name = socket.getfqdn(host)
File "C:\Program Files\Python37\lib\socket.py", line 676, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 2: 
invalid start byte

--
components: Library (Lib), Unicode, Windows
messages: 382029
nosy: Peter92, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, 
zach.ware
priority: normal
severity: normal
status: open
title: socket.gethostbyaddr raises error if invalid unicode in hosts
type: behavior
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



[issue42499] python not correctly processing double quotes in command line args in windows

2020-11-28 Thread Vikram Pal


New submission from Vikram Pal :

Using PowerShell in Windows, double quotes in argument given with "-c" flag to 
python does not work. E.g.

> Write-Host 's = "fn main() {"; s += "\n".join("let x = 0;" for _ in 
> range(2)); s+= "}"; print(s)'
s = "fn main() {"; s += "\n".join("let x = 0;" for _ in range(6000)); s+= "}"; 
print(s)

> python -c 's = "fn main() {"; s += "\n".join("let x = 0;" for _ in range(2)); 
> s+= "}"; print(s)'
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'fn' is not defined

--
components: Windows
messages: 382039
nosy: paul.moore, steve.dower, tim.golden, vikram.invincible.pal4, zach.ware
priority: normal
severity: normal
status: open
title: python not correctly processing double quotes in command line args in 
windows
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



[issue41879] Outdated description of async iterables in documentation of async for statement

2020-11-28 Thread Nick Gaya


Change by Nick Gaya :


--
pull_requests: +22427
pull_request: https://github.com/python/cpython/pull/23548

___
Python tracker 

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



[issue42498] smtplib is glitchy after receive server code 500

2020-11-28 Thread izomiac


New submission from izomiac :

I use a custom e-mail server and noticed I wasn't getting e-mails from FreeNAS. 
 I tracked the bug down to Python's smtplib.  My home internet can't do 
outbound port 25, so I use a port forwarding script that I've since learned 
injects "PROXY TCP4\r\n".  
This isn't a basic SMTP command, so my server responds with "500 Syntax error, 
command unrecognized\r\n".  

The first glitch in smtplib is that it assumes the server has precognition and 
upon receiving the syntax error assumes that the *next* command smtplib sends 
is invalid.  This happens to be "ehlo". After assuming "ehlo" got an error it 
backs down to "helo".  My server didn't like clients to send two greetings so 
it responded with "503 Bad sequence of commands", but allowed the connection to 
proceed anyway after the mild scolding.  smtplib proceeds to issue a "mail 
FROM" command, then a "rset" command and disconnects in shame after reflecting 
upon its actions for a while.

So, I modified my server to be a bit more laid back and just accept two 
greetings.  smtplib proceeds to issue "mail FROM", "rcpt TO", and "data" 
commands before crashing (raising an "SMTPDataError" in the traceback).

I then modified my server to ignore "PROXY" commands rather than send a syntax 
error and everything worked perfectly.  I don't code in python, and obviously 
my SMTP server is a one-off creation, but I figured I ought to let you all know 
in case you want to make some improvements to smtplib to better follow the SMTP 
spec and not crash with a cryptic error message three commands later after 
receiving a non-fatal error message.

--
components: email
files: debug output.txt
messages: 382038
nosy: barry, izomiac, r.david.murray
priority: normal
severity: normal
status: open
title: smtplib is glitchy after receive server code 500
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file49634/debug output.txt

___
Python tracker 

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



[issue42496] Don't change indentation of RST markup

2020-11-28 Thread Raymond Hettinger


New submission from Raymond Hettinger :

I just noticed that this PR was applied:  
https://github.com/python/cpython/pull/23545

In general, I don't think this should be done.  AFAICT, it has no visual effect 
for the reader and that the current markup is allowed by Sphinx (i.e. this 
isn't a bug and "fix markup" inaccurately indicated that something is being 
fixed).

Looking the Sphinx docs, the only rule I see is "Options must be indented to 
the same level as the directive content."

Given that the markup isn't wrong, I suggest that it be left alone:

* Changing it is unnecessary churn
* It makes back-porting real doc fixes more difficult
* It messes-up the blame/annotate history
* Presumably, the original author did it for their convenience (editors sets to 
four space indents, etc.)

In the Sphinx world, three space indents are the norm.  In the Python world, 
four space indents are the norm.  Given that Sphinx allows either, I think we 
should respect what the original author found that made sense for them.

For example, in the descriptor tutorial, I used four-space indented content for 
doctest/codetest directives to make maintenance easier (I can cut and paste 
fragments from live, tested code).

--
assignee: docs@python
components: Documentation
messages: 382030
nosy: adelfino, docs@python, gregory.p.smith, rhettinger
priority: normal
severity: normal
status: open
title: Don't change indentation of RST markup
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



[issue38200] Adding itertools.pairwise to the standard library?

2020-11-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue42496] Don't change indentation of RST markup

2020-11-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Original PR: https://github.com/python/cpython/pull/23524

I just checked, it has a visual effect for readers. For example:

"""
BUILD_STRING(count)

Concatenates count strings from the stack and pushes the resulting string 
onto the stack.

New in version 3.6.

LIST_TO_TUPLE

Pops a list from the stack and pushes a tuple containing the same 
values.

New in version 3.9.

LIST_EXTEND(i)

Calls list.extend(TOS1[-i], TOS). Used to build lists.

New in version 3.9.
"""

One extra space added large indentation.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38200] Adding itertools.pairwise to the standard library?

2020-11-28 Thread Raymond Hettinger


Change by Raymond Hettinger :


Added file: https://bugs.python.org/file49633/pairwise.py

___
Python tracker 

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



[issue42480] Python Tkinter crashes on macOS 11.1 beta

2020-11-28 Thread Ned Deily


Ned Deily  added the comment:

I've installed the 11.1 beta (of 2020-11-17) on an Intel-64 virtual machine and 
installed and run the test suite for the recently released 3.9.1rc1 Universal2 
binaries from python.org. The tests, including tkinter tests, run similarly to 
how they do on 11.0.1. Further, as far as I can tell, there is no place within 
Python itself where such a message ("macOS 11 or later required !") is emitted; 
I did not search the Tcl or Tk sources since you didn't say which version is in 
use. Be aware that 3.9.1rc1 is the first official Python release that supports 
macOS 11 Big Sur so it may be that the brew version you were using has 
preliminary patches for Big Sur support that differ from the final versions. 
Depending what you are trying to do, you might want to use the python.org 
3.9.1rc1 or 3.9.1 final (when released) until there is a supported brew 
version. Or, as Ronald suggest, you may need to track down exactly what and how 
the brew recipes are building for Tcl, Tk, and Python.  Good luck!

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



[issue42496] Don't change indentation of RST markup

2020-11-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

If this does have a visual effect for readers or if it breaks strict Sphinx 
requirement, let me know.

--

___
Python tracker 

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



[issue42497] New pathlib.Path attribute

2020-11-28 Thread ThatXliner


New submission from ThatXliner :

Add an attribute to pathlib.Path testing if a file/directory/symlink is 
executable or the user has executable permissions.

I've been trying to find a pythonic way for this (preferably in pathlib.Path) 
but all I found was trips to the shell and back.

This issue proposes adding an attribute (which I haven't figured the name most 
would like but it would be somewhere near .can_execute or .is_exe)

--
components: Library (Lib)
messages: 382034
nosy: ThatXliner
priority: normal
severity: normal
status: open
title: New pathlib.Path attribute
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



[issue42499] python not correctly processing double quotes in command line args in windows

2020-11-28 Thread Eryk Sun


Eryk Sun  added the comment:

Python uses the Windows C runtime to parse the command line into an argument 
array. By the CRT rules [1], you need to escape the embedded double quotes 
using backslashes. For example:

PS C:\> python -c 's = \"fn main() {\"; s += \"\n\".join(\"let x = 0;\" for 
_ in range(2)); s+= \"}\"; print(s)'
fn main() {let x = 0;
let x = 0;}

In case you don't know already, PowerShell magically converts the single quotes 
in your command line to double quotes. It recognizes that most Windows programs 
parse the command line using the C runtime or WinAPI CommandLineToArgvW, which 
doesn't have any special handling for single quotes.

You can use ctypes to see how your original command line gets parsed via 
CommandLineToArgvW, which is functionally the same as what the C runtime does. 
For example (note the -i option to enter interactive mode):

PS C:\> python -ic 's = "fn main() {"; s += "\n".join("let x = 0;" for _ in 
range(2)); s+= "}"; print(s)'
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'fn' is not defined

>>> import ctypes
>>> kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
>>> shell32 = ctypes.WinDLL('shell32', use_last_error=True)
>>> kernel32.GetCommandLineW.restype = ctypes.c_wchar_p
>>> shell32.CommandLineToArgvW.restype = ctypes.POINTER(ctypes.c_wchar_p)

>>> cmd = kernel32.GetCommandLineW()
>>> num = ctypes.c_int()
>>> args = shell32.CommandLineToArgvW(cmd, ctypes.byref(num))

>>> print(*zip(range(num.value), args[:num.value]), sep='\n')
(0, 'C:\\Program Files\\Python39\\python.exe')
(1, '-ic')
(2, 's = fn')
(3, 'main()')
(4, '{; s += \\n.join(let')
(5, 'x')
(6, '=')
(7, '0; for _ in range(2)); s+= }; print(s)')

As you can see, because the double quotes aren't escaped, they get consumed, 
combined with the rule for white space, to parse the command line after "-ic" 
into six arguments instead of just one argument.

---

[1] 
https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?view=msvc-160#parsing-c-command-line-arguments

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