I'm having problems debugging some python 3 code. The error is related with a wrong encoding set by the debugger when reading the file being debugged.
I don't know what to do as the encoding is rightly set inside the editor (it says"utf-8"). I have also tested the encoding in other editors and it is correct.
I don't know if this is a bug or a misconfiguration. But to reproduce it:
- create an empty project
- set the interpreter to python3
- create a python file
- set the encoding to utf-8 if not alredy set by default
- write print("Á")
- hit debug
C:\Python31\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 1.1.1\helpers\pydev\pydevd.py" --client 127.0.0.1 --port 56853 --file "C:/test.py"
Connected to pydev debugger (build 101.15)
pydev debugger: starting
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 1.1.1\helpers\pydev\pydevd.py", line 1165, in <module>
debugger.run(setup['file'], None, None)
File "C:\Program Files (x86)\JetBrains\PyCharm 1.1.1\helpers\pydev\pydevd.py", line 936, in run
line = stream.readline() #Should not raise an exception even if there are no more contents
File "C:\Python31\lib\encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 8: character maps to <undefined>
This is VERY ANNOYING. What could I do?
System details: PyCharm 1.1.1, Python 3.1.3, Windows 7