It seems that the message was blocked by moderator because of my e-mail
being too big... I'll just copy-paste how I fixed the problem in
easy_install.py here:
empty_pat = re.compile(r'^[\t ]*\r?$')
comment_pat = re.compile(r'[\t ]*#')
...
if os.path.exists(sitepy):
log.debug("Checking existing site.py in %s", self.install_dir)
f = open(sitepy, 'rb')
current = f.read()
f.close()
distutils_error = False
lines = current.split("\n")
for line in lines:
if empty_pat.match(line) or comment_pat.match(line):
continue
else:
if not line.startswith('def __boot():'):
distutils_error = True
break
if distutils_error:
raise DistutilsError(
"%s is not a setuptools-generated site.py; please"
" remove it." % sitepy
)
On 10/8/07, Lauri Hallila
Hello!
I noticed a small problem in setuptools... workingenv (version 0.6.5-py2.4), in some instances, adds a comment-line "# Duplicating setuptools' site.py..." into the beginning of site.py (workingenv.py , line 1214). Problem is that easy_install.py checks if the existing file site.py starts with "def __boot():", and if it doesn't, it raises an error.
I fixed the problem in my own environment by skipping empty and comment-lines in easy_install.py (fixed file attached).
I just thought to inform you of the problem... feel free to take my fix into setuptools if you like my way to fix the problem.
Best regards, Lauri Hallila