Platform: OS X 10.2.8
Python 2.3 final, running PythonIDE, but I guess the bug is
also in 2.3.2.
In the "Python Interactive" window (characters between
acute brackets to be interpreted by humans):
>>> print "<option-v>"
<square root sign>
>>> print u"<option-v>"
<dialog opens, saying UnicodeEncodeError: ...>
That's not bad, because it cannot be printed in ASCII.
Fine.
But now, at every CR, the dialog opens again!
The same problem when running code in an edit window;
there you get in a state that any print command gives this
error.
I managed to fix it, but I am not so sure this is the right
way to do it.
I changed PyConsole.ConsoleTextWidget.flush:
There are two lines (that are not together, but can safely
be moved together)
self.ted.WEInsert(stuff, None, None)
self._buf = ""
and I replaced this by
try: self.ted.WEInsert(stuff, None, None)
finally: self._buf = ""
The same code occurs in PyConsole.PyOutput.flush(); this
fixes the bug in the other case.
- Jurjen
|