[Grok-dev] martian scan "bug" (feature?)

Brandon Craig Rhodes brandon at rhodesmill.org
Wed Nov 19 10:48:30 EST 2008


Chris McDonough <chrism at plope.com> writes:

> When martian scans packages (via the ModuleGrokker), eventually it
> winds up scanning modules that are defined via .pyc and .pyo file
> representations that do not have a corresponding .py source file.
> This, at least in my configuration, leads to errors because these are
> typically modules left over after, e.g. a module rename, where the
> "old" .pyc file sticks around even though its source file has changed
> names and has new content.

The logic you suggest for detecting .pyc files seems similar, but I
haven't determined if it's identical, to the logic in

 zope/testing/testrunner.py

in the "zope.testing" module.  Is it wise for every module that needs to
detect and eliminate "stale bytecode", as zope.testing so whimsically
puts it, to have separate logic that needs to be maintained separately?
Could the logic that you have suggested, Chris, and the logic in the
zope.testing module, be somehow refactored into a little common toolkit
so that martian and other Zope packages will all handle stale bytecode
in the same way?

Because we all know how much Grok needs another dependency. :-) Is there
maybe a Zope module we're already using where this logic "really
belongs"?

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Grok-dev mailing list