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

PyPDF2 usage problem in pdf_helper 16.0 #842

Open
risto42 opened this issue Oct 28, 2023 · 2 comments
Open

PyPDF2 usage problem in pdf_helper 16.0 #842

risto42 opened this issue Oct 28, 2023 · 2 comments
Labels

Comments

@risto42
Copy link

risto42 commented Oct 28, 2023

Module

pdf_helper in 16.0

Describe the bug

Attempting to activate some edi modules from OCA where an error traceback indicates that pdf_helper
is trying to import PdfReadError from PyPDF2.utils

It does appear that PdfReadError is in PyPDF3.utils, but in PyPDF2 (which is currently used), it is found in .errors.

Additional context
Here's a patch that worked for me:

diff --git a/pdf_helper/models/helper.py b/pdf_helper/models/helper.py
index 52b30355..8dbe8545 100644
--- a/pdf_helper/models/helper.py
+++ b/pdf_helper/models/helper.py
@@ -3,7 +3,7 @@
 # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
 import logging
 
-from PyPDF2.utils import PdfReadError
+from PyPDF2.errors import PdfReadError
 
 from odoo import models
@risto42 risto42 added the bug label Oct 28, 2023
Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 28, 2024
@risto42
Copy link
Author

risto42 commented Apr 28, 2024

This seems to have been fixed by

commit 0329fc52cb36ff963e705ce1db00e1ef6ea6872c
Author: Jacques-Etienne Baudoux <[email protected]>
Date:   Fri Dec 22 15:57:52 2023 +0100

    [FIX] pdf_helper: multi-attachments
    
    Replace code by odoo.tools.pdf

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant