[Python-bugs-list] [ python-Bugs-707576 ] -i -u options give SyntaxError on Windows

SourceForge.net noreply@sourceforge.net
Fri, 21 Mar 2003 08:30:33 -0800


Bugs item #707576, was opened at 2003-03-21 10:52
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=707576&group_id=5470

Category: Windows
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Withers (fresh)
Assigned to: Tim Peters (tim_one)
Summary: -i -u options give SyntaxError on Windows

Initial Comment:
C:\>python -i -u
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> print 1
  File "<stdin>", line 1
    print 1
           ^
SyntaxError: invalid syntax
>>>

...and this behaviour continues, no mater what
statement you enter.

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

>Comment By: Tim Peters (tim_one)
Date: 2003-03-21 11:30

Message:
Logged In: YES 
user_id=31435

Why do you call this a bug?  -u forces stdin into binary mode, 
and the Python grammar does not allow \r\n line endings in 
program text (it never has, BTW).  Program text has to come 
from a file opened in text mode on Windows, and what you're 
seeing here is the same as what you'd see if you did

f = open('some_python_program.py', 'rb')
exec f.read()

on Windows.

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

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