[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>&nbsp;</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>&nbsp;os.symlink(file, os.path.join(dir, filename))</STRONG></DIV>
<DIV><STRONG>&nbsp; </STRONG></DIV>
<DIV>&nbsp;Also the code had an import statement of module called<STRONG> posix</STRONG> and apparantly it also doesn't recognise that. </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;the above&nbsp;code is from this function:</DIV>
<DIV>&nbsp;</DIV>
<DIV>jumper = random.Random()<BR>jumper.seed()<BR>serial = 0<BR>def linkfileinto(dir, file):<BR>&nbsp;&nbsp;&nbsp; while 1:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; global serial<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial = serial + 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filename = str(serial)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # XXX assumes symlink() is atomic<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.symlink(file, os.path.join(dir, filename)) &lt;--- the problem i<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return filename<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except OSError, err:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err_errno, msg = err<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if err_errno == errno.EEXIST:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial = serial + 10**jumper.randrange(3)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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--