Thanks for the nicely reported bug guys. 1. This was indeed a bug and has been introduced indeed in that CL. I was able to reproduce it. 2. The ingest() call was indeed incorrect, though the second value is interpreted as a boolean and that was okay. 3. I also noticed that the duplicated_detect_func people had been asking about isn't being called. I guess it wasn't that desired...
I added unit tests (which I should have done in the first place). https://bitbucket.org/blais/beancount/commits/8d85c80a0c7f4f27fcbcca17dabe11305cea0908 Thank you for the detail, On Wed, Oct 17, 2018 at 4:02 AM Zhuoyun Wei <wzy...@wzyboy.org> wrote: > I encountered this as well. > > Prepending $(pwd) to the shell call does solve the problem but renders > shell auto-completion useless. > > For now, I just added "filename = os.path.abspath(filename)" to the > assert statement where the exception raises. > > > 2018-10-14 20:29:31 shreedharhardi...@gmail.com < > shreedharhardi...@gmail.com>: > > Hi, > > > > In beancount version 2.1.3, bean-identify (and bean-extract) now needs > the input directory to be specified with it's > > full absolute path, or else it gives an error: > > > > > > $ bean-identify config.py input/ > > **** input/History.csv > > Traceback (most recent call last): > > File "/usr/local/bin/bean-identify", line 4, in <module> > > from beancount.ingest.identify import main; main() > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/identify.py", line > 104, in main > > return scripts_utils.trampoline_to_ingest(sys.modules[__name__]) > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/scripts_utils.py", > line 132, in trampoline_to_ingest > > return run_import_script_and_ingest(parser) > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/scripts_utils.py", > line 202, in > > run_import_script_and_ingest > > return ingest(importers_list, abs_downloads) > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/scripts_utils.py", > line 102, in ingest > > args.command(args, parser, importers_list, args.downloads) > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/identify.py", line > 100, in run > > return identify(importers_list, files_or_directories) > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/identify.py", line > 83, in identify > > logfile=logfile): > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/identify.py", line > 60, in find_imports > > file = cache.get_file(filename) > > File > "/usr/local/lib/python3.7/site-packages/beancount/ingest/cache.py", line > 132, in get_file > > "Path should be absolute in order to guarantee a single call.") > > AssertionError: Path should be absolute in order to guarantee a single > call. > > > > This issue is not present in beancount version 2.1.2. > > > > I feel like the bug stems from recent changes in this commit. The full > path is compute in scripts_utils.py:202, but > > then is replaced in the final call in scripts_utils.py:102 by > args.download which doesn't have the full path. (Also > > strangely the function at line 102, expects its second argument as > "detect_duplicates_func", and not a string (or list > > of strings) with file path(s)). Anyway, I hope this helps diagnose it. > > > > I'm not sure of the complexity of the fix, though. A work around is to > call the scripts like follows: > > > > $ bean-identify config.py $(pwd)/input/ > > > > > > Thanks, > > Shreedhar > > > > -- > > You received this message because you are subscribed to the Google > Groups "Beancount" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to > > beancount+unsubscr...@googlegroups.com. > > To post to this group, send email to beancount@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/ > > 709141d5-88a4-444a-acef-94bf43a9b388%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > -- > Zhuoyun Wei > > -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to beancount+unsubscr...@googlegroups.com. > To post to this group, send email to beancount@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/20181017080205.GA29643%40herus.wzyboy.org > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscr...@googlegroups.com. To post to this group, send email to beancount@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhPqEydiANsx9-KPOHBM2SAz2mMpoqDvv%3D61NqTahiKFtQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.