diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-20 12:17:04 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-20 12:17:04 +0200 |
| commit | f26de445e5579913e27ea6a630bcee6d40eefc7d (patch) | |
| tree | 8b8e06be8a9d5fd3c1e5c31634611127446b9948 /odoo/__init__.py | |
| parent | bc6accc5688d3c38a35949751779f808e9c2063f (diff) | |
| parent | 6f55fd65da8c50d36ca97654a920fb075076f125 (diff) | |
[MERGE] forward port branch saas-12.3 up to 6f55fd65da8
Diffstat (limited to 'odoo/__init__.py')
| -rw-r--r-- | odoo/__init__.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/odoo/__init__.py b/odoo/__init__.py index 6bfe00b8499..0080ccd41c9 100644 --- a/odoo/__init__.py +++ b/odoo/__init__.py @@ -63,6 +63,25 @@ if hasattr(time, 'tzset'): time.tzset() #---------------------------------------------------------- +# PyPDF2 hack +# ensure that zlib does not throw error -5 when decompressing +# because some pdf won't fit into allocated memory +# https://docs.python.org/3/library/zlib.html#zlib.decompressobj +# ---------------------------------------------------------- +import PyPDF2 + +try: + import zlib + + def _decompress(data): + zobj = zlib.decompressobj() + return zobj.decompress(data) + + PyPDF2.filters.decompress = _decompress +except ImportError: + pass # no fix required + +#---------------------------------------------------------- # Shortcuts #---------------------------------------------------------- # The hard-coded super-user id (a.k.a. administrator, or root user). |
