#2931 closed defect (somebody else's problem)

allmydata/__init__.py has surprising side-effects

Reported by: exarkun Owned by:
Priority: normal Milestone: undecided
Component: unknown Version: 1.12.1
Keywords: Cc:
Launchpad Bug:

Description

I can't explain what's going on yet but I'm fairly sure that whatever it is, it is bad and should be fixed:

$ python -c 'from twisted.trial._dist.workerreporter import *'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "local/lib/python2.7/site-packages/twisted/trial/_dist/workerreporter.py", line 15, in <module>
    from twisted.trial.reporter import TestResult
  File "local/lib/python2.7/site-packages/twisted/trial/reporter.py", line 29, in <module>
    from twisted.trial.unittest import makeTodo
  File "local/lib/python2.7/site-packages/twisted/trial/unittest.py", line 16, in <module>
    from twisted.trial._asyncrunner import (
  File "local/lib/python2.7/site-packages/twisted/trial/_asyncrunner.py", line 16, in <module>
    from twisted.trial import itrial, reporter
ImportError: cannot import name reporter
$ python -c 'import allmydata; from twisted.trial._dist.workerreporter import *'
$

Supposition: An import of allmydata should have no observable consequences for a subsequent import of any twisted module (or, arguably, any module outside of allmydata).

Change History (1)

comment:1 Changed at 2018-08-01T14:41:58Z by exarkun

  • Resolution set to somebody else's problem
  • Status changed from new to closed

This seems to be down to the difference between:

python -c 'from twisted.trial._dist.workerreporter import *'

and

python -c 'import twisted.trial.unittest; from twisted.trial._dist.workerreporter import *'

Therefore, this is really a Twisted problem and Tahoe-LAFS is just feelings the effects of it.

Note: See TracTickets for help on using tickets.