RDFLib/rdflib — Issue #173: Empty string as argument to rdflib.term.Variable causes an Exception
Author: gjhiggins
Created: 2012-02-20 08:34:23+00:00
State: closed

gjhigg...@gmail.com, 2011-09-07T06:01:08.000Z

What steps will reproduce the problem?

>>> from rdflib.term import Variable
>>> x = Variable(u'')
Traceback (most recent call last):
File "", line 1, in
File "...rdflib/term.py", line 817, in __new__
if value[0]=='?':
IndexError: string index out of range

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

rdflib should probably handle the exception explicitly, assuming that failing to specify a non-empty string as a Variable arg is a usage error.

Comment 1 by gromgull
This issue was closed by revision 8b85de43b187.