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

Python ModuleNotFoundError: No module named 'defusedxml' #24

Closed
N4M3Z opened this issue Feb 4, 2018 · 3 comments
Closed

Python ModuleNotFoundError: No module named 'defusedxml' #24

N4M3Z opened this issue Feb 4, 2018 · 3 comments

Comments

@N4M3Z
Copy link

N4M3Z commented Feb 4, 2018

After installing pass-import on OS X High Sierra 10.13.3 (17.4.0 Darwin Kernel Version 17.4.0) and running
> pass import --help
I am getting:

Traceback (most recent call last):
  File "/usr/local/lib/password-store/import/import.py", line 26, in <module>
    from defusedxml import ElementTree
ModuleNotFoundError: No module named 'defusedxml'

This can be of course fixed by simply running

pip install defusedxml

But it would imho be preferable to not have these sorts of dependencies.

@roddhjav
Copy link
Owner

roddhjav commented Feb 4, 2018

Installation requirement (including defusexml) is already detailed in the readme file.

But it would imho be preferable to not have these sorts of dependencies.

I don't know what you mean by "these sorts of dependencies". python-defusedxml is a XML bomb protection for Python stdlib modules. Therefore it offers a better xml parser than the default one. It is a fully legit dependency.

@N4M3Z
Copy link
Author

N4M3Z commented Feb 4, 2018

I meant that it's good practice in Python to have a fallback to the default package if possible. Something like this:

try:
    import simplejson as json
except ImportError:
    import json

This is just a suggestion, feel free to close the issue.

@roddhjav
Copy link
Owner

roddhjav commented Feb 4, 2018

I did it on purpose, the classic xml parser presents security issue. Therefore defusexml is not an optional dependency.

@roddhjav roddhjav closed this as completed Feb 4, 2018
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