Issue 26 in goobook: not all IM entries have a protocol

0 views
Skip to first unread message

goo...@googlecode.com

unread,
Mar 3, 2011, 9:32:17 AM3/3/11
to goobook...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 26 by rhard...@mitechie.com: not all IM entries have a protocol
http://code.google.com/p/goobook/issues/detail?id=26

What steps will reproduce the problem?

When I query my contacts, _parse_contact break on the IM parsing of my
contact.

Entry (from line 305 of current git code):

for ent in entry.findall(G_NS + 'im'):

>> [('rel', 'http://schemas.google.com/g/2005#other'), ('address', 'AIM:
>> $username')]

The record has no protocol so the splitting of it causes:

Traceback (most recent call last):
File "/home/rharding/src/goobook/bin/goobook", line 9, in <module>
load_entry_point('goobook==1.4.dev', 'console_scripts', 'goobook')()
File "/home/rharding/src/goobook/src/goobook/application.py", line 83, in
main
args.func(config, args)
File "/home/rharding/src/goobook/src/goobook/application.py", line 111,
in do_query
goobk = GooBook(config)
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 59, in
__init__
self.cache.load()
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 242, in
load
self.update()
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 249, in
update
self.contacts = list(self._parse_contacts(gc.fetch_contacts()))
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 326, in
_parse_contacts
yield self._parse_contact(entry)
File "/home/rharding/src/goobook/src/goobook/goobook.py", line 310, in
_parse_contact
contact.im.append((ent.get('address'),
ent.get('protocol').split('#')[-1]))
AttributeError: 'NoneType' object has no attribute 'split'


What version of the product are you using? On what operating system?

goobook 1.4alpha4 on Ubuntu Maverick

Please provide any additional information below.

I'm not 100% sure how this is supposed to work so I'm hesitant to sumbit a
patch that just checks for a protocol before attempting to split it. A
quick search for 'contact.im' only shows it in a print view of contacts.
Not sure if you want a "none", or 'N/A' or what as the output of that.

Let me know if you need any testing/feedback on the issue.

goo...@googlecode.com

unread,
Mar 4, 2011, 2:15:04 PM3/4/11
to goobook...@googlegroups.com
Updates:
Status: Started

Comment #1 on issue 26 by h...@furuvik.net: not all IM entries have a
protocol
http://code.google.com/p/goobook/issues/detail?id=26

I have commited an untested fix to the master branch, it should now
print "Unknown" if there is no protocol.
Please test and let me hear.

goo...@googlecode.com

unread,
Mar 5, 2011, 8:24:07 PM3/5/11
to goobook...@googlegroups.com

Comment #2 on issue 26 by rhard...@mitechie.com: not all IM entries have a
protocol
http://code.google.com/p/goobook/issues/detail?id=26

Tested master and that seems to be working out. Thanks for the update.

goo...@googlecode.com

unread,
Mar 6, 2011, 12:18:22 PM3/6/11
to goobook...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 26 by h...@furuvik.net: not all IM entries have a
protocol
http://code.google.com/p/goobook/issues/detail?id=26

(No comment was entered for this change.)

goo...@googlecode.com

unread,
Mar 7, 2011, 1:08:03 PM3/7/11
to goobook...@googlegroups.com

Comment #4 on issue 26 by h...@furuvik.net: not all IM entries have a
protocol
http://code.google.com/p/goobook/issues/detail?id=26

Issue 27 has been merged into this issue.

Reply all
Reply to author
Forward
0 new messages