[Distutils] Releasing zc.buildout

Marius Gedminas marius at pov.lt
Sat Mar 14 13:26:54 CET 2009


On Thu, Mar 12, 2009 at 02:44:07PM -0400, Tres Seaver wrote:
> I spoke too soon:  the 'boostrap' failure looks like what I described,
> but another failfure is a doctest which barfs due to a major change in
> exception formatting in Python 2.6.  I tried to get ELLIPSIS to hide the
> differences, but my doctest-fu is to weak:

Doctests have some caveats.

> ------------------------------- 8< ---------------------------
> File
> "/home/tseaver/projects/Zope-CVS/zc.buildout-trunk/src/zc/buildout/tests.py",
> line 1725, in zc.buildout.tests.install_source_dist_with_bad_py
> Failed example:
>     print system(buildout), # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
> Expected:
>     Installing eggs.
>     Getting distribution for 'badegg'.
>     Got badegg 1.
>     Installing bo.
>     Generated script '/sample-buildout/bin/bo'.
>     ...
>     SyntaxError:...'return' outside function...
>     ...
>     SyntaxError:...'return' outside function...
> Got:
>     Installing eggs.
>     Getting distribution for 'badegg'.
>     Got badegg 1.
>     Installing bo.
>     Generated script '/sample-buildout/bin/bo'.
>     SyntaxError: ("'return' outside function",
> ('build/bdist.linux-i686/egg/badegg/scripts/one.py', 2, None, 'return 1/n'))
>     <BLANKLINE>
>     SyntaxError: ("'return' outside function",
> ('/sample-buildout/eggs/tmpSUUYdy/badegg-1-pyN.N.egg/badegg/scripts/one.py',
> 2, None, 'return 1/n'))
>     <BLANKLINE>
> ------------------------------- 8< ---------------------------

Let's look at this again:

>     Generated script '/sample-buildout/bin/bo'.
>     ...
>     SyntaxError:...'return' outside function...

does not match

>     Generated script '/sample-buildout/bin/bo'.
>     SyntaxError: ("'return' outside function",

because of an unfortunate interaction between ELLIPSIS and
NORMALIZE_WHITESPACE.

NORMALIZE_WHITESPACE converts your pattern into

  Generated script '/sample-buildout/bin/bo'. ... SyntaxError:...

and the matched text to

  Generated script '/sample-buildout/bin/bo'. SyntaxError:...

Then ELLIPSIS has a mismatch because even if you substitute the '...'
with an empty string, the pattern wants two spaces where the text has
one.

I tried to report this as
https://bugs.launchpad.net/zope.testing/+bug/126169
once, but was unable to convince Jim that this behaviour trips people
up.  (Also, I did not try to provide a patch to fix the issue.)

HTH,
Marius Gedminas
-- 
This sentence contradicts itself -- no actually it doesn't.
                -- Douglas Hofstadter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090314/470262c2/attachment.pgp>


More information about the Distutils-SIG mailing list