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

SyntaxError: invalid syntax #10

Open
clach04 opened this issue Oct 11, 2021 · 2 comments
Open

SyntaxError: invalid syntax #10

clach04 opened this issue Oct 11, 2021 · 2 comments

Comments

@clach04
Copy link

clach04 commented Oct 11, 2021

setup.py documents python 2 and 3 support:

Change 8691814 introduces F strings which are a python 3.6+ specific feature

This breaks support for older python versions, including 3.5.3 (which is the current latest version available for Raspberry Pi's Raspbian).

Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyPDF3 import PdfFileReader
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/py/ebook_rename/py35env/lib/python3.5/site-packages/PyPDF3/__init__.py", line 1, in <module>
    from .pdf import PdfFileReader, PdfFileWriter
  File "/root/py/ebook_rename/py35env/lib/python3.5/site-packages/PyPDF3/pdf.py", line 66, in <module>
    from .generic import *
  File "/root/py/ebook_rename/py35env/lib/python3.5/site-packages/PyPDF3/generic.py", line 494
    return NameObject(f"{ss[0]}+{''.join([f'#{c:X}' for c in ss[1].encode()])}")
                                                                              ^
SyntaxError: invalid syntax

Is this a bug or expected? Readme/setup.py would benefit from a update if the later.

@clach04
Copy link
Author

clach04 commented Oct 11, 2021

Meant to tag @TakamiChie in original report.

@captn3m0
Copy link

+1, it would be better setup.py was updated to reflect a Python 3.x requirement.

captn3m0 added a commit to captn3m0/xhtml2pdf that referenced this issue Jan 18, 2022
PyPDF3 declares support for Python2, but its
broken currently: sfneal/PyPDF3#10
luisza pushed a commit to xhtml2pdf/xhtml2pdf that referenced this issue Jan 26, 2022
* Add Python 3.9, 3.10

* switch from PyPDF2 to PyPDF3

* Drop support for Python 2.7

PyPDF3 declares support for Python2, but its
broken currently: sfneal/PyPDF3#10

* Add python 3.x releases to appveyor

* Drop support for <Python 3.6

- PyPDF3 breaks with Python 3.5 or earlier

* Fix and drop unsupported combinations

* Upgrade build image
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