I am having difficulties as well, I am changing a phone number and it doesnt save even though save sais true and is_authorised is true.
print(("Authorized:", contacts.is_authorized()))
pattern = re.compile('^(0([2346789])|\(0([2346789])\))')
for person in contacts.get_all_people():
if person.full_name != 'David Edson': continue
#print person.full_name
for p in range(len(person.phone)):
t_phone = person.phone[p]
l_phone = list(t_phone)
number = str(l_phone[1])
match = pattern.match(number)
if match:
changed = pattern.sub('+61 %s'%match.group(2),number)
print(number, changed)
l_phone[1] = changed
print l_phone
t_phone = tuple(l_phone)
print t_phone
person.phone[p] = t_phone
print person.phone
print('save:',contacts.save())
with the output like this
('Authorized:', True)
('0408 680 808', '+61 408 680 808')
[u'_$!<Mobile>!$_', '+61 408 680 808']
(u'_$!<Mobile>!$_', '+61 408 680 808')
[(u'_$!<Mobile>!$_', u'0408 680 808')]
('save:', True)