Bugs item #1263656, was opened at 2005-08-18 22:35
Message generated for change (Comment added) made by bsherwood
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1263656&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Bruce Sherwood (bsherwood)
Assigned to: Nobody/Anonymous (nobody)
Summary: IDLE on Mac

Initial Comment:
Copying code from some browsers into IDLE on the Mac
can leave the file with only \r (13) at the ends of
lines (Safari doesn't seem to have this problem). Then
checksyntax() in ScriptBinding.py fails to convert
these into \n (10), and compile() fails. The effect is
that a program which Python is willing to run gets a
syntax error in IDLE. I think the fix is in
checksyntax() to add after

source = re.sub(r"\r\n", "\n", source)

the following statement, which converts unaccompanied
\r's into \n's::

source = re.sub(r"\r", "\n", source)

I've tried this and it works, but someone with a better
overview of end-of-line issues in Python should think
through whether this is the appropriate fix.

----------------------------------------------------------------------

>Comment By: Bruce Sherwood (bsherwood)
Date: 2005-08-19 12:16

Message:
Logged In: YES 
user_id=34881

I should have said that this is in the environment of
running IDLE on Mac OSX 10.4 under X11, using the fink
distribution. I should also say that there seem to be issues
not only of compiling but also of editing/display. In a
browser, click on a .py file, select all the text, copy,
paste into IDLE. With Safari, it looks right and it runs.
With NetScape, it displays all on one line, and it doesn't
run (syntax error). I haven't studied the actual code to see
what if anything IDLE does to attempt to detect the nature
of text pasted into an edit window, but clearly it's
different coming from two popular browsers.

----------------------------------------------------------------------

Comment By: Bruce Sherwood (bsherwood)
Date: 2005-08-19 00:23

Message:
Logged In: YES 
user_id=34881

A footnote: Now I don't understand why the substitution
searches for r"\r\n", since this would seem to be the raw
string which represents slash, r, slash, n, not the
two-character string "\r\n"....??

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1263656&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to