[issue23672] IDLE can crash if file name contains non-BMP Unicode characters

2015-08-10 Thread sanad

sanad added the comment:

These observations are noted when the system locale is set to 'iso-88591'

1. Ok, for some reason I'm able to execute this command without any error in 
Linux (idle window is opening with a file name as 'astralE.py'). Because the 
character '피' is automatically being shown and treated as 'E' in both terminal 
and python command line interpreter(similar for chars '풵' = 'z' and '풫' = 'P').

2. But i'm unable to save/make a file with filname 'astral피.py' and hence 
unable to run it. The following errors are thrown then : 

Exception in Tkinter callback
Traceback (most recent call last):
  File /home/sanad/devpy/pessoc/cpython/Lib/tkinter/__init__.py, line 1549, 
in __call__
return self.func(*args)
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/MultiCall.py, line 176, 
in handler
r = l[i](event)
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/IOBinding.py, line 339, 
in save
self.save_as(event)
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/IOBinding.py, line 353, 
in save_as
if self.writefile(filename):
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/IOBinding.py, line 379, 
in writefile
with open(filename, wb) as f:
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001d53c' in 
position 39: ordinal not in range(128)

I'm trying to figure out the root of the problem, feel free to give your inputs

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23672
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23672] IDLE can crash if file name contains non-BMP Unicode characters

2015-08-07 Thread sanad

sanad added the comment:

Hey Terry, after testing the committed patch on my Linux Mint, I have found the 
following behaviour:

1. The issue of IDLE not starting when Recent File list has name outside BMP 
has been fixed.

2. The File Name is correctly formatted and displayed in the file editor window 
title and in the recent file list.(astral chars replaced by diamond question 
mark symbol)

3. Files with astral char names now RUN perfectly.

4. You can create a file with astral char in its name and run it effectively 
and re run it from the recent file list.

PS : since you are unable to test it own windows and many other developers 
might face the same I'm uploading the screenshot of the IDLE windows after the 
patch is applied.
In the given test , I had kept my file name as 피피hello풵My피Name풫.py
and it was displayed as ��hello�My�Name�.py

--
Added file: http://bugs.python.org/file40143/idlerun.png

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23672
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23672] IDLE can crash if file name contains non-BMP Unicode characters

2015-08-02 Thread sanad

sanad added the comment:

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 :)

--
keywords: +patch
nosy: +sanad
Added file: http://bugs.python.org/file40098/issue23672(updated third).patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23672
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23672] IDLE can crash if file name contains non-BMP Unicode characters

2015-08-02 Thread sanad

sanad added the comment:

Correction:

This patch fixes the problem of idle not opening when recent file list has 
filenames outside BMP and the crashing of idle on using filenames with astral 
characters.

The added benefit is that you can create a file with such chars and save it and 
access it again from the Recent Files List.

What this patch doesn't fix is :
1. The File Open Dialog displays the filename incorrectly.
2. The File Open Dialog doesn't allows the file with such filename to be opened.
3. When trying the to run the file with such name, it gives an Traceback to 
Tkinter. The following is the error message :

Exception in Tkinter callback
Traceback (most recent call last):
  File /home/sanad/devpy/pessoc/cpython/Lib/tkinter/__init__.py, line 1549, 
in __call__
return self.func(*args)
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/ScriptBinding.py, line 
124, in run_module_event
return self._run_module_event(event)
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/ScriptBinding.py, line 
145, in _run_module_event
interp.restart_subprocess(with_cwd=False, filename=code.co_filename)
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/PyShell.py, line 502, in 
restart_subprocess
console.write(\n{0} {1} {0}.format(halfbar, tag))
  File /home/sanad/devpy/pessoc/cpython/Lib/idlelib/PyShell.py, line 1294, in 
write
'Non-BMP character not supported in Tk')
UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 49-49: 
Non-BMP character not supported in Tk

Which I guess is another related issue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23672
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24039] Idle: some modal dialogs maximize, don't minimize

2015-07-29 Thread sanad

sanad added the comment:

I have tested all the cases mentioned in the comments on Linux Mint 17.1 
Rebecca 64 bit with Python 3.6.0a0 build version.

1.I reproduced the issue mentioned in #msg241871 the minimize button works 
perfectly fine and the search dialog box does minimizes(Which implies that this 
is a windows only issue).The maximize/expand also works and the dialog window 
can be resized both horizontally and vertically.

2.Similarly, 'Find in Files' and 'Replace' dialogs can also be resized and have 
both maximize and minimize buttons which too work fine.

3.The 'Options' = 'Configure Extensions' dialog does not have the 
maximize/minimize buttons but it can be resized.

4.The 'Options' = 'Configure IDLE' dialog can neither be resized nor does it 
have maximize/minimize buttons.

--
nosy: +sanad

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24039
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24455] IDLE debugger causes crash if not quitted properly before next run

2015-07-21 Thread sanad

sanad added the comment:

I have reviewed the patch(http://bugs.python.org/msg172439) submitted in issue 
#15348 and works very well for solving this  particular issue too. Although I 
have checked it only on Linux but it works arguably fine.

--
nosy: +sanad

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24455
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17311] use distutils terminology in PyPI package display section

2015-07-06 Thread sanad

sanad added the comment:

In an attempt to fix this issue on lines of the criteria given by nick, have 
uploaded my patch . Please review it so that If mistake is there ,I can fix and 
upload corrected patch again. Thanks for your time.

--
keywords: +patch
nosy: +sanad
Added file: http://bugs.python.org/file39876/issue17311.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17311
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com