python / cpython

The Python programming language
https://www.python.org
Other
63.88k stars 30.57k forks source link

IDLE shell fails: "ModifiedInterpreter instance has no attribute 'interp'" #63349

Closed e3c106c0-b29d-4603-8a81-0f6915b1e361 closed 7 years ago

e3c106c0-b29d-4603-8a81-0f6915b1e361 commented 11 years ago
BPO 19150
Nosy @terryjreedy, @ned-deily
Files
  • Captura de pantalla de 2013-10-02 23:52:10.png
  • Captura de pantalla de 2013-10-03 02:27:12.png
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = created_at = labels = ['expert-IDLE', 'type-bug', 'invalid'] title = 'IDLE shell fails: "ModifiedInterpreter instance has no attribute \'interp\'"' updated_at = user = 'https://bugs.python.org/Grupobetatesting' ``` bugs.python.org fields: ```python activity = actor = 'terry.reedy' assignee = 'none' closed = True closed_date = closer = 'terry.reedy' components = ['IDLE'] creation = creator = 'Grupobetatesting' dependencies = [] files = ['31948', '31950'] hgrepos = [] issue_num = 19150 keywords = [] message_count = 7.0 messages = ['198879', '198880', '198882', '198885', '198977', '199357', '297339'] nosy_count = 3.0 nosy_names = ['terry.reedy', 'ned.deily', 'Grupobetatesting'] pr_nums = [] priority = 'normal' resolution = 'not a bug' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue19150' versions = ['Python 2.7'] ```

    e3c106c0-b29d-4603-8a81-0f6915b1e361 commented 11 years ago

    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

    ned-deily commented 11 years ago

    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.

    e3c106c0-b29d-4603-8a81-0f6915b1e361 commented 11 years ago

    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.

    ned-deily commented 11 years ago

    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?

    terryjreedy commented 11 years ago

    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.

    e3c106c0-b29d-4603-8a81-0f6915b1e361 commented 11 years ago

    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)

    terryjreedy commented 7 years ago

    I managed to crash 2.7 -n by running the multi-thread tkinter program posted for bpo-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.