[ python-Bugs-1503780 ] stdin from directory causes crash (SIGSEGV)

SourceForge.net noreply at sourceforge.net
Sat Jun 10 08:34:45 CEST 2006


Bugs item #1503780, was opened at 2006-06-10 00:03
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1503780&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: Python Interpreter Core
Group: Python 2.4
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: Ben Liblit (liblit)
Assigned to: Nobody/Anonymous (nobody)
Summary: stdin from directory causes crash (SIGSEGV)

Initial Comment:
If standard input is redirected from a directory
instead of a regular file, Python crashes quite early
during startup, before running a single line of the
user's script.

I admit that redirecting from a directory is a weird
thing to do, but even so, Python should respond with
something more useful than a segmentation fault.  In my
particular case, the ideal behavior would be to not
complain at all unless the Python script actually
attempts to read from stdin.

How to reproduce the problem:

    % touch empty.py

    % python -V
    Python 2.4.1

    % python -d -v empty.py

    % python -d -v empty.py </
    Segmentation fault

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

>Comment By: Georg Brandl (gbrandl)
Date: 2006-06-10 06:34

Message:
Logged In: YES 
user_id=849994

This is already fixed in svn:

$ ./python < /
Python error: <stdin> is a directory, cannot continue

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

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


More information about the Python-bugs-list mailing list