[V18.0] PyPDF2 broken on arm64 build
Open
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 1.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure in the V18 Docker environment on arm64 and compare it with the V17 Docker environment. Inspect the PyPDF2 PdfFileReader call in enterprise/sign/models/sign_template.py around _get_pdf_number_of_pages, then verify that installing a module with a PDF succeeds without the shown traceback and UserError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100