buriy/python-readability

Syntax error while installing using pip3

alandria opened this issue · 3 comments

The problem occurs on Ubuntu 14.04

sudo pip3 install --upgrade readability-lxml
Downloading/unpacking readability-lxml
  Downloading readability-lxml-0.6.2.tar.gz
  Running setup.py (path:/tmp/pip_build_root/readability-lxml/setup.py) egg_info for package readability-lxml
Downloading/unpacking chardet from https://pypi.python.org/packages/b8/74/54fdc2fcfdd46b6c486964b64c5bb7db9a3664033ab25cf11aab06dd2a5d/chardet-3.0.2-py2.py3-none-any.whl#md5=f18688841820b46ecc430aabdc274cde (from readability-lxml)
  Downloading chardet-3.0.2-py2.py3-none-any.whl (133kB): 133kB downloaded
Requirement already up-to-date: lxml in /usr/local/lib/python3.4/dist-packages (from readability-lxml)
Requirement already up-to-date: cssselect in /usr/local/lib/python3.4/dist-packages (from readability-lxml)
Installing collected packages: readability-lxml, chardet
  Running setup.py install for readability-lxml
      File "/usr/local/lib/python3.4/dist-packages/readability/compat/two.py", line 6
        raise exc_type(*args, **kwargs), None, traceback
                                       ^
    SyntaxError: invalid syntax
buriy commented

Could you please try to reproduce it now?

tim77 commented

I still have this issue with latest 5800210 commit when trying to package python-readability for Fedora.

byte-compiling /builddir/build/BUILDROOT/python-readability-lxml-0.7.1-1.20200320git5800210.fc32.x86_64/usr/lib/python3.8/site-packages/readability/encoding.py to encoding.cpython-38.pyc
writing byte-compilation script '/tmp/tmpinwgjcta.py'
/usr/bin/python3 /tmp/tmpinwgjcta.py
  File "/usr/lib/python3.8/site-packages/readability/compat/two.py", line 6
    raise exc_type(*args, **kwargs), None, traceback
                                   ^
SyntaxError: invalid syntax

removing /tmp/tmpinwgjcta.py
running install_egg_info
running egg_info
creating readability_lxml.egg-info
writing readability_lxml.egg-info/PKG-INFO
writing dependency_links to readability_lxml.egg-info/dependency_links.txt
writing requirements to readability_lxml.egg-info/requires.txt
writing top-level names to readability_lxml.egg-info/top_level.txt
writing manifest file 'readability_lxml.egg-info/SOURCES.txt'
reading manifest file 'readability_lxml.egg-info/SOURCES.txt'
writing manifest file 'readability_lxml.egg-info/SOURCES.txt'
Copying readability_lxml.egg-info to /builddir/build/BUILDROOT/python-readability-lxml-0.7.1-1.20200320git5800210.fc32.x86_64/usr/lib/python3.8/site-packages/readability_lxml-0.8-py3.8.egg-info
running install_scripts
  File "/usr/lib/python3.8/site-packages/readability/compat/two.py", line 6
    raise exc_type(*args, **kwargs), None, traceback
                                   ^
SyntaxError: invalid syntax

+ rm -rfv /builddir/build/BUILDROOT/python-readability-lxml-0.7.1-1.20200320git5800210.fc32.x86_64/usr/bin/__pycache__
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-python-bytecompile /usr/bin/python 1 0
Bytecompiling .py files below /builddir/build/BUILDROOT/python-readability-lxml-0.7.1-1.20200320git5800210.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8
*** Error compiling '/builddir/build/BUILDROOT/python-readability-lxml-0.7.1-1.20200320git5800210.fc32.x86_64/usr/lib/python3.8/site-packages/readability/compat/two.py'...
  File "/usr/lib/python3.8/site-packages/readability/compat/two.py", line 6
    raise exc_type(*args, **kwargs), None, traceback
                                   ^
SyntaxError: invalid syntax
tim77 commented

Seems like we need to disable bytecompile here:

%global _python_bytecompile_errors_terminate_build 0