helwardany / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Feature request: sanitize inbound pasted text #551

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open Python Help, say at module turtle.shape 
2. Copy the text for the shapes "arrow", "turtle", "circle" ... into your 
current module as a list. 
3. Python gives errors because the "smart quotes" from the python docs are not 
sanitized into "regular quotes" that are acceptable to Python.   

What is the expected output? What do you see instead?

I'd like my paste operation into a python editing window to only accept 
characters that are acceptable to Python, or better, to convert if it can. 

What version of the product are you using? On what operating system?
Windows 7, Pyscripter 2.4.1.0, Python 3.1.3.

Please provide any additional information below.
Perhaps it is an editor setting that I missed.  If so, I suggest default 
setting should be to auto-sanitize. 

Original issue reported on code.google.com by cspwc...@gmail.com on 20 Aug 2011 at 4:31

GoogleCodeExporter commented 9 years ago
Here quotes are pasted OK from the Help file.  In any case it is not very easy 
to tell what is a valid character:
- Python 3.x accepts any unicode letter as an identifier
- Inside strings and comments anything character is valid, so one would have to 
do lexical analysis of the pasted string to determine the context of the 
character to determine whether is valid or not.

Original comment by pyscripter on 4 Mar 2012 at 2:04