[Distutils] Incompatibility issue with setuptools 0.6c7-py2.4 and workingenv-0.6.5-py2.4

Lauri Hallila laurihallila at gmail.com
Mon Oct 8 09:06:05 CEST 2007


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 <laurihallila at gmail.com> wrote:
>
> 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/distutils-sig/attachments/20071008/ae240e17/attachment-0001.htm 


More information about the Distutils-SIG mailing list