classification
Title: IDLE shell fails: "ModifiedInterpreter instance has no attribute 'interp'"
Type: behavior Stage: resolved
Components: IDLE Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Grupobetatesting, ned.deily, terry.reedy
Priority: normal Keywords:

Created on 2013-10-03 04:04 by Grupobetatesting, last changed 2017-06-30 01:28 by terry.reedy. This issue is now closed.

Files
File name Uploaded Description Edit
Captura de pantalla de 2013-10-02 23:52:10.png Grupobetatesting, 2013-10-03 04:04
Captura de pantalla de 2013-10-03 02:27:12.png Grupobetatesting, 2013-10-03 05:49
Messages (7)
msg198879 - (view) Author: Martin (Grupobetatesting) Date: 2013-10-03 04:04
Hello! My name is Martin, a member of Free Software in Comahue National University of Neuquén, Argentina. We have detected an error in the compiler for Python 2.7 using Ubuntu 12.04: I write the code, without realizing I leave a comment with syntax error in that line (do not put the # of comments), compile and get error of sistaxis in that line. Fix the error adding # to comment, I do compile again and it shows me various errors that take over the Python compiler and I am forced to close it. Hope your response with a possible solution to this problem, my idea is to continue using this version of Python. Thank yo
msg198880 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-03 04:36
Can you give a step-by-step sequence of commands to reproduce the problem?  One thing that looks somewhat suspicious is that there seem to be multiple IDLE "*Python Shell" windows open.  Normally there should only be one.
msg198882 - (view) Author: Martin (Grupobetatesting) Date: 2013-10-03 05:49
I have three shell windows open because everytime i run the code corrected, it opens a new shell, I try to close them but there is one that keeps open, unless I kill it by terminal (kill) I attach a photo of compiling the line of code, closing leftover shell ... What I do is compile with three lines that should be comments, it makes syntax error for not to have commented lines, I comment them (#) and when I want to recompile, errors appears in the main shell.
msg198885 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-03 06:53
That still doesn't explain the problem.  How are you trying to "compile" the program?  For example, one way would be to use your mouse to select the "Run" menu item and then the "Run Module" option. Or use the F5 function key shortcut for that.  Another somewhat unusual thing is "No Subprocess" status in the shell window. How are you starting IDLE?  From a shell?  If so, with what arguments?  Also, can you show the contents of any files in your ~/.idlerc directory?
msg198977 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-10-05 02:04
By default, Idle runs user code in a separate process from the idle process that runs shell and edit windows. Because connecting the two processes sometimes fails, there is a start-up option -N (No subprocess) that run your code in the same process as idle code. Since this option also has potential problems, it should not be used unless necessary. In fact, some of us would like to eliminate the option (after fixing connection problems).

I tried and failed to reproduce the problem with 2.7.5 on Windows. I started with -N, opened an editor window, ran (F5) with a comment uncommented, got a syntax error box, added '#', ran again, and the valid code ran fine.

To continue this issue, update from 2.7.3 to 2.7.5 and see if you still have the problem. The update has 100s of bug fixes including many Idle fixes. If you do still see a problem with 2.7.5, please find a minimal file that has creates a problem when '#' is missing. Also, if you do, please test with 3.3.2 or the most recent 3.4.0.
msg199357 - (view) Author: Martin (Grupobetatesting) Date: 2013-10-10 03:12
Thank you very much for your help.

Specification of error :

In python 2.7.3 for Ubuntu 12.04 32-bit

It creates a program with the following line of code :


Python is a programming language That lets you work more quickly and integrate your systems more effectively.
You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.


import math

elCociente def (x, y):
    ratio = x / y
    return ratio

theRemainder def (x, y):
    remainder = x% y
    return other

laRaiz def ( x ) :
    root = math.sqrt ( x )
    return root

LaSegRaiz def (y):
    segraiz = math.sqrt ( y)
    return segraiz




def main ( ) :

    x = input (" Enter a number: " )
    y = input (" Enter a second number :")


    print " the quotient of dividing " , x , "with" , and , " is" , elCociente ( x , y)
    print " the remainder of dividing " , x , " for " and , " is" , theRemainder ( x , y)
    print " the root of " , x , " is" , laRaiz ( x )
    print " the root ," and , " is" , LaSegRaiz ( y)

Where the lines 1 and 2 are not discussed , when compiling the program ( f5 ) warns us to a syntax error , open the sheel , we force the compilation typing the main and opens another blank shell . not saying that is the error line .

If commented lines 1 and 2 and compile again ( f5 ) jump several errors in the shell which can not close and forces us to have to kill python process .

I hope I have been much clearer .

thanks


Corrected with cometary Program

# Python is a programming language That lets you work more quickly and integrate your systems more effectively.
# You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.


import math

elCociente def (x, y):
    ratio = x / y
    return ratio

theRemainder def (x, y):
    remainder = x% y
    return other

laRaiz def ( x ) :
    root = math.sqrt ( x )
    return root

LaSegRaiz def (y):
    segraiz = math.sqrt ( y)
    return segraiz




def main ( ) :

    x = input (" Enter a number: " )
    y = input (" Enter a second number :")


    print " the quotient of dividing " , x , "with" , and , " is" , elCociente ( x , y)
    print " the remainder of dividing " , x , " for " and , " is" , theRemainder ( x , y)
    print " the root of " , x , " is" , laRaiz ( x )
    print " the root ," and , " is" , LaSegRaiz ( y)
msg297339 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-30 01:28
I managed to crash 2.7 -n by running the multi-thread tkinter program posted for #10909.  Since it modifies widgets created in the main thread from a thread, I don't consider the failure a fixable IDLE bug.

3.6 -n ran the same program, so this is only for 2.7.
History
Date User Action Args
2017-06-30 01:28:03terry.reedysetstatus: open -> closed

messages: + msg297339
stage: test needed -> resolved
2013-10-10 03:12:44Grupobetatestingsetmessages: + msg199357
2013-10-05 02:04:06terry.reedysetnosy: + terry.reedy
messages: + msg198977

type: compile error -> behavior
stage: test needed
2013-10-03 06:54:00ned.deilysetmessages: + msg198885
2013-10-03 05:49:44Grupobetatestingsetfiles: + Captura de pantalla de 2013-10-03 02:27:12.png
resolution: not a bug
messages: + msg198882
2013-10-03 04:36:20ned.deilysetnosy: + ned.deily

messages: + msg198880
title: python bug report -> IDLE shell fails: "ModifiedInterpreter instance has no attribute 'interp'"
2013-10-03 04:07:14ned.deilylinkissue19149 superseder
2013-10-03 04:04:58Grupobetatestingcreate