[issue41612] python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame'

2020-08-21 Thread Abael He


Abael He  added the comment:

This is a bug caused by IPython:

/opt/conda/lib/python3.8/site-packages/IPython/terminal/ptutils.py in 
get_completions(self, document, complete_event)
114 except Exception as e:
115 from traceback import print_tb
--> 116 print_tb(e)
117 
118 @staticmethod


##
# Simulation investigation for above KeyError:
In [3]: def fun():
   ...: try:
   ...: s = {}
   ...: k = s['0']
   ...: except Exception as e:
   ...: import sys
   ...: from traceback import print_tb
   ...: exc_type, exc_value, exc_traceback = sys.exc_info()
   ...: print_tb(exc_traceback)
   ...: 

In [4]: fun()
  File "", line 4, in fun
k = s['0']

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



[issue41612] python3.8.3/traceback.py:312, AttributeError: 'KeyError' object has no attribute 'tb_frame'

2020-08-21 Thread Abael He


New submission from Abael He :

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/shortcuts/prompt.py in 
prompt(self, message, editing_mode, refresh_interval, vi_mode, lexer, 
completer, complete_in_thread, is_password, key_bindings, bottom_toolbar, 
style, color_depth, include_default_pygments_style, style_transformation, 
swap_light_and_dark_colors, rprompt, multiline, prompt_continuation, 
wrap_lines, enable_history_search, search_ignore_case, complete_while_typing, 
validate_while_typing, complete_style, auto_suggest, validator, clipboard, 
mouse_support, input_processors, reserve_space_for_menu, enable_system_prompt, 
enable_suspend, enable_open_in_editor, tempfile_suffix, tempfile, default, 
accept_default, pre_run, set_exception_handler)
992 return 
get_event_loop().run_until_complete(self._dumb_prompt(self.message))
993 
--> 994 return self.app.run(set_exception_handler=set_exception_handler)
995 
996 async def _dumb_prompt(self, message: AnyFormattedText = "") -> _T:

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py
 in run(self, pre_run, set_exception_handler)
809 set_event_loop(loop)
810 
--> 811 return loop.run_until_complete(
812 self.run_async(pre_run=pre_run, 
set_exception_handler=set_exception_handler)
813 )

/opt/conda/lib/python3.8/asyncio/base_events.py in run_until_complete(self, 
future)
614 raise RuntimeError('Event loop stopped before Future 
completed.')
615 
--> 616 return future.result()
617 
618 def stop(self):

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py
 in run_async(self, pre_run, set_exception_handler)
776 loop.set_exception_handler(previous_exc_handler)
777 
--> 778 return await _run_async2()
779 
780 def run(

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py
 in _run_async2()
764 # `KeyboardInterrupt`, we still want to wait 
for the
765 # background tasks.
--> 766 await 
self.cancel_and_wait_for_background_tasks()
767 
768 # Set the `_is_running` flag to `False`. 
Normally this

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/application/application.py
 in cancel_and_wait_for_background_tasks(self)
865 for task in self.background_tasks:
866 try:
--> 867 await task
868 except CancelledError:
869 pass

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/buffer.py in 
new_coroutine(*a, **kw)
   1852 while True:
   1853 try:
-> 1854 await coroutine(*a, **kw)
   1855 except _Retry:
   1856 continue

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/buffer.py in 
async_completer(select_first, select_last, insert_common_part, complete_event)
   1681 return self.complete_state == complete_state
   1682 
-> 1683 async for completion in 
self.completer.get_completions_async(
   1684 document, complete_event
   1685 ):

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/completion/base.py in 
get_completions_async(self, document, complete_event)
267 completer = self.get_completer() or DummyCompleter()
268 
--> 269 async for completion in completer.get_completions_async(
270 document, complete_event
271 ):

/opt/conda/lib/python3.8/site-packages/prompt_toolkit/completion/base.py in 
get_completions_async(self, document, complete_event)
194 Asynchronous generator of :class:`.Completion` objects.
195 """
--> 196 for item in self.get_completions(document, complete_event):
197 yield item
198 

/opt/conda/lib/python3.8/site-packages/IPython/terminal/ptutils.py in 
get_completions(self, document, complete_event)
114 except Exception as e:
115 from traceback import print_tb
--> 116 print_tb(e)
117 
118 @staticmethod

/opt/conda/lib/python3.8/traceback.py in print_tb(tb, limit, file)
 51 method.
 52 """
---> 53 print_list(extract_tb(tb, limit=limit), file=file)
 54 
 55 def format_tb(tb, limit=None):

/opt/conda/lib/python3.8/traceback.py in extract_tb(tb, limit)
 70 whitespace stripped; if the source is not available it is None.
 71 """
---> 72 return StackSummary.extract(walk_tb(tb), limit=limit)
 73 
 74 #

/opt/conda/lib/python3.8/traceback.py in extract(klass, frame_gen, limit, 
lookup_lines, capture_locals)
345 result = klass()
346 fnames = set()
--> 347 for f, lineno in frame_gen:
348 co = 

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

2020-08-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a tutorial. The purpose of this part is documenting the bare except 
clause. It cannot be done without using a bare except in example.

There is nothing wrong with a bare except if it used properly (e.g. if the 
caught exception is reraised). In any case "except BaseException" is not any 
better, because it is equivalent to a bare except.

Note also that PR 21917 introduces an error: instead of printing the type of 
exception it prints the stringified exception itself (in some case it is an 
empty string).

--

___
Python tracker 

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



[issue41598] rnd() + rndup() in math

2020-08-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Marco, it is better to give a description of the functionality required rather 
than a simplistic and incorrect implementation :-)

(Not that I am likely to provide a better implementation without a lot of 
study.)

Regardless of whether you or I agree with the decision to move to Banker's 
Rounding, that was done about a decade ago, and it matches decisions made by 
other languages such as Julia. Changing the default will break people's code 
and we do not do that lightly, or at all, without a very good reason.

As Tim Peters describes here:

https://mail.python.org/pipermail/python-dev/2008-January/075873.html

many older languages implemented rounding by "add half and chop", more because 
it was cheap than for its mathematical properties.

Are you satisfied that adding a rounding mode to the built-in `round` function 
is a better solution than a series of functions in the math module? If so, I 
will change the title to reflect that.

Vedran: I don't think the availability of different rounding modes will have 
any effect at all on whether or not people believe floats are real decimal 
numbers rather than binary floats. People already believe that. I think we are 
better off acknowledging that there are reasonable use-cases for different 
rounding modes even when using floats.

According to this:

https://www.gnu.org/software/libc/manual/html_node/Rounding.html

IEEE-754 only requires four rounding modes, defaulting to the same Banker's 
Rounding that Python uses. Wikipedia says there are five:

https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules


Regardless of whether there are four or five, I see no technical reason why we 
couldn't offer the full set of eight used by the decimal module.

--

___
Python tracker 

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



[issue30434] multiprocessing AuthenticationError "digest sent was rejected"

2020-08-21 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2.7 is no longer supported, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue41598] rnd() + rndup() in math

2020-08-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Vedran: you are quoting von Neumann out of context, he was talking about 
generating random numbers, not rounding, and in the seven decades since he made 
his famous witticism, we of course know that there is absolutely nothing wrong 
with generating random numbers via arithmetical methods so long as you do it 
correctly :-)

I have read your comments in the linked Stackoverflow answer, and I don't agree 
that we shouldn't be rounding binary floats. I do, however, agree with your 
comment here that we ought to add a rounding mode to the built-in round 
function, that would be a much better idea than adding a multitude of 
individual rounding functions.

I proposed this idea some time ago:

https://mail.python.org/archives/list/python-...@python.org/message/DVS3XSAKW37NDD37BE3IOCKRBRV3Y5A6/

--
nosy: +steven.daprano

___
Python tracker 

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



[issue26794] curframe can be None in pdb.py

2020-08-21 Thread Irit Katriel


Irit Katriel  added the comment:

Maybe it was fixed in issue9230

--

___
Python tracker 

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



[issue26794] curframe can be None in pdb.py

2020-08-21 Thread Irit Katriel


Irit Katriel  added the comment:

Jacek, did you see this happen?

My reading of the code is that curframe is initialized in setup(), which is 
called before curframe is accessed.  It can later be modified in _select_frame.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue23832] pdb's `longlist` shows only decorator if that one contains a lambda

2020-08-21 Thread Irit Katriel


Irit Katriel  added the comment:

I think this has been fixed by now, because I don't see the problem in Python 
3.10:

python.bat -mpdb tmp1.py
Running Release|Win32 interpreter...
> c:\users\user\src\cpython\tmp1.py(2)()
-> def foo(x, y=None):
(Pdb) c
Traceback (most recent call last):
  File "C:\Users\User\src\cpython\lib\pdb.py", line 1740, in main
pdb._runscript(mainpyfile)
  File "C:\Users\User\src\cpython\lib\pdb.py", line 1609, in _runscript
self.run(statement)
  File "C:\Users\User\src\cpython\lib\bdb.py", line 580, in run
exec(cmd, globals, locals)
  File "", line 1, in 
  File "c:\users\user\src\cpython\tmp1.py", line 2, in 
def foo(x, y=None):
  File "c:\users\user\src\cpython\tmp1.py", line 9, in spam
1/0
ZeroDivisionError: division by zero
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> c:\users\user\src\cpython\tmp1.py(9)spam()
-> 1/0
(Pdb) longlist
  5 @foo(foo, lambda a:a)
  6 def spam():
  7 0+0
  8 1+1
  9  -> 1/0
(Pdb)

--
components: +Library (Lib)
nosy: +iritkatriel

___
Python tracker 

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



[issue41602] Python doesn't exit with proper resultcode on SIGINT in runpy (pymain_run_module)

2020-08-21 Thread Thomas Grainger


Thomas Grainger  added the comment:

adding vstinner, as this seems related to pymain_run_module rather than runpy

--
nosy: +vstinner

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

All images, test programs, and old patches have been removed.

window resize test is now being performed using stty.

On linux:
stty -F  rows x cols y

On BSDs:
stty -f  rows x cols y

to change window size.

--

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
title: pty.spawn hangs on FreeBSD 9.3, 10.x -> pty.spawn hangs on FreeBSD 9.3, 
10.x, 12.1

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49393/test.py

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49395/pty.diff

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49391/before.png

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49390/pty.diff

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49392/after.png

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49396/pty.diff

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49402/pty.diff

___
Python tracker 

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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


Removed file: https://bugs.python.org/file49386/pty.diff

___
Python tracker 

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



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

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PEP 8 discourages the use of bare except.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41573] Correct wrong sentences in General FAQ

2020-08-21 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41573] Correct wrong sentences in General FAQ

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 7173fc84e61b80b19261e47fca38030206a3a78e by wyz23x2 in branch 
'master':
bpo-41573: Update release versions in General FAQ (GH-21915)
https://github.com/python/cpython/commit/7173fc84e61b80b19261e47fca38030206a3a78e


--
nosy: +terry.reedy

___
Python tracker 

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



[issue41575] Please use active voice in async docs.

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Active voice is strongly recommended for docstrings in PEP 257 and commit 
messages somewhere in the Developer guide and applies to docs.  The doc for the 
asyncio call_x functions all start with the active voice: 'Schedule', which is 
the main action of the function.  'is returned' occurs later in the entries and 
that case is less clear.

--
nosy: +Yury.Selivanov, gvanrossum, terry.reedy
title: Please use active voice "Return foobar" instead of passive voice "foobar 
is returned" -> Please use active voice in async docs.

___
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-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Tim, I have been reading this, without examining all the details, to learn more 
about FP accuracy problems.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41611] IDLE: problems with completions on Mac

2020-08-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: IDLE: problem -> IDLE: problems with completions on Mac

___
Python tracker 

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



[issue41611] IDLE: problem

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On my Macbook Air Mohave, I don't get completion boxes on either 3.8.3rc1 or 
3.9.0rc1, even when clicking Edit => Show completions.  Nor does IDLE quit or 
print anything in Terminal.

--

___
Python tracker 

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



[issue41611] IDLE: problem

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Serhiy, should 'text' be '!text' in a tkinter-generated widget name?

--

___
Python tracker 

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



[issue41611] IDLE: problem

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The Mac-specific shutdown warning from multiprocessing is not directly related 
to IDLE.  'multiprocessing' is not imported by IDLE and is not in sys.modules 
when IDLE starts.

>From 'all-day' I assume that there was a time period between starting IDLE and 
>getting the traceback.

  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
 line 1885, in __call__
return self.func(*args)

__call__ here is a method of CallWrapper, often used for event handlers.

  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py",
 line 248, in winconfig_event
acw_width, acw_height = acw.winfo_width(), acw.winfo_height()

winconfig_event handles tk '' events.  "A Configure event is sent to 
a window whenever its size, position, or border width changes, and sometimes 
when it has changed position in the stacking order."  IDLE triggers it somehow. 
 It has had intermittent bugs before.

  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
 line 1291, in winfo_width
self.tk.call('winfo', 'width', self._w))
_tkinter.TclError: bad window path name 
".!listedtoplevel4.!frame.text.!toplevel2"

The name is for an editor window (listedtoplevel) with a frame with a text with 
a popup (unlisted toplevel).  The toplevel2 suggests that this is the second 
popup for this text.  The name looks correct except that I expected 'text' to 
maybe be '!text'.  In any case, the name is generated by tkinter without IDLE 
being involved.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren, serhiy.storchaka
title: IDLE warnings and exceptions -> IDLE: problem

___
Python tracker 

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



[issue41607] pdb - Clickable path to breakpoints

2020-08-21 Thread Vedran Čačić

Vedran Čačić  added the comment:

IDLE has Go to File/Line menu too. I think it would also help there. (Terry, 
can you confirm?) Not to mention that it would be one thing less to explain to 
beginners when using pdb.

--
nosy: +veky

___
Python tracker 

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



[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Thomas Grainger


Thomas Grainger  added the comment:

seems like a dupe? https://bugs.python.org/issue32308

--
keywords: +patch
message_count: 3.0 -> 4.0
nosy: +graingert
nosy_count: 5.0 -> 6.0
pull_requests: +21050
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/4846

___
Python tracker 

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



[issue41611] IDLE warnings and exceptions

2020-08-21 Thread Raymond Hettinger


New submission from Raymond Hettinger :

In case it is helpful, here is the error log from a recent full-day IDLE 
session.

$ python3.9 --version
Python 3.9.0rc1
$ python3.9 -m idlelib.idle
Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
 line 1885, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/autocomplete_w.py",
 line 248, in winconfig_event
acw_width, acw_height = acw.winfo_width(), acw.winfo_height()
  File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
 line 1291, in winfo_width
self.tk.call('winfo', 'width', self._w))
_tkinter.TclError: bad window path name 
".!listedtoplevel4.!frame.text.!toplevel2"
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/resource_tracker.py:216:
 UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects 
to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
2020-08-20 15:00:38.074 Python[1512:2706287] WARNING:  running implicitly; please run panels using NSSavePanel rather 
than NSApplication.
2020-08-20 16:29:29.880 Python[1512:2706287] WARNING:  running implicitly; please run panels using NSSavePanel rather 
than NSApplication.

--
assignee: terry.reedy
components: IDLE
messages: 375764
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE warnings and exceptions
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-21 Thread Tim Peters


Tim Peters  added the comment:

> won't have a chance to work through it for a week or so

These have been much more in the way of FYI glosses. There's no "suggestion" 
here to be pursued - just trying to get a deeper understanding of code already 
written :-)

While I can concoct any number of cases where the add_on() method fails correct 
rounding, all the ones I dug into turned out to be "oops! went the wrong way" 
in nearest/even tie cases. By any non-anal measure, its accuracy is excellent.

--

___
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-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> My apologies if nobody cares about this ;-)

I care :-) 

Am in crunch right now, so won't have a chance to work through it for a week or 
so.

--

___
Python tracker 

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



[issue41610] Any Raspberry Pi Zero Projects to try?

2020-08-21 Thread Ammar Askar


Ammar Askar  added the comment:

Hi Supriya, this website is for reporting specific bugs about the Python 
language itself, not for general discussion.

I'd suggest taking a look at https://www.python.org/community/ and 
https://www.reddit.com/r/learnpython/ to find people to chat with about Python 
projects.

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



[issue41608] IDLE: multiple space deletion by Backspace after non-spaces

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Your example is 4 spaces, 3 (non-space) chars, 2 spaces, 3 chars, 2 spaces.
With the cursor after the 2 internal spaces, backspace deletes 1 space, not 2.  
However, with the first block expanded from 3 chars to 4, backspace deletes 
both spaces.

Without out looking at the code, the uniform rule, when deleting a space to the 
left with Backspace, seems to be "Delete up to Indent spaces, stopping at the 
first non-space char or at a slice position that is a multiple of Indent."  
Tabs in the text are interpreted as as many spaces needed to get to a position 
that is a multiple of 8.  I tested this with longer space runs and with Indent 
set to 5.

Deleting a space with Delete always deletes one char.  So single space deletion 
is available anywhere.

I consider the current behavior as a defensible design decision for a PEP 8 
oriented Python code editor.  Multiple space deletion is a plus when deleting 
large space blocks, a minus when lining up multiple continuation lines.  While 
I could imagine turning off multiple space delete for internal blocks, I would 
rather trailing blocks be deleted all at once.  All in all, I consider a change 
fairly low priority at the moment.

The prompt is 4 chars: '>>> '.  Anything after that is an indent and should be 
treated as such.  It is the first line of a mini 'file' with one statement.  
Treating this line differently would be a bug.

--
title: IDLE: not remove multiple spaces if not at start of line -> IDLE: 
multiple space deletion by Backspace after non-spaces

___
Python tracker 

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



[issue41610] Any Raspberry Pi Zero Projects to try?

2020-08-21 Thread supriya singh


New submission from supriya singh :

Not any error or issue just wanted to get some work or to find new friends.

Recently I started learning python during this lockdown and with the help of 
YouTube tutorials I learned a lot.

Now I am here to find some Raspberry Pi zero projects that include Python.

I have searched on Google and found the project "self-driving car" Now, I want 
to learn more by trying some more projects so that I can master this language.

--
messages: 375759
nosy: supriyasingh
priority: normal
severity: normal
status: open
title: Any Raspberry Pi Zero Projects to try?

___
Python tracker 

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



[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

in 3.6 t == '*', in 3.7 and later it is '**'.

To be honest I don't like the 3.7 behaviour, it is very surprising even if it 
is technically correct (the first '*' is from a match from the entire string, 
the second one is from an empty match at the end of the string). 

A workaround is to explicitly anchor the regular expression (for example by 
adding '^' to the start).

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-21 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-21 Thread Irit Katriel


Irit Katriel  added the comment:

The reason for this that it first checks whether there is a __code__ attribute 
(which both methods and functions have) and only afterwards checks for 
__func__.__code__. 

I will submit a patch with a test and fix shortly.

--

___
Python tracker 

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



[issue41609] pdb's whatis command reports method as function

2020-08-21 Thread Irit Katriel


New submission from Irit Katriel :

pdb's whatis command prints 'Function' instead of 'Method' for a bound method:

> python.bat
Running Release|Win32 interpreter...
Python 3.10.0a0 (heads/master-dirty:12695f4c6d, Aug 21 2020, 15:48:06) [MSC 
v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyClass:
... def mymethod(self):
... pass
...
>>> import pdb
>>> pdb.set_trace()
--Return--
> (1)()->None
(Pdb) whatis MyClass().mymethod
Function mymethod
(Pdb) MyClass().mymethod
>
(Pdb)

--
components: Library (Lib)
messages: 375756
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: pdb's whatis command reports method as function
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



[issue41608] IDLE: not remove multiple spaces if not at start of line

2020-08-21 Thread E. Paine


E. Paine  added the comment:

Further clarification on the new behaviour: in the shell whitespace after the 
prompt (>>>) will not be considered an indent and only have one character 
deleted at a time. However, on a continuation line, any initial whitespace will 
be considered an indent and the smart backspace behaviour will apply.

--

___
Python tracker 

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



[issue41608] IDLE: not remove multiple spaces if not at start of line

2020-08-21 Thread E. Paine


Change by E. Paine :


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

___
Python tracker 

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



[issue41608] IDLE: not remove multiple spaces if not at start of line

2020-08-21 Thread E. Paine


New submission from E. Paine :

I could not think of a better title so will attempt to explain myself better 
here. Currently, the IDLE smart backspace will delete multiple whitespace up to 
the tab width even if it is not at the start of the line. Consider the 
following examples (where the | is where the cursor is when backspace is 
clicked - the backticks are just to show code not part of the example text):

`|abc  def  `: IDLE correctly deletes all four spaces as this is considered 
the indentation of the code.

`abc  |def  `: IDLE incorrectly deletes both spaces rather than just one 
(annoying when correcting a typo). The patch proposes IDLE just deletes one 
space as is normal/expected behaviour.

`abc  def  |`: IDLE will currently delete both spaces but the proposed 
patch will just delete one. This behaviour is up for debate as I personally 
think all trailing whitespace should be cleared by a backspace, but I also 
think the proposed behaviour is more consistent than the existing behaviour.

The patch (a PR to be linked shortly after issue creation) is very simple as we 
already have the compiled `_line_indent_re` which we can check for a full match 
on all text before the cursor (`chars`).

--
assignee: terry.reedy
components: IDLE
messages: 375754
nosy: epaine, taleinat, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: not remove multiple spaces if not at start of line
type: enhancement
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



[issue41572] Documentation wording fix on Lib/asyncio/transports.py

2020-08-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Cleber.

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



[issue41572] Documentation wording fix on Lib/asyncio/transports.py

2020-08-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:


New changeset 1370d9dd9fbd71e9d3c250c8e6644e0ee6534fca by Miss Islington (bot) 
in branch '3.8':
bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914) (GH-21930)
https://github.com/python/cpython/commit/1370d9dd9fbd71e9d3c250c8e6644e0ee6534fca


--

___
Python tracker 

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



[issue41572] Documentation wording fix on Lib/asyncio/transports.py

2020-08-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:


New changeset a2d00f04733491a56abec45e7a20fb42282bb4d1 by Miss Islington (bot) 
in branch '3.9':
bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914) (#21929)
https://github.com/python/cpython/commit/a2d00f04733491a56abec45e7a20fb42282bb4d1


--

___
Python tracker 

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



[issue39461] [RFE] os.environ should support Path-like values, like subprocess(..., env=...)

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

os.environ is initially a copy of the os string-string mapping.  That some 
string values happen to represent file paths is opaque to the mapping.  So, to 
me, looking at os.environ by itself, there is no particular reason to 
autoconvert Path values but not anything else nor to autoconvert values but not 
keys.

If os.environ['key'] = Path('boo') worked, I would expect os.environ['key2'] = 
333 to work.  I would consider a new inconsistency here to be worse than the 
existing one between os.environ and subprocess.Popen(env=...).  It would be OK 
with me if the latter were fixed.

It is not unheard of for CPython to accept objects that conceptually should not 
be.  Some instances have be 'grandparented', others not.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue41598] rnd() + rndup() in math

2020-08-21 Thread Vedran Čačić

Vedran Čačić  added the comment:

Yes, and these functions are completely fine for your personal library, if you 
need such things. But they really have no place in math module, since (1) they 
aren't always correct, (2) it's incredibly difficult to characterize exactly 
when they are, and (3) even when they are correct, they just give people wrong 
impression about floats somehow being decimal numbers.

If you need to use floats, reconcile yourself with the idea that they don't 
represent all decimal numbers, not even the ones with just one decimal place, 
and any algorithm dealing with decimal digits will be just an approximation.

If you want the best approximation the humanity can muster, backed with 
empirical data and theoretical considerations, use the round() builtin. 

If you want to just have something that works according to your preconceived 
notions in some cases, while failing mysteriously in others, use your 
quick-and-dirty implementations.

If you want exact decimal results, use the decimal module, and specify the 
rounding mode as you wish.

--

___
Python tracker 

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



[issue41598] rnd() + rndup() in math

2020-08-21 Thread marco_ocram


marco_ocram  added the comment:

rndup is not correct and rnd work smooth only for numbers about < e16 until 
they have a fractional part. it's interesting but not simple.

--

___
Python tracker 

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



[issue41607] pdb - Clickabler path to breakpoints

2020-08-21 Thread Michael Mussato


New submission from Michael Mussato :

Wouldn't it be helpful if the pdb showed the path to the current breakpoint as 
a clickable link? For this to work, it seems that the path needs to follow a 
specific format, like so:
"File "/full/path/to/file.py", line XY"

Currently, it displays the breakpoint like this:
"> /full/path/to/file.py(XY).func()"

This might be very IDE dependent, but i. e. PyCharm interprets the first format 
as a clickable link and takes you straight to the line of code that contains 
the breakpoint. Very helpful.

--
components: Library (Lib)
files: Screenshot 2020-06-12 at 08.37.35.png
messages: 375747
nosy: michimussato
priority: normal
severity: normal
status: open
title: pdb - Clickabler path to breakpoints
type: enhancement
Added file: https://bugs.python.org/file49420/Screenshot 2020-06-12 at 
08.37.35.png

___
Python tracker 

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



[issue41607] pdb - Clickable path to breakpoints

2020-08-21 Thread Michael Mussato


Change by Michael Mussato :


--
title: pdb - Clickabler path to breakpoints -> pdb - Clickable path to 
breakpoints

___
Python tracker 

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



[issue41598] rnd() + rndup() in math

2020-08-21 Thread marco_ocram


marco_ocram  added the comment:

thank you very much about the hints, i've improved the code as follows.

def rnd(x, n=0):
   a = x*10**(n + 1)
   b = int(a)
   if abs(a - b) >= 0.5: b += 1 if x >= 0 else -1
   a = b/10
   b = int(a)
   if abs(a - b) >= 0.5: b += 1 if x >= 0 else -1
   return b/10**n

def rndup(x, n=0):
   a = x*10**(n + 1)
   b = int(a)
   if abs(a - b) > 0: b += 1 if x >= 0 else -1
   a = b/10
   b = int(a)
   if abs(a - b) > 0: b += 1 if x >= 0 else -1
   return b/10**n

now it manage well your cases ...

print(rnd(2.8 - 1.3), 2.8 - 1.3)
print(rnd(1.8 - 1.3), 1.8 - 1.3)
print(rnd(-2.8 + 1.3), -2.8 + 1.3)
print(rnd(-1.8 + 1.3), -1.8 + 1.3)

results ...

2.0 1.4998
1.0 0.5
-2.0 -1.4998
-1.0 -0.5

we have to define limits caused by the floating point internal representation 
but for general use in my opinion can work fine. do you see other cases where 
it cracks?

--

___
Python tracker 

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



[issue41606] multiprocessing.Event.wait hangs when interrupted by signal that sets the event

2020-08-21 Thread Salvatore Ingala


New submission from Salvatore Ingala :

According to the docs, multiprocessing.Event is a clone of threading.Event. 
Yet, there is a strange behavior that is observed only on 
multiprocessing.Event. If an event.wait() is interrupted by a SIGINT and the 
signal handler sets the event, then the call to event.set() hangs if event is 
an instance of multiprocessing.Event, in what looks like a deadlock; instead, 
it works as expected if it's an instance of threading.Event.

See the file attached for a reproduction.

It seems to have been so for a long time, see: 
https://stackoverflow.com/questions/24422154/multiprocessing-event-wait-hangs-when-interrupted-by-a-signal/30831867

--
files: event-test.py
messages: 375745
nosy: salvatore.ingala
priority: normal
severity: normal
status: open
title: multiprocessing.Event.wait hangs when interrupted by signal that sets 
the event
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49419/event-test.py

___
Python tracker 

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



[issue41605] t = re.sub(".*", "*", src) has different ouput

2020-08-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm suspicious that this differs per-OS. Please provide exact Python version 
information for each OS you list in your initial report.

I suspect what you're seeing is related to this change:

Changed in version 3.7: Empty matches for the pattern are replaced when 
adjacent to a previous non-empty match.

--
components: +Regular Expressions -2to3 (2.x to 3.x conversion tool)
nosy: +eric.smith, ezio.melotti, mrabarnett

___
Python tracker 

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



[issue4356] Add "key" argument to "bisect" module functions

2020-08-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue41586] Allow to set pipe size on subprocess.Popen.

2020-08-21 Thread Gregory P. Smith


Change by Gregory P. Smith :


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