[Python-bugs-list] [ python-Bugs-546913 ] #!/usr/bin/python -u -E doesn't work.
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 22 Apr 2002 05:16:38 -0700
Bugs item #546913, was opened at 2002-04-22 01:46
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=546913&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Rob Landley (landley)
Assigned to: Nobody/Anonymous (nobody)
Summary: #!/usr/bin/python -u -E doesn't work.
Initial Comment:
In linux create an executable file.py with the first
line:
#!/usr/bin/python -u -E
It doesn't matter WHAT the rest of the file is, it
won't work.
If you feed it both of those arguments, the python
interpreter complalins that "-" is an unknown
argument. (?) I tried replacing python with "echo"
and the command line it was getting was "-u -E
./file.py", and "python -u -E ./file.py" works just
fine when I feed that to python from an interactive
bash command line.
Feeding it just "-E" in the #! arguments works fine,
but you can't combine select.poll with file.read(),
and without -u, if you combine os.read() with
file.readline() it takes a 4k chunk out of stdin that
you can't get it to cough back up with a crowbar...
I'm using python 2.2 compiled from source on an
approximately Red Hat 7.2 system, if that makes a
difference. (I checked the ancient python 1.5 that
comes with Red Hat and yup: same bug.)
I am about to go create a bash script for the purpose
of calling the python program in such a way as to not
trigger this bug...
Rob
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-04-22 14:16
Message:
Logged In: YES
user_id=21627
This is not a bug in Python, but a limitation of the
operating system. The system will pass at most one argument
from a #! line; it is an error to specify more than one
argument there. If you use '-uE', it works fine.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=546913&group_id=5470