[Patches] [ python-Patches-934971 ] trace.py and CR at EOL

SourceForge.net noreply at sourceforge.net
Sat Apr 17 23:02:59 EDT 2004


Patches item #934971, was opened at 2004-04-14 23:32
Message generated for change (Comment added) made by quiver
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=934971&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Felix Wiemann (felixwiemann)
Assigned to: Skip Montanaro (montanaro)
Summary: trace.py and CR at EOL

Initial Comment:
trace.py has problems with carriage returns on Unix systems
when using the --missing switch:


$ cat -v test.py
print "Hello"^M
print "World!"^M

Note the carriage returns.

$ python test.py
Hello
World!

Works fine.

$ python /usr/lib/python2.3/trace.py --count
--coverdir=. --missing test.py
Hello
World!
Traceback (most recent call last):
  File "/usr/lib/python2.3/trace.py", line 690, in ?
    main()
  File "/usr/lib/python2.3/trace.py", line 687, in main
    results.write_results(missing, summary=summary,
coverdir=coverdir)
  File "/usr/lib/python2.3/trace.py", line 264, in
write_results
    lnotab = find_executable_linenos(filename)
  File "/usr/lib/python2.3/trace.py", line 389, in
find_executable_linenos
    code = compile(prog, filename, "exec")
  File "test.py", line 1
    print "Hello"
                 ^
SyntaxError: invalid syntax

When using trace.py with the --missing switch, it complains
about the carriage returns.


The attached patch fixes the problem.

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

Comment By: George Yoshida (quiver)
Date: 2004-04-18 12:02

Message:
Logged In: YES 
user_id=671362

Hi, Skip.
I've submitted a similar patch before.

patch # 924771 ``work around to compile \r\n file''.
http://www.python.org/sf/924771

Can you review it also?
The problem and the solution is the same as Felix.

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

Comment By: Skip Montanaro (montanaro)
Date: 2004-04-16 12:29

Message:
Logged In: YES 
user_id=44345

Thanks.  Applied to trace.py 1.21.  Will backport to 2.3 branch.


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

Comment By: Felix Wiemann (felixwiemann)
Date: 2004-04-15 00:04

Message:
Logged In: YES 
user_id=1014490

Assigned to montanaro, looks like he is the right one.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=934971&group_id=5470



More information about the Patches mailing list