gjhiggins/rdflib — Issue #186: Empty string as argument to rdflib.term.Variable causes an Exception
Author: gjhiggins
Created: 2011-10-19 01:37:09+00:00
State: open

Originally filed by gjhigg...@gmail.com on 2011-09-07T06:01:08

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.