[Tutor] about an error message
Abdirizak abdi
a_abdi406@yahoo.com
Tue Apr 29 09:11:51 2003
--0-1738528055-1051621822=:50152
Content-Type: text/plain; charset=us-ascii
Hi I was runing an old version of python program for indexing, I tried to runthe program but it is giving me an error message which is not recognising a certain module, can anyone with experience in previous python versions have a look at this code, and give me what is going onit gives me an error from this line: os.symlink(file, os.path.join(dir, filename)) Also the code had an import statement of module called posix and apparantly it also doesn't recognise that. the above code is from this function: jumper = random.Random()
jumper.seed()
serial = 0
def linkfileinto(dir, file):
while 1:
global serial
serial = serial + 1
filename = str(serial)
try:
# XXX assumes symlink() is atomic
os.symlink(file, os.path.join(dir, filename)) <--- the problem i
return filename
except OSError, err:
err_errno, msg = err
if err_errno == errno.EEXIST:
serial = serial + 10**jumper.randrange(3)
else:
raise
---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
--0-1738528055-1051621822=:50152
Content-Type: text/html; charset=us-ascii
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>I was runing an old version of python program for indexing, I tried to run</DIV>
<DIV>the program but it is giving me an error message which is not recognising a certain module, can anyone with experience in previous python versions have a look at this code, and give me what is going on</DIV>
<DIV>it gives me an error from this line:</DIV>
<DIV><STRONG> os.symlink(file, os.path.join(dir, filename))</STRONG></DIV>
<DIV><STRONG> </STRONG></DIV>
<DIV> Also the code had an import statement of module called<STRONG> posix</STRONG> and apparantly it also doesn't recognise that. </DIV>
<DIV> </DIV>
<DIV> the above code is from this function:</DIV>
<DIV> </DIV>
<DIV>jumper = random.Random()<BR>jumper.seed()<BR>serial = 0<BR>def linkfileinto(dir, file):<BR> while 1:<BR> global serial<BR> serial = serial + 1<BR> filename = str(serial)<BR> try:<BR> # XXX assumes symlink() is atomic<BR> os.symlink(file, os.path.join(dir, filename)) <--- the problem i<BR> return filename<BR> except OSError, err:<BR> err_errno, msg = err<BR> if err_errno == errno.EEXIST:<BR> serial = serial + 10**jumper.randrange(3)<BR> else:<BR> raise<BR></DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com">The New Yahoo! Search</a> - Faster. Easier. Bingo.
--0-1738528055-1051621822=:50152--