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

[V18.0] PyPDF2 broken on arm64 build #528

Open
PieterPaulussen opened this issue Nov 19, 2024 · 1 comment
Open

[V18.0] PyPDF2 broken on arm64 build #528

PieterPaulussen opened this issue Nov 19, 2024 · 1 comment

Comments

@PieterPaulussen
Copy link

Odoo V18 is broken when installing a module that uses the PyPDF2 library.
Validated this against the V17 docker and it works for that version.

The following traceback appears:

web-1  | Traceback (most recent call last):
web-1  |   File "/app/enterprise/sign/models/sign_template.py", line 201, in _check_pdf_data_validity
web-1  |     self._get_pdf_number_of_pages(base64.b64decode(datas))
web-1  |   File "/app/enterprise/sign/models/sign_template.py", line 168, in _get_pdf_number_of_pages
web-1  |     file_pdf = PdfFileReader(io.BytesIO(pdf_data), strict=False, overwriteWarnings=False)
web-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1  |   File "/usr/local/lib/python3.12/site-packages/PyPDF2/_reader.py", line 1971, in __init__
web-1  |     super().__init__(*args, **kwargs)
web-1  | TypeError: PdfReader.__init__() got an unexpected keyword argument 'overwriteWarnings'
web-1  |
web-1  | During handling of the above exception, another exception occurred:
web-1  |
web-1  | Traceback (most recent call last):
web-1  |   File "/app/odoo/odoo/tools/convert.py", line 537, in _tag_root
web-1  |     f(rec)
web-1  |   File "/app/odoo/odoo/tools/convert.py", line 437, in _tag_record
web-1  |     record = model._load_records([data], self.mode == 'update')
web-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1  |   File "/app/odoo/odoo/models.py", line 5451, in _load_records
web-1  |     records = self._load_records_create([data['values'] for data in to_create])
web-1  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1  |   File "/app/odoo/odoo/models.py", line 5355, in _load_records_create
web-1  |     records = self.create(vals_list)
web-1  |               ^^^^^^^^^^^^^^^^^^^^^^
web-1  |   File "<decorator-gen-66>", line 2, in create
web-1  |   File "/app/odoo/odoo/api.py", line 480, in _model_create_multi
web-1  |     return create(self, arg)
web-1  |            ^^^^^^^^^^^^^^^^^
web-1  |   File "/app/enterprise/sign/models/sign_template.py", line 121, in create
web-1  |     self._check_pdf_data_validity(attachment.datas)
web-1  |   File "/app/enterprise/sign/models/sign_template.py", line 203, in _check_pdf_data_validity
web-1  |     raise UserError(_("One uploaded file cannot be read. Is it a valid PDF?"))
web-1  | odoo.exceptions.UserError: One uploaded file cannot be read. Is it a valid PDF?
@schwahue
Copy link

Hey @PieterPaulussen, you could try installing pypdf. PyPDF2 has gone back to its root with pypdf.

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

No branches or pull requests

2 participants