-
Notifications
You must be signed in to change notification settings - Fork 553
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
DeprecationWarning: invalid escape sequence #482
Comments
Thanks for reporting this! ... And for your interest in PyMuPDF. |
Where is the attached PDF please? |
Whoops, sorry. Attached. Page three is the errant one. |
ok, thanks, will look at it |
Fixed it I think by using |
Awesome. Thanks! Let me know if you need anything from me testing wise. I assume the reproducer I provided did the trick. |
Yes, thanks again. Your observation also did occur for the "text", "words", "(x)html" and "(raw)dict" variants of |
Hopefully addressed in version 1.16.17 uploaded today. |
Bug description
Calling
Page.getText('blocks')
on PDFs that contain invalid Python escape sequences (e.g.\
) result in the following warnings:This is a warning now but may or may not be an error in Python 3.10.
To Reproduce (mandatory)
Create the following test script and save as
test.py
:Save the attached file locally
Run the script against the file with deprecation warnings enabled:
Expected behavior (optional)
The strings should be marked as rawstring (e.g.
r'\ '
) internally or escaped.Screenshots (optional)
N/A
Your configuration (mandatory)
Additional context (optional)
I did try to fix this myself, but I haven't worked with SWIG (or Python bindings to a C lib) before and got lost. Sorry 😞
The text was updated successfully, but these errors were encountered: