chadwhitacre / lib537

A Python library
0 stars 0 forks source link

poor check for zip-imported modules in restarter.py #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. import something from an egg
2. trigger a restart

What is the expected output? What do you see instead?

Expected: normal restart
Actual: 

Please use labels and text to provide additional information.

This is transfered from Aspen issue 35.

I'd rather implement a positive check than a negative one, because it's
more explicit. My initial implementation is poor, however, checking only
for '/.zip' in the module's __file__. A module loaded from an egg will
instead have '/.egg', e.g. The deterministic check would be:

  loader = getattr(mod, __load__, None)
  if loader is zipimport:
    # then skip the file

To implement this, I'd like to see a test for a zipimported egg in
test_restarter.py, which in turn means creating an egg programatically. If
there are other cases that would cause this error, I'd like to know about them.

Original issue reported on code.google.com by whit537@gmail.com on 12 Jan 2007 at 3:26

GoogleCodeExporter commented 9 years ago
Nevermind, just using Maciek's fix. :-)

r14

Original comment by whit537@gmail.com on 12 Jan 2007 at 9:50