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

[eml] Traceback when using the x command to extract entries without a filename #2376

Open
frosencrantz opened this issue Apr 9, 2024 · 1 comment
Labels

Comments

@frosencrantz
Copy link
Contributor

Small description
In an eml file I get a traceback when using the x command to extract entries without a filename

Expected result
File is extracted or asks for a filename to use.

Actual result with screenshot

https://asciinema.org/a/HENigRDqV7EOsvf6TM6uN1DAg

Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/visidata/basesheet.py", line 211, in execCommand
escaped = super().execCommand2(cmd, vdglobals=vdglobals)
File "/usr/lib/python3.9/site-packages/visidata/extensible.py", line 79, in wrappedfunc
r = oldfunc(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/visidata/basesheet.py", line 76, in execCommand2
exec(code, vdglobals, LazyChainMap(vd, self))
File "extract-part", line 1, in <module>
'VisiData: a curses interface for exploring and arranging tabular data'
File "/usr/lib/python3.9/site-packages/visidata/_open.py", line 23, in inputPath
return Path(vd.inputFilename(*args, **kwargs))
File "/usr/lib/python3.9/site-packages/visidata/_open.py", line 18, in inputFilename
return vd.input(prompt, type="filename", *args, completer=completer, **kwargs).strip()
File "/usr/lib/python3.9/site-packages/visidata/_input.py", line 543, in input
ret = vd.editText(y, promptlen, w=w,
File "/usr/lib/python3.9/site-packages/visidata/_input.py", line 376, in editText
v = type(starting_value)(v)
TypeError: NoneType takes no arguments

Steps to reproduce with sample data and a .vd

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 x command for entries without a filename. I think it would be useful if when diving into a row, that it would open the file in VisiData, so you can read html files or other data files it contains.

vd  https://raw.githubusercontent.com/guardian/grid/c7ed800a97eeed21251a915d193683b7668a6377/dev/config/usages.eml https://raw.githubusercontent.com/phiresky/ripgrep-all/179f7cb5ceb63eee7de1abbdde2b44e7fa7d100e/exampledir/mail_nested.eml

Additional context
Please include the version of VisiData and Python. Head version of VisiData around Feb 23

@frosencrantz
Copy link
Contributor Author

First reported in #2312

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

No branches or pull requests

1 participant