Error: IDLE crashes after closed

Asked

Viewed 713 times

1

I have a lab with 35 machines running Windows 8.1 Pro. After installing Python (version 2.7.9 64bits) on all machines, I come across the following problems:

  • Some machines install normally, but it is not possible to open idle. By clicking on the shortcut, idle simply does not open. I am not seeing any error message.

  • Other machines work properly, I can open IDLE, type code, run. Only when closing the tool and trying to open again, I return to the problem mentioned earlier.

  • When IDLE stops working (I can’t open it anymore), it also stops working via command prompt. When I try to execute some code via command prompt, I get the following message:

    Traceback (most recente call last):
    File "C:\Python27\lib\site.py", line 62, in <module>
      import os
    File "C:\Python27\lib\os.py", line 400, in <module>
      import UserDict
    File "C:\Python27\lib\UserDict.py", line 1
      Version" valueType="REG_SZ" value="1.0" operationHint="replace" owner="true" />
                         ^
    SyntaxError: invalid syntax
    

Any way to resolve this? Is there any known compatibility issue with Windows 8.1?

  • What version of IDLE are you using? an error appears when you use it in the command line? python -m idlelib

  • I’m using the installed version along with python, version 2.7.9. I haven’t had a chance to test it on the command line yet. Once tested, add the result.

  • I’ve tested it on the command line and it stops working too. I didn’t test the command you showed @qmechanik but I can run normally on another computer via command prompt, already on a computer where IDLE stopped working, via prompt also doesn’t work.

  • I did the installation using EXE downloaded from the official website. I did not change any settings. The code I tried to run via prompt, after IDLE crashed, was a normal print.

  • As for executing the Python command at the prompt, I have already come across two situations: sometimes IDLE stops working but I can run via prompt and at other times everything stops working.

1 answer

2

This is the error of the Userdict.py file syntax in the lib directory within the Python installation. It is clear that it is an XML file and not the original source code of this module in Python. Try to exchange the contents of this file for the original content. In the Python documentation itself you can quickly check.

Link: https://hg.python.org/cpython/file/2.7/Lib/UserDict.py

It is a fact that someone or something changed the contents of the file. And probably many others.

I recommend watching the processes on the machine or what happens after the installation, until the file corruption.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.