mwhooker / jsonselect

Python implementation of jsonselect (http://jsonselect.org/)
ISC License
26 stars 6 forks source link

Python 3 support #7

Closed progval closed 9 years ago

progval commented 9 years ago

This library does not seem compatible with Python 3.

$ nosetests3 -m '.*_level_1' ./tests/test_conformance.py
E
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (jsonselect.py, line 54))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 414, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.4/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/progval/src/jsonselect/tests/test_conformance.py", line 5, in <module>
    from jsonselect import jsonselect
  File "/home/progval/src/jsonselect/jsonselect/__init__.py", line 8, in <module>
    from .jsonselect import select
  File "/home/progval/src/jsonselect/jsonselect/jsonselect.py", line 54
    (ur"\"([_a-zA-Z]|[^\0-\0177]|\\[^\s0-9a-fA-F])([_a-zA-Z0-9\-]"
                                                                 ^
SyntaxError: invalid syntax

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)
progval commented 9 years ago

Note: I have some experience with porting libraries to Python 3, I may do it myself and send you a pull request soon.