This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: stdin from directory causes crash (SIGSEGV)
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, liblit
Priority: normal Keywords:

Created on 2006-06-10 00:03 by liblit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28762 - (view) Author: Ben Liblit (liblit) Date: 2006-06-10 00:03
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
msg28763 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-06-10 06:34
Logged In: YES 
user_id=849994

This is already fixed in svn:

$ ./python < /
Python error: <stdin> is a directory, cannot continue
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43481
2006-06-10 00:03:35liblitcreate