diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-19 18:57:08 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-19 18:57:08 +0200 |
| commit | 168e54d48850418a6a83f71427e74ed27f66595b (patch) | |
| tree | 375cb46f5d7692623e570ff3347a07d5b25383d9 /odoo/__init__.py | |
| parent | 57fef7c11cea206da4c4919781405913ba1d568f (diff) | |
| parent | 32039b2ab44dd3107c8761187582b6c010f3492c (diff) | |
[MERGE] forward port branch 12.0 up to 32039b2ab44
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). |
