wummel / linkchecker

check links in web documents or full websites
http://wummel.github.io/linkchecker/
GNU General Public License v2.0
1.42k stars 234 forks source link

Python 3 SyntaxError from long literal 0x950412deL in po/msgfmt.py #671

Open peterjc opened 8 years ago

peterjc commented 8 years ago

README says "Python 2.7.2 or later is needed." which implies Python 3 should work.

However, installation under Python 3 fails, first problem is at line 82 in file po/msgfmt.py

    output = struct.pack("Iiiiiii",
                         0x950412deL,       # Magic
                         0,                 # Version
                         len(keys),         # # of entries
                         7*4,               # start of key index
                         7*4+len(keys)*8,   # start of value index
                         0, 0)              # size and offset of hash table

This prevent installation under Python 3, e.g.

$ pip3.5 install linkchecker
Collecting linkchecker
  Using cached LinkChecker-9.3.tar.gz
...
  ----------------------------------------
  Failed building wheel for linkchecker
  Running setup.py clean for linkchecker
Failed to build linkchecker
Installing collected packages: linkchecker
  Running setup.py install for linkchecker ... error
    Complete output from command /Users/pjcock/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-build-700dus_5/linkchecker/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-d_khddby-record/install-record.txt --single-version-externally-managed --compile:
    /Users/pjcock/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'app'
      warnings.warn(msg)
    creating /private/var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-build-700dus_5/linkchecker/_LinkChecker_configdata.py
    running install
    running build
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-build-700dus_5/linkchecker/setup.py", line 976, in <module>
        setup(**args)
      File "/Users/pjcock/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/private/var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-build-700dus_5/linkchecker/setup.py", line 476, in run_commands
        super(MyDistribution, self).run_commands()
      File "/Users/pjcock/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/pjcock/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/pjcock/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Users/pjcock/lib/python3.5/distutils/command/install.py", line 539, in run
        self.run_command('build')
      File "/Users/pjcock/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/pjcock/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/private/var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-build-700dus_5/linkchecker/setup.py", line 602, in run
        self.build_message_files()
      File "/private/var/folders/t_/q00rqqr15lg950n1c8r2yxf00000gn/T/pip-build-700dus_5/linkchecker/setup.py", line 592, in build_message_files
        import msgfmt
      File "po/msgfmt.py", line 82
        0x950412deL,       # Magic
                  ^
    SyntaxError: invalid syntax

    ----------------------------------------
cacois commented 7 years ago

+1, just ran into this issue today

DonRichards commented 7 years ago

+1 Same issue today

kelvan commented 7 years ago

Seems to be a doc bug Website: "Python 3 is not yet supported." Nevertheless python3 support should be high priority imho. Is there a similar lib supporting py3?

reagle commented 7 years ago

I had the same problem with python3, and can't install with python2 either.

~$ pip2 install linkchecker
Collecting linkchecker
Requirement already satisfied: requests>=2.2.0 in /usr/local/lib/python2.7/site-packages (from linkchecker)
Installing collected packages: linkchecker
Successfully installed linkchecker-9.3
hom:~$ linkchecker
This program requires Python requests 2.2.0 or later.
...
~$ pip2 show requests
Name: requests
Version: 2.10.0
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: me@kennethreitz.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/site-packages
peterjc commented 7 years ago

@reagle your Python 2 problem is something different, can you open a new issue for that instead?

Update: You are probably seeing https://github.com/wummel/linkchecker/issues/649

reagle commented 7 years ago

@peterjc okay, thanks.

dpalic commented 6 years ago

Thank you for the issue report. Sadly this project is dead, and a new team is around with https://github.com/linkcheck/linkchecker for more details please see: #708 Also please close this issue and report it freshly on the new repo https://github.com/linkcheck/linkchecker/issues if your issue still persists