Questions tagged [eoferror]

The Python `EOFError` exception.

In Python, an EOFError is raised in, among other situations:

  1. when one of the built-in functions input() or raw_input() (Python 2.x only) hits an end-of-file condition (EOF) without reading any data
  2. when the pickle module encounters an EOF in its input.

A contrived example would be running the input() function and pressing Ctrl+D (the EOF character) in IDLE, which raises an error similar to:

Traceback (most recent call last):
  File "<pyshell#23>", line 1, in <module>
    input()
EOFError: EOF when reading a line
154 questions
13
votes
2 answers

What is an EOFError in Ruby file I/O?

The official documentation doesn't specify. I understand EOFError means "End of file error", but what exactly does that mean? If a file reader reaches the end of a file, that doesn't sound like an error to me.
Tony
  • 18,776
  • 31
  • 129
  • 193
11
votes
1 answer

python 2.6 cPickle.load results in EOFError

I use cPickle to pickle a list of integers, using HIGHEST_PROTOCOL, cPickle.dump(l, f, HIGHEST_PROTOCOL) When I try to unpickle this using the following code, I get an EOFError. I tried 'seeking' to offset 0 before unpickling, but the error…
fsm
  • 407
  • 2
  • 7
  • 19
8
votes
1 answer

MultiProcessing Pipe recv blocks even when child process is defunct

Reading several questions on this topic I understand now that the child process inherits the file descriptors from the parent process. Which will make it more difficult for a child to receive an EOFError when a parent closes the connection. But my…
Vincent Ketelaars
  • 1,069
  • 1
  • 14
  • 35
6
votes
1 answer

raw_input causing EOFError after creating exe with py2exe

After creating an exe from a script with py2exe raw_input() is causing an EOFError. How can I avoid this? File "test.py", line 143, in main raw_input("\nPress ENTER to continue ") EOFError: EOF when reading a line
volting
  • 16,773
  • 7
  • 36
  • 54
6
votes
2 answers

Why does standard input() cause an EOF error

I was solving a problem on HackerRank when I encountered the following problem in my code. I tested it out on my Python (2.7.10) IDLE , and it was working fine. But it showed the following error on HackerRank: Traceback (most recent call last): …
Yajur Tayal
  • 61
  • 1
  • 1
  • 7
6
votes
2 answers

EOFError in python win32com

I am running Sympathy for Data, a program based on python. It worked well until today. I got error message like this: File "..\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in import gencache File…
NAX
  • 139
  • 1
  • 7
6
votes
0 answers

rpyc connection closed by peer

I'm following rpyc tutorials on this page but get EOFError when run this code bgsrv = rpyc.BgServingThread(conn) #creates a bg thread to process incoming events I've searched a lot but didn't find a way to fix this issue. The server and client run…
JohnnyHuo
  • 453
  • 7
  • 13
6
votes
2 answers

Python Pickling Dictionary EOFError

I have several script running on a server which pickle and unpickle various dictionaries. They all use the same basic code for pickling as shown…
jordanskis
  • 257
  • 1
  • 4
  • 11
5
votes
4 answers

EOFError in Python script

I have the following code fragment: def database(self): databasename="" host="" user="" password="" try: self.fp=file("detailing.dat","rb") except IOError: self.fp=file("detailing.dat","wb") …
user46646
  • 153,461
  • 44
  • 78
  • 84
5
votes
1 answer

Getting EOFError along with exceptions when using ftplib

I'm looking into using ftplib (and possibly ftputil) for doing some automated FTP file syncing. I have a couple of servers to test this against at the moment, but, whilst I'm having a successful conversation with both servers, I get EOFError-s with…
bdeniker
  • 995
  • 1
  • 9
  • 21
5
votes
1 answer

Python SSH Paramiko EOFError

I have just simple script like that to connect via SSH on Nokia router and execute command "show time": import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('adres ip', port=22,…
5
votes
5 answers

EOF Error in python Hackerrank

Trying to solve a problem but the compiler of Hackerrank keeps on throwing error EOFError while parsing: dont know where is m i…
imshashi17
  • 177
  • 1
  • 3
  • 12
5
votes
1 answer

python multiprocessing queue error

I have this python code to read a file, do some processing and write the results in parallel: def line_chunker(path): """ Reads a file in chunks and yields each chunk. Each chunk is guaranteed to end at a carriage return (EOL). Each…
jramm
  • 6,415
  • 4
  • 34
  • 73
5
votes
1 answer

How to Handle EOFError for raw_input() in python in Mac OS X

My python program has two calls to raw_input() The first raw_input() is to take multiline input from the user. The user can issue Ctrl+D (Ctrl+Z in windows) for the end of input. Second raw_input() should take another input from user with (y/n)…
abhiomkar
  • 4,548
  • 7
  • 29
  • 24
4
votes
1 answer

Pickle: Reading a dictionary, EOFError

I recently found out about pickle, which is amazing. But it errors on me when used for my actual script, testing it with a one item dictionary it worked fine. My real script is thousands of lines of code storing various objects within maya into it.…
Jared
  • 537
  • 2
  • 6
  • 14
1
2 3
10 11