Browse Source

'bozo_exception' isn't always there. add logging.

Steve Thielemann 5 years ago
parent
commit
c051f8a335
2 changed files with 3 additions and 2 deletions
  1. 1 1
      ubuntu.sh
  2. 2 1
      ubuntu_load.py

+ 1 - 1
ubuntu.sh

@@ -4,7 +4,7 @@
 
 rm -f ubuntu.ini
 cd rss
-bin/python ./ubuntu_load.py
+bin/python ./ubuntu_load.py -f -v >> ubuntu.log
 cd ..
 
 if test -f "ubuntu.ini"; then

+ 2 - 1
ubuntu_load.py

@@ -53,7 +53,8 @@ url = 'https://usn.ubuntu.com/rss.xml'
 
 if args.fresh:
     data = feedparser.parse(url)
-    del( data['bozo_exception'])
+    if 'bozo_exception' in data:
+        del( data['bozo_exception'])
 
     with open('rss.json', 'w') as fp:
         json.dump(data, fp)