-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
[eml loader] The email loader doesn't import email.parser #2312
Comments
Also, related is this line refers to a global that does not exist https://github.com/saulpw/visidata/blob/develop/visidata/pyobj.py#L165 |
According to https://en.wikipedia.org/wiki/MHTML, the Searching GitHub for sample
Trying to open these files appears broken, even if I try just to use
It looks like https://github.com/saulpw/visidata/blob/develop/visidata/loaders/eml.py#L49, the cursorRow.get_filename() is returning None. |
There is an |
I fixed the import and the other obvious error. I don't know about eml vs mhtml at the moment, I'll have to look into it later. |
Thanks for the fix Saul! I have some additional comments to show how to reproduce the other stack trace I was seeing. Github has .eml files: https://github.com/search?q=path%3A%2F%5C.eml%24%2F&type=code Here are a few:
I still see the error when using the
https://asciinema.org/a/HENigRDqV7EOsvf6TM6uN1DAg
The main comment from https://en.wikipedia.org/wiki/MHTML:
|
I know Wikipedia is always correct. However, even if you don't believe that, the proof is by looking at the sample "mhtml" files on GitHub and see that the VisiData eml loader can read these mhtml files. |
I’m going to close this bug and create two new issues, a FR and a bug based on the last comments from this issue. Thank you for fixing the original issue. |
Small description
The eml loader uses the Python built email.parser module, but does not import it.
Expected result
Load and read MIME messages.
Actual result with screenshot
If you get an unexpected error, please include the full stack trace that you get with
Ctrl-E
.Steps to reproduce with sample data and a .vd
EDIT: add example command:
For this error you do not even need a valid email file or MIME file, since there is a missing
import email.parser
which fails when the code tries to parse the inputAdditional context
Please include the version of VisiData and Python. Latest develop branch. Python 3.9.2
I was able to save a webpage as an MHTML file via my web browser. Since this is an MIME format, I though VisiData could read it. There is a missing import.
Even with the proper import in place, there is another bug that causes the code to not properly open or save individual file content from within the file. I only tried using an mhtml file.
The text was updated successfully, but these errors were encountered: