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

Public files not managed #3

Open
madmath03 opened this issue Jun 26, 2019 · 0 comments
Open

Public files not managed #3

madmath03 opened this issue Jun 26, 2019 · 0 comments

Comments

@madmath03
Copy link

Steps:

  • Install ERPNext OCR
  • Go to Erpnext Ocr > OCR Read and save a new read
  • Select any image and save
  • Request to read the image
  • Error occurs with error FileNotFoundError: [Errno 2] No such file or directory: './mylocalsite/files/myrandom_image-500x204.png'

After looking at the folders, the file is actually located at ./mylocalsite/public/files/ and not just ./mylocalsite/files/.

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1032, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 84, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/run_method.py", line 36, in runserverobj
    r = doc.run_method(method)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext_ocr/erpnext_ocr/erpnext_ocr/doctype/ocr_read/ocr_read.py", line 46, in read_image
    im = Image.open(fullpath)
  File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/PIL/Image.py", line 2652, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: './mylocalsite/files/myrandom_image-500x204.png'

Will try to provide a PR for that too.

@madmath03 madmath03 changed the title FileNotFoundError: [Errno 2] No such file or directory: './mylocalsite/files/LOGTGAq-ok-500x204.png' Public files not managed Jun 27, 2019
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

Successfully merging a pull request may close this issue.

1 participant