Author sanad
Recipients kamisky, roger.serwy, sanad, terry.reedy
Date 2015-08-02.07:53:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438502000.37.0.776974080205.issue23672@psf.upfronthosting.co.za>
In-reply-to
Content
On the lines of changes proposed by Terry and others in the comments, this is the patch I'm submitting. 

The function _filename_to_unicode() plays the major part in the plot. The function can get two types of filename ,'str' and 'bytes'. When its str, all the astral chars(characters that are outside BMP ) are replaced by the '�'(diamond question mark) character by performing a regex substitution in the return statement.

If the received filename is in the form of b'..' (bytes) or any other encoding ,it is first decoded(as was earlier) into str and before returning, all the out of range Unicode characters are replaced by the '�'(diamond question mark) character .

The effect on behavior is : the 

1.IDLE is able to display correctly,the  filename in the title-bar and in the file open dialog.
2. Any file with name that have astral chars in them are easily imported without any crash.

This is my first patch,please review it ,if any errors found I will correct them and upload again :)
History
Date User Action Args
2015-08-02 07:53:20sanadsetrecipients: + sanad, terry.reedy, roger.serwy, kamisky
2015-08-02 07:53:20sanadsetmessageid: <1438502000.37.0.776974080205.issue23672@psf.upfronthosting.co.za>
2015-08-02 07:53:20sanadlinkissue23672 messages
2015-08-02 07:53:19sanadcreate