[Zope3-dev] zope.testing.testrunner: issue with
remove_stale_bytecode
Andrew Bennetts
andrew-zope3dev at puzzling.org
Wed Oct 11 12:08:58 EDT 2006
Paul Winkler wrote:
> On Tue, Oct 10, 2006 at 08:13:23PM -0400, Jim Fulton wrote:
[...]
> >
> > See: http://www.python.org/pypi/zope.testing#running-without-source-code
>
> Thanks for the pointer.
> AFAICT the current docs confirm my understanding.
> --usecompiled would be useful if I wanted to run tests in a
> package for which I didn't have source. That's not the case here.
> All I need is -k, --keepbytecode.
>
> I think the current default behavior sucks, but I think changing it
> would just suck differently :-(
The real problem as you noted in your original message is that there's no way to
distinguish between a pyc file that is only intended to be used as a cache of
bytecode for a py file, and a pyc file that is intended to be used standalone.
If by default pyc files were created with a flag that indicated "must have
corresponding .py file", and the python interpreter refused to use such a pyc
file if the corresponding py wasn't present, then there'd be no problem. People
distributing pyc files without source could instruct compile_all or distutils or
whatever to set the flag the other way.
However, given the current situation, I think the current default is the safest.
The surprise you get when a pyc is used that shouldn't have been is typically
nastier (and more likely to happen) than the surprise caused by a pyc-only
directory being cleaned out.
-Andrew.
More information about the Zope3-dev
mailing list