error with /usr/lib/python2.3/compileall.py: "Sorry invalid mode: U"

M

Marco Herrn

Hi,

I tried to install a package under debian, where in the postinstall
phase some python scripts are called. Then I got the error
"Sorry invalid mode: U".
I looked what this script does and it is the following:

python -O /usr/lib/python2.3/compileall.py /usr/share/woody

I looked where exactly in compileall.py the error occurs and it is here:

try:
print fullname
print None
print dfile
print True
ok = py_compile.compile(fullname, None, dfile, True)
except KeyboardInterrupt:
raise KeyboardInterrupt
except py_compile.PyCompileError,err:
print err.msg
success = 0
except IOError, e:
print "Sorry", e
success = 0

So it obviously runs into the IOError. Then I altered the script to see
what parameters are given to the method py_compile.compile. Here is one
example of it:

fullname: /usr/share/woody/woody_xml.py
None
dfile: None
1

I looked after the permissions on the file
/usr/share/woody/woody_xml.py, it is:

-rw-r--r-- 1 root root

Now I don't have any idea why there is an IOError. Ist it because dfile
is None? What is dfile for? Where can here be the error?

Bye
Marco
 
E

Erwin S. Andreasen

Marco Herrn said:
I tried to install a package under debian, where in the postinstall
phase some python scripts are called. Then I got the error
"Sorry invalid mode: U".
I looked what this script does and it is the following:

python -O /usr/lib/python2.3/compileall.py /usr/share/woody

I think this happens because your "python" is really a link to a
pre-2.3 python. The 'U' option to open appeared in 2.3.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top