From 8c79991ae75e0d7211d1cff8cd6f1f091ef5199d Mon Sep 17 00:00:00 2001 From: Homer S Date: Wed, 30 Jun 2021 21:54:50 +0200 Subject: [PATCH] a['Name'] doesn't get an empty string but type None. So a check for its length led to a failure. --- fritzab2matrix.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fritzab2matrix.py b/fritzab2matrix.py index f470781..78128fa 100755 --- a/fritzab2matrix.py +++ b/fritzab2matrix.py @@ -42,6 +42,7 @@ def main(): message_list_url = message_list['NewURL'] + # Build the url to download the message via smb def build_download_url(mid, tam=0): recording = "rec." + str(tam) + r"." + str(mid).zfill(3) @@ -62,12 +63,13 @@ def main(): messages = xmltodict.parse(doc) return messages + l = get_message_list(message_list_url) - for a in get_message_list(message_list_url)['Root']['Message']: + for a in l['Root']['Message']: # format the information regarding the message msg_info = a['Date'] + " - " + a['Number'] - if len(a['Name']) > 1: + if a['Name']: msg_info += " (" + a['Name'] + ") " # format the string for sound file's meta information