New submission from Camion <camion_spam-pyb...@yahoo.com>:

Hello all,

I have been investigating a bug with a generator, which crashed, reporting that 
"TypeError: 'Fraction' object is not iterable".

Then I have tried to find it with the debugger and/or to reproduce it with a 
simpler program, but, I have not managed to reproduce the bug in my test 
program and I have been stopped by the fact that the debugger crashes with 
another error:

I have reproduced it on version 3.4.2 ans 3.6.3, BUT NOT on version 2.7.9. So I 
suspect it has been introduced with version 3.

Here is how to reproduce it : 

1/ Open Idle
2/ create and save this text program (or open if you already did - or don't do 
anything if it's already opened X-D)

from fractions import Fraction
U=Fraction(1)

def test(x):
    for i in range(1, x.denominator):
        x*=x
        yield i, i*x

for m, n in test(U*3/5):
    print (m, n)

3/ Run/check module (F5) in Idle editors window : it works perfectly
4/ start the debugger from Idle menus
5/ activate the "source" checkbox
6/ Run/check module (F5) in Idle editors window
7/ Click 3 times on [over] to get to the "for m, n in test(U*3/5):" line
8/ Click 6 times on [step], to get to the line 116 ("for m, n in test(U*3/5):") 
in the fractions.py files
9/ Click a seventh time on [step] and your program will crash with the folowing 
error (here with 3.6.3)

Traceback (most recent call last):
  File "/raid/ArcFolder/Mes documents/Mes Textes/Mes 
programmes/Machin/Test_itérateur_et_fractions.py", line 12, in <module>
    for m, n in test(U*3/5):
  File "/usr/local/lib/python3.6/fractions.py", line 376, in forward
    return monomorphic_operator(a, b)
  File "/usr/local/lib/python3.6/fractions.py", line 419, in _mul
    return Fraction(a.numerator * b.numerator, a.denominator * b.denominator)
  File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__
    if denominator is None:
  File "/usr/local/lib/python3.6/fractions.py", line 117, in __new__
    if denominator is None:
  File "/usr/local/lib/python3.6/bdb.py", line 48, in trace_dispatch
    return self.dispatch_line(frame)
  File "/usr/local/lib/python3.6/bdb.py", line 66, in dispatch_line
    self.user_line(frame)
  File "/usr/local/lib/python3.6/idlelib/debugger.py", line 24, in user_line
    self.gui.interaction(message, frame)
AttributeError: _numerator5/ Run/check module (F5) in Idle editors window

I have observed once 3.4.2 that the same operation without activating the 
source checkbox, lead to a full idle freeze, but I have not been able to 
reproduce it.

----------
assignee: terry.reedy
components: IDLE
messages: 307001
nosy: Camion, terry.reedy
priority: normal
severity: normal
status: open
title: Probable bug in all python3 / idle3 debugger
type: crash
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32140>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to