[albatross-users] unscriptable object

Sheila King sheila at thinkspot.net
Tue Jul 15 04:14:56 EST 2003


--On Monday, July 14, 2003 10:36 AM -0400 "Eric S. Johansson" 
<esj at harvee.org> wrote:

> Sheila King wrote:
>
>> --On Monday, July 14, 2003 9:35 AM -0400 "Eric S. Johansson"
>> <esj at harvee.org> wrote:
>>
>>> Traceback (most recent call last):
>>>    File "/usr/lib/python2.2/site-packages/albatross/app.py", line
>>> 221, in run      self.merge_request(ctx)
>>>    File "/usr/lib/python2.2/site-packages/albatross/app.py", line
>>> 301, in  merge_request
>>>      ctx.merge_request()
>>>    File "/usr/lib/python2.2/site-packages/albatross/context.py",
>>> line 306, in  merge_request
>>>      self.set_value(name, value)
>>>    File "/usr/lib/python2.2/site-packages/albatross/context.py",
>>> line 336, in  set_value
>>>      if name[0] == '_':
>>> TypeError: unsubscriptable object
>>>
>>>
>>>
>>> the Q is where and why?  _ is a legal character and used in other
>>> places.
>>
>>
>> When I have received this error in the past, it is usually because
>> the  object was a None type.
>>
>> I bet that your name sequence is empty (i.e. None). OK, well that
>> is my  guess.
>
> OK, I missing something here.  What name sequence are you talking
> about?

OK, never mind about the "name sequence" nonsense I wrote earlier.

But the error is being caused because whatever is being passed in to 
the set_value function in context.py is an object that cannot be 
referenced by indexes.

That's why it says "unsubscriptable"

I would recommend having your program print out or display somewhere 
what the value of "name" is before it gets to the line where the 
error is occurring. Hopefully that will give you better insight into 
what is occurring. But you can be assured that "name" is not a 
string. Yes, the "_" character is allowed in names, but the object 
that is assigned to "name" at that point in your program is not a 
string type object.

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list