Posix: Exec format error

Donn Cave donn at u.washington.edu
Wed Jun 2 17:42:56 CEST 1999

Rolf Wester <WESTER at ilt.fhg.de> writes:
| when doing the following:
| import os
| id=os.fork()
| if id == 0:
|     os.execl("/home/wester/test/test","-d", "indata")
| else:
|     os.wait()
| I get the error message:
| OSError: [Errno 8] Exec format error
| Can aybody tell me how the format should look like?

Probably it should have a first line like

In other words, the format error is in /home/wester/test/test, not
in your Python statements here.  That file needs a code in its first
16 bits, that tells the OS how to execute it.  If that code is "#!",
it also uses the rest of the that line as an interpreter file path.
So I guess your file lacks its interpreter header, though it could
also be a compiled binary from the wrong operating system.

	Donn Cave, University Computing Services, University of Washington
	donn at u.washington.edu

More information about the Python-list mailing list