No description
Find a file
Gavin D'souza b56e6fe4db fix: Safe decode base64 data in case of incorrect padding
This could possibly happen in case of corrupted/partial files. But for
the most part, if there's a missing trailing = or three at the end too.

Traceback:
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1208, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
    doc.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 239, in insert
    self._validate()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 499, in _validate
    self._extract_images_from_text_editor()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 983, in _extract_images_from_text_editor
    extract_images_from_doc(self, df.fieldname)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 779, in extract_images_from_doc
    content = extract_images_from_html(doc, content)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 822, in extract_images_from_html
    content = re.sub(r']*src\s*=\s*["\'](?=data:)(.*?)["\']', _save_file, content)
  File "/home/frappe/frappe-bench/env/lib/python3.6/re.py", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 814, in _save_file
    _file.save(ignore_permissions=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
    self.run_method("before_insert")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 860, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1158, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1141, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 854, in
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 56, in before_insert
    self.save_file(content=self.content, decode=self.decode)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 436, in save_file
    self.content = base64.b64decode(self.content)
  File "/home/frappe/frappe-bench/env/lib/python3.6/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
2021-12-21 14:57:09 +05:30
.github fix: update docs link checker 2021-12-14 16:31:02 +05:30
cypress test: fixed failing tests 2021-12-20 18:36:52 +05:30
esbuild style: use const instead of let 2021-11-09 13:00:15 +05:30
frappe fix: Safe decode base64 data in case of incorrect padding 2021-12-21 14:57:09 +05:30
.editorconfig chore: extend editorconfig to vue components 2021-08-25 20:12:55 +05:30
.eslintignore fix: Miscellaneous changes (#12343) 2021-02-08 12:05:37 +05:30
.eslintrc fix: Use extend_cscript in make to properly extend functions of class 2021-05-24 09:05:00 +05:30
.flake8 ci: fix semgrep false positives (#13161) 2021-05-12 20:22:48 +05:30
.git-blame-ignore-revs chore: Ignore updating license header from blame 2021-09-03 12:14:45 +05:30
.gitignore chore: VS2022 uses .vs instead of .vscode. Add .vs to .gitignore. 2021-12-13 11:16:11 +11:00
.mergify.yml ci: Update auto-close condition 2021-09-01 12:13:11 +05:30
.pylintrc reactor(scheduler): created "Scheduler Job Type" and cleaned up scheduler 2019-11-07 12:14:09 +05:30
.snyk [Snyk] Fix for 1 vulnerabilities (#11523) 2020-09-17 10:00:48 +05:30
.stylelintrc fix: Miscellaneous changes (#12343) 2021-02-08 12:05:37 +05:30
attributions.md Non Pour Accent! (#5427) 2018-04-10 22:53:42 -08:00
bandit.yml fix(tests): tests and linting 2019-02-13 16:50:34 +05:30
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-09-12 09:14:34 +05:30
codecov.yml chore: correct coverage config 2021-12-14 20:12:51 +05:30
CODEOWNERS chore: Fix CODEOWNERS formatting 2021-11-28 09:57:55 +05:30
cypress.json revert: 'test: Removing cypress ui test retry' 2021-11-09 15:36:56 +05:30
dev-requirements.txt chore: Clean up requirements 2021-11-11 20:56:47 +05:30
generate_bootstrap_theme.js fix: Common sass_options 2021-04-27 11:24:19 +05:30
hooks.md Non Pour Accent! (#5427) 2018-04-10 22:53:42 -08:00
LICENSE chore: Update copyright until date to 2021 2021-09-03 12:19:15 +05:30
Makefile [NEW] Makefile to clean cache without restart 2018-03-08 15:18:32 +05:30
node_utils.js fix: set correct default redis async broker in node_utils 2021-05-21 16:09:43 +05:30
package.json build: Upgrade jQuery 3.5.0 to 3.6.0 2021-11-11 19:08:17 +05:30
README.md chore: Try on FCloud button 2021-10-13 18:41:08 +05:30
requirements.txt chore: Clean up requirements 2021-11-11 20:56:47 +05:30
SECURITY.md chore: updated Security policy and issue template 2019-10-12 12:06:36 +05:30
setup.py fix: Drop support for Python 3.6 2021-09-17 11:24:51 +05:30
sider.yml chore(sider): add sider default config for flake8 + ignore tab errors (W191) (#12587) 2021-03-16 17:07:41 +05:30
socketio.js fix: publish realtime to work with localhost (backport #14174) (#14196) 2021-09-14 12:09:01 +05:30
yarn.lock build: Upgrade jQuery 3.5.0 to 3.6.0 2021-11-11 19:08:17 +05:30


a web framework with "batteries included"

it's pronounced - fra-pay

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for ERPNext

Table of Contents

Installation

Contributing

  1. Code of Conduct
  2. Contribution Guidelines
  3. Security Policy
  4. Translations

Resources

  1. frappeframework.com - Official documentation of the Frappe Framework.
  2. frappe.school - Pick from the various courses by the maintainers or from the community.

License

This repository has been released under the MIT License.