Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importlib_metadata dist.files=None causes TypeError: 'NoneType' object is not iterable #5434

Closed
JohannesBuchner opened this issue Jun 11, 2019 · 2 comments

Comments

@JohannesBuchner
Copy link

I am not sure if this is a pytest or importlib_metadata bug, but I get the following exception running pytest (in any directory):

Traceback (most recent call last):
  File "/home/user/.local/bin/pytest", line 11, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 63, in main
    config = _prepareconfig(args, plugins)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 207, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/user/.local/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/user/.local/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/helpconfig.py", line 94, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/user/.local/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/user/.local/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 687, in pytest_cmdline_parse
    self.parse(args)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 895, in parse
    self._preparse(args, addopts=addopts)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 836, in _preparse
    self._consider_importhook(args)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 784, in _consider_importhook
    self._mark_plugins_for_rewrite(hook)
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 806, in _mark_plugins_for_rewrite
    for name in _iter_rewritable_modules(package_files):
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 625, in _iter_rewritable_modules
    for fn in package_files:
  File "/home/user/.local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 803, in <genexpr>
    for file in dist.files
TypeError: 'NoneType' object is not iterable

This can be circumvented by importlib_metadata returning a empty list instead of None. But maybe pytest also wants to add a bug workaround?

pip list says:

absl-py (0.7.1)
adjustText (0.7.3)
ads (0.12.3)
adstex (0.2.2)
alabaster (0.7.8)
apipkg (1.5)
apt-xapian-index (0.47)
argcomplete (1.8.1)
asn1crypto (0.24.0)
astor (0.7.1)
astroid (1.6.0)
astropy (3.1.2)
astroquery (0.3.7)
atomicwrites (1.3.0)
attrs (19.1.0)
autopep8 (1.4.4)
Babel (2.4.0)
backoff (1.8.0)
beautifulsoup4 (4.7.1)
bibtexparser (1.1.0)
bleach (3.1.0)
bottle (0.12.13)
Brlapi (0.6.6)
bxa (2.9)
cairocffi (0.8.0)
certifi (2019.3.9)
cffi (1.12.3)
chardet (3.0.4)
chrome-gnome-shell (0.0.0)
cloudpickle (0.5.2)
colorama (0.4.1)
command-not-found (0.3)
configobj (5.0.6)
corner (2.0.1)
CosmoloPy3 (0.2)
coverage (4.5.3)
coveralls (1.8.0)
cryptography (2.7)
cssselect (1.0.3)
cupshelpers (1.0)
cycler (0.10.0)
cysignals (1.10.2)
Cython (0.29.7)
decorator (4.1.2)
defer (1.0.6)
distro-info (0.18ubuntu0.18.04.1)
docformatter (1.1)
docker (2.5.1)
docker-pycreds (0.2.1)
docopt (0.6.2)
docutils (0.14)
emcee (2.2.1)
entrypoints (0.3)
execnet (1.6.0)
flake8 (3.5.0)
future (0.17.1)
gast (0.2.2)
GetDist (0.3.0)
ginga (2.7.0)
Glances (2.11.1)
google-pasta (0.1.5)
grpcio (1.20.1)
h5py (2.9.0)
healpy (1.10.3)
howdoi (1.1.14)
html5lib (1.0.1)
httplib2 (0.9.2)
httpretty (0.8.10)
hunspell (0.4.1)
hypothesis (3.44.1)
idna (2.8)
imagesize (0.7.1)
importlib-metadata (0.17)
influxdb (4.1.1)
inotify (0.2.10)
ipykernel (4.8.2)
ipython (5.5.0)
ipython-genutils (0.2.0)
ipywidgets (6.0.0)
isort (4.3.4)
jedi (0.11.1)
jeepney (0.4)
Jinja2 (2.10)
joblib (0.11)
jsonschema (2.6.0)
jupyter-client (5.2.2)
jupyter-core (4.4.0)
Keras (2.1.1)
Keras-Applications (1.0.7)
Keras-Preprocessing (1.0.9)
keyring (19.0.2)
keyrings.alt (3.0)
kiwisolver (1.1.0)
language-selector (0.1)
launchpadlib (1.10.6)
lazr.restfulclient (0.13.5)
lazr.uri (1.0.3)
lazy-object-proxy (1.3.1)
llvmlite (0.19.0)
logilab-common (1.4.1)
louis (3.5.0)
lxml (4.3.2)
macaroonbakery (1.1.3)
Mako (1.0.7)
Markdown (3.1)
MarkupSafe (1.0)
matplotlib (3.1.0)
mccabe (0.6.1)
meld (3.18.0)
mininest (0.1)
mistune (0.8.3)
mock (3.0.5)
more-itertools (7.0.0)
mpi4py (2.0.0)
mps-youtube (0.2.8)
nbconvert (5.3.1)
nbformat (4.4.0)
netifaces (0.10.4)
networkx (1.11)
nltk (3.2.5)
nose (1.3.7)
nose-parameterized (0.3.4)
notebook (5.2.2)
notify2 (0.3)
numba (0.34.0)
numexpr (2.6.4)
numpy (1.16.4)
numpydoc (0.7.0)
oauth (1.0.1)
olefile (0.45.1)
packaging (19.0)
pafy (0.5.4)
pandas (0.24.1)
pandocfilters (1.4.2)
parso (0.1.1)
pbr (5.2.1)
pcigale (2018.0.dev0)
pep8radius (0.9.2)
pexpect (4.2.1)
pickleshare (0.7.4)
Pillow (5.1.0)
pip (9.0.1)
pkginfo (1.5.0.1)
pluggy (0.12.0)
ply (3.11)
progressbar (2.3)
prompt-toolkit (1.0.15)
protobuf (3.7.1)
psutil (5.4.2)
py (1.8.0)
pyasn1 (0.4.2)
pycairo (1.16.2)
pycodestyle (2.3.1)
pycparser (2.19)
pycrypto (2.6.1)
pycryptodomex (3.4.7)
pycups (1.9.73)
pydot (1.2.3)
pyflakes (1.6.0)
Pygments (2.4.2)
pygobject (3.26.1)
pyinotify (0.9.6)
pylint (1.8.3)
pymacaroons (0.13.0)
pymultinest (2.7)
PyNaCl (1.1.2)
pyorbital (1.2.0)
pyparsing (2.4.0)
pyperclip (1.7.0)
pyquery (1.4.0)
pyRFC3339 (1.0)
pysmi (0.2.2)
pysnmp (4.4.3)
pystache (0.5.4)
pystan (2.19.0.0)
pytest (4.6.0)
pytest-arraydiff (0.2)
pytest-astropy (0.2.1)
pytest-doctestplus (0.1.2)
pytest-forked (1.0.2)
pytest-html (1.20.0)
pytest-json-report (1.0.3)
pytest-metadata (1.8.0)
pytest-openfiles (0.2.0)
pytest-remotedata (0.3.1)
pytest-xdist (1.28.0)
python-apt (1.6.4)
python-dateutil (2.8.0)
python-debian (0.1.32)
python-gnupg (0.4.1)
python-magic (0.4.16)
pytz (2018.9)
pyxattr (0.6.0)
pyxdg (0.25)
PyYAML (3.12)
pyzmq (16.0.2)
QtAwesome (0.4.4)
qtconsole (4.3.1)
QtPy (1.3.1)
readme-renderer (24.0)
reportlab (3.4.0)
requests (2.22.0)
requests-cache (0.4.13)
requests-toolbelt (0.9.1)
requests-unixsocket (0.1.5)
roman (2.0.0)
rope (0.10.5)
scikit-learn (0.19.1)
scipy (1.3.0)
scour (0.36)
SecretStorage (3.1.1)
setuptools (41.0.1)
simplegeneric (0.8.1)
simplejson (3.13.2)
six (1.12.0)
snakeviz (2.0.0)
soupsieve (1.8)
Sphinx (1.6.7)
spyder (3.2.6)
SQLAlchemy (1.3.4)
ssh-import-id (5.7)
stevedore (1.30.1)
system-service (0.3)
systemd-python (234)
tables (3.4.2)
tap.py (2.5)
tb-nightly (1.14.0a20190301)
tensorboard (1.13.1)
tensorboardX (1.6)
tensorflow (2.0.0a0)
tensorflow-estimator (1.13.0)
termcolor (1.1.0)
terminado (0.7)
testpath (0.3.1)
tf-estimator-nightly (1.14.0.dev2019030115)
Theano (0.9.0)
torch (1.1.0)
tornado (6.0.2)
tqdm (4.32.1)
traitlets (4.3.2)
twine (1.13.0)
ubuntu-drivers-common (0.0.0)
Ubuntu-Make (18.5)
ufw (0.36)
unattended-upgrades (0.1)
uncertainties (2.4.4)
untokenize (0.1.1)
urllib3 (1.25.3)
virtualenv (16.6.0)
virtualenv-clone (0.5.3)
virtualenvwrapper (4.8.4)
wadllib (1.3.2)
wcwidth (0.1.7)
webencodings (0.5.1)
WebOb (1.7.3)
websocket-client (0.44.0)
Werkzeug (0.15.4)
wheel (0.33.1)
wrapt (1.9.0)
xcffib (0.5.1)
xkit (0.0.0)
yapf (0.27.0)
youtube-dl (2019.5.20)
zipp (0.5.1)
zope.interface (4.3.2)
@asottile
Copy link
Member

This has been fixed, just not released: #5389

@asottile
Copy link
Member

try 4.6.3! I just released it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants