[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

wjssz report at bugs.python.org
Thu Jul 24 16:47:04 CEST 2014


wjssz added the comment:

I wrote this code, but I don't know how to make a patch.

Insert these codes in C:\Python34\Lib\idlelib\IOBinding.py
Around line 234, before this line:
self.text.delete("1.0", "end")


        # check non-bmp characters
        line_count = 1
        position_count = 1
        for char in chars:
            if char == '\n':
                line_count += 1
                position_count = 1
            if ord(char) > 0xFFFF:
                nonbmp_msg = ("IDLE can't display non-BMP characters "
                              "(codepoint above 0xFFFF).\n"
                              "A non-BMP character found at line %d, "
                              "position %d of file %s, codepoint 0x%X.\n"
                              "Please open this file with another editor.")
                tkMessageBox.showerror("non-BMP character",
                                        nonbmp_msg %
                                       (line_count, position_count,
                                        filename, ord(char)),
                                       parent=self.text)
                return False
            position_count += 1

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21084>
_______________________________________


More information about the Python-bugs-list mailing list