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

SourceForge.net noreply@sourceforge.net
Sun, 30 Mar 2003 15:59:58 -0800


Bugs item #707576, was opened at 2003-03-21 15: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: Closed
>Resolution: Wont Fix
Priority: 3
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: Chris Withers (fresh)
Date: 2003-03-30 23:59

Message:
Logged In: YES 
user_id=24723

OK :-)

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

Comment By: Tim Peters (tim_one)
Date: 2003-03-27 03:58

Message:
Logged In: YES 
user_id=31435

The only way on Windows is to open a file yourself in text 
mode with buffer size 0, and either write to it directly, or 
set sys.stdout to it.

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

Comment By: Chris Withers (fresh)
Date: 2003-03-26 17:05

Message:
Logged In: YES 
user_id=24723

-u     : unbuffered binary stdout and stderr (also
PYTHONUNBUFFERED=x)

Hmmm... never noticed the binary bit before. 
Is there any way to get unbuffered output without it being
binary?

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

Comment By: Tim Peters (tim_one)
Date: 2003-03-21 16: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