Exception EOFError.

Discussion in 'Python' started by Dr. Pastor, Sep 4, 2006.

  1. Dr. Pastor

    Dr. Pastor Guest

    Python 2.5b3 on Windows XP.

    (exception EOFError
    Raised when one of the built-in functions (input() or
    raw_input()) hits an end-of-file condition (EOF) without reading any data.)

    For me, raw_input (hit enter) returns an empty string!
    (>>> x=raw_input()

    >>> x

    ''
    >>> )


    Any confirmation?
    Regards.

    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
     
    Dr. Pastor, Sep 4, 2006
    #1
    1. Advertising

  2. On Sun, 03 Sep 2006 17:38:13 -0700, "Dr. Pastor" <>
    declaimed the following in comp.lang.python:

    > Python 2.5b3 on Windows XP.
    >
    > (exception EOFError
    > Raised when one of the built-in functions (input() or
    > raw_input()) hits an end-of-file condition (EOF) without reading any data.)
    >
    > For me, raw_input (hit enter) returns an empty string!


    <Enter> is not an EOF condition, it's a character signaling EOL, and
    returns everything up to that point.

    C:\Documents and Settings\Dennis Lee Bieber>python
    ActivePython 2.4.3 Build 12 (ActiveState Software Inc.) based on
    Python 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> x = raw_input()

    ^Z
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    EOFError
    >>>


    The above is windows, I believe Linux uses <ctrl-d> instead of <ctrl-z>
    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
     
    Dennis Lee Bieber, Sep 4, 2006
    #2
    1. Advertising

  3. Dr. Pastor

    Dr. Pastor Guest

    Thank you Sir.

    Dr. Pastor wrote:
    > Python 2.5b3 on Windows XP.
    >
    > (exception EOFError
    > Raised when one of the built-in functions (input() or
    > raw_input()) hits an end-of-file condition (EOF) without reading any data.)
    >
    > For me, raw_input (hit enter) returns an empty string!
    > (>>> x=raw_input()
    >
    > >>> x

    > ''
    > >>> )

    >
    > Any confirmation?
    > Regards.
    >
    > ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
    > News==----
    > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
    > Newsgroups
    > ----= East and West-Coast Server Farms - Total Privacy via Encryption =----


    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
     
    Dr. Pastor, Sep 4, 2006
    #3
  4. Dennis Lee Bieber enlightened us with:
    > The above is windows, I believe Linux uses <ctrl-d> instead of
    > <ctrl-z>


    That's correct. And so do all unix systems including MacOS X.

    Sybren
    --
    Sybren Stüvel
    Stüvel IT - http://www.stuvel.eu/
     
    Sybren Stuvel, Sep 4, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Bear

    EOFError not getting raised

    David Bear, Jun 10, 2005, in forum: Python
    Replies:
    2
    Views:
    431
  2. Rex Eastbourne

    Mysterious EOFError

    Rex Eastbourne, Apr 9, 2006, in forum: Python
    Replies:
    3
    Views:
    982
    Dennis Lee Bieber
    Apr 9, 2006
  3. Jon Bowlas

    ftplib returns EOFError

    Jon Bowlas, May 19, 2008, in forum: Python
    Replies:
    0
    Views:
    312
    Jon Bowlas
    May 19, 2008
  4. Mihir Patel

    EOFError: EOF when reading a line

    Mihir Patel, Mar 11, 2010, in forum: Python
    Replies:
    1
    Views:
    1,832
    Gabriel Genellina
    Mar 12, 2010
  5. Alex van der Spek

    EOFError with fileinput

    Alex van der Spek, Aug 16, 2010, in forum: Python
    Replies:
    5
    Views:
    561
    Alex van der Spek
    Aug 17, 2010
Loading...

Share This Page