Expected vs actual behavior
In similar vain to #159 I found another package which does not import properly: spacy.
To Reproduce
Just including import spacy
produces this error for crosshair watch
:
Could not import your code:
Traceback (most recent call last):
File "/path/to/my/conda/env/lib/python3.9/site-packages/crosshair/util.py", line 375, in load_file
return import_module(module_name)
File "/path/to/my/conda/env/lib/python3.9/site-packages/crosshair/util.py", line 343, in import_module
result_module = importlib.import_module(module_name)
File "/path/to/my/conda/env/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/mnt/macx/data/datasets/plan_extraction.py", line 4, in <module>
import spacy
File "/path/to/my/conda/env/lib/python3.9/site-packages/spacy/__init__.py", line 11, in <module>
from thinc.api import prefer_gpu, require_gpu, require_cpu # noqa: F401
File "/path/to/my/conda/env/lib/python3.9/site-packages/thinc/api.py", line 2, in <module>
from .initializers import normal_init, uniform_init, glorot_uniform_init, zero_init
File "/path/to/my/conda/env/lib/python3.9/site-packages/thinc/initializers.py", line 4, in <module>
from .backends import Ops
File "/path/to/my/conda/env/lib/python3.9/site-packages/thinc/backends/__init__.py", line 7, in <module>
from .ops import Ops
File "/path/to/my/conda/env/lib/python3.9/site-packages/thinc/backends/ops.py", line 13, in <module>
from ..util import get_array_module, is_xp_array, to_numpy
File "/path/to/my/conda/env/lib/python3.9/site-packages/thinc/util.py", line 48, in <module>
import tensorflow.experimental.dlpack
File "/path/to/my/conda/env/lib/python3.9/site-packages/tensorflow/__init__.py", line 37, in <module>
from tensorflow.python.tools import module_util as _module_util
File "/path/to/my/conda/env/lib/python3.9/site-packages/tensorflow/python/__init__.py", line 104, in <module>
from tensorflow.python.platform import test
File "/path/to/my/conda/env/lib/python3.9/site-packages/tensorflow/python/platform/test.py", line 20, in <module>
from tensorflow.python.framework import test_util as _test_util
File "/path/to/my/conda/env/lib/python3.9/site-packages/tensorflow/python/framework/test_util.py", line 33, in <module>
from absl.testing import parameterized
File "/path/to/my/conda/env/lib/python3.9/site-packages/absl/testing/parameterized.py", line 218, in <module>
from absl.testing import absltest
File "/path/to/my/conda/env/lib/python3.9/site-packages/absl/testing/absltest.py", line 242, in <module>
get_default_test_tmpdir(),
File "/path/to/my/conda/env/lib/python3.9/site-packages/absl/testing/absltest.py", line 180, in get_default_test_tmpdir
tmpdir = os.path.join(tempfile.gettempdir(), 'absl_testing')
File "/path/to/my/conda/env/lib/python3.9/tempfile.py", line 287, in gettempdir
tempdir = _get_default_tempdir()
File "/path/to/my/conda/env/lib/python3.9/tempfile.py", line 198, in _get_default_tempdir
fd = _os.open(filename, _bin_openflags, 0o600)
File "/path/to/my/conda/env/lib/python3.9/site-packages/crosshair/auditwall.py", line 145, in audithook
handler(event, args)
File "/path/to/my/conda/env/lib/python3.9/site-packages/crosshair/auditwall.py", line 44, in check_open
raise SideEffectDetected(
crosshair.auditwall.SideEffectDetected: We've blocked a file writing operation on "/tmp/znr8t36b". CrossHair should not be run on code with side effects