refextract
refextract copied to clipboard
SyntaxError: invalid syntax using python 3.5
Hi,
I tried refextract
using python 3.5, but it appears not to be compatible due to the fact that python 3.5 does not have raw unicode as they are unicode by default (see http://stackoverflow.com/a/27482285/108301). A suggested fix would be to use the u
function from six
.
Traceback (most recent call last):
File "cli.py", line 1, in <module>
from refextract import extract_references_from_file
File "C:\Python35\lib\site-packages\refextract\__init__.py", line 28, in <module>
from .references.api import (
File "C:\Python35\lib\site-packages\refextract\references\api.py", line 37, in <module>
from .engine import (get_kbs,
File "C:\Python35\lib\site-packages\refextract\references\engine.py", line 166
re_report = re.compile(ur'^(?P<name>[A-Z-]+)(?P<nums>[\d-]+)$', re.UNICODE)
SyntaxError: invalid syntax
Hi @tomzx thanks for pointing that out! We are not yet actively targeting Python 3.x in INSPIRE so we haven't yet tackled this aspect. However if meanwhile you wish to send in a PR to fix this particular issue you are more than welcome.
Hi @tomzx, thanks a lot for reporting this issue. I see this answers the question I had in https://github.com/inspirehep/refextract/pull/7#issuecomment-241872036.
I fully confirm what @kaplun is saying: we haven't yet began tackling porting INSPIRE to Python 3, so I can't see any of us working on this soon. If you need this you're welcome to submit a PR and we'll merge it ASAP.