[V18.0] PyPDF2 broken on arm64 build

未关闭
#528 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, python

调研方向

首先,在 arm64 上的 V18 Docker 环境中复现该故障,并将其与 V17 Docker 环境进行比较。检查 enterprise/sign/models/sign_template.py 中 _get_pdf_number_of_pages 附近的 PyPDF2 PdfFileReader 调用,然后验证安装包含 PDF 的模块时不会出现所示的 traceback 和 UserError,并且能够成功完成。

由索引模型根据 Issue 内容生成。

描述

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?
主要语言
Dockerfile
星标
1.2k
派生
1.7k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

odoo/docker 的其他 Issue

查看 odoo/docker 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。