RDFLib/rdflib — Issue #163: SyntaxError in rdflib/plugins/serializers/nt.py with Python 2.4
Author: gjhiggins
Created: 2012-02-20 08:34:09+00:00
State: closed

dan...@gmail.com, 2011-07-28T02:56:34.000Z

What steps will reproduce the problem?
1. Run rdflib-3.1.0 tests with Python 2.4

What is the expected output? What do you see instead?

File "/usr/lib/python2.4/site-packages/rdflib/plugins/serializers/nt.py", line 47
chars.append('\u%04X' % ord(char) if ord(char) <= 0xFFFF else '\U%08X' % ord(char))
^
SyntaxError: invalid syntax

What version of the product are you using? On what operating system?
rdflib 3.1.0 with Python 2.4

Patch attached.

Comment 1 by gromgull
Thanks! I'll apply it - is this really the only thing that is not py2.4 compatible in rdflib? I think we gave up trying to support 2.4 a while back.

Comment 2 by dan...@gmail.com
Our application is still running on Python 2.4 (RHEL5), so I'll be supporting rdflib on Python 2.4 even if the rdflib developers aren't :-)

With this patch applied to 3.1.0 all rdflib tests pass, as do the tests for our application, although we aren't running rdflib 3.1.0 in production yet. We have been using 3.0.0 successfully in production for some time now.

Comment 3 by gromgull
This issue was closed by revision 91ca3aef3477.

Comment 4 by jhz8...@gmail.com
Sorry, new to python. Edited ny.py per patch, re-ran easy_install -U "rdflib>=3.0.0", getting error as if file wasn't edited:

File "/usr/lib/python2.4/site-packages/rdflib-3.1.0-py2.4.egg/rdflib/plugins/serializers/nt.py", line 47
chars.append('\u%04X' % ord(char) if ord(char) <= 0xFFFF else '\U%08X' % ord(char))