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.

Attachment: signature.asc
Description: PGP signature

Reply via email to