Strange Attribute Errors from 'frozen' exe

Lemniscate d_blade8 at hotmail.com
Tue Jan 22 19:57:47 EST 2002


Hi all,
     I'm getting some strange errors from a Python script that I'm
trying to freeze.  Basically, I'm getting weird Attrivute errors, but
they only pop up like 40% of the time (even on absolute identical
runs).  I posted screen captures at
http://www.geocities.com/karim760/Error.doc.

I got the second error after I manually added an import of the re
module.  Please keep in mind that this never occurred in the last 2.5
months that I have been using the Python scripts themselves (as
opposed to an exe).

I looked at the documentation for the Installer, but any problems with
urllib were supposed to be taken care of in the version I have.  Am I
missing something stupid (probably, lol)?  Can somebody help?  I can
send the complete source to anybody who wants it, but it is a bit big
to post here.  Here is the function referred to in StringLoc (see the
pictures of the errors).Thanks a bunch.




""" Find a length of text that follows a link and return it for
whatever purpose you desire"""

import urllib
import string
import re



def findText(PageUrl, StringUrl, StringUrlEnd):
    if PageUrl[0:5] == "http:":
        pageSource = urllib.urlopen(PageUrl).read()
        pageSource = pageSource[pageSource.find(StringUrl):]
        newStr = ''
        newStr += pageSource[:(pageSource.find(StringUrlEnd)+
len(StringUrlEnd))]
        if newStr == '':
            newStr = "No information available"
        return newStr
    else:
        pageSource = "%s" % PageUrl
        pageSource = pageSource[pageSource.find(StringUrl):]
        newStr = ''
        newStr += pageSource[:(pageSource.find(StringUrlEnd)+
len(StringUrlEnd))]
        if newStr == '':
            newStr = "No information available"
        return newStr



More information about the Python-list mailing list