[tor-commits] [ooni-probe/master] deal with existing, but empty, reporting.yml

art at torproject.org art at torproject.org
Fri Apr 29 09:42:21 UTC 2016


commit da614dfd225ddf493b6d039111539cce7acf95eb
Author: Simone Basso <bassosimone at gmail.com>
Date:   Thu Nov 5 14:47:13 2015 +0100

    deal with existing, but empty, reporting.yml
    
    Spotted while helping @anadahz to debug lepidopter.
---
 ooni/reporter.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ooni/reporter.py b/ooni/reporter.py
index 5e702bb..a62cb6b 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -404,6 +404,8 @@ class OONIBReportLog(object):
     def get_report_log(self):
         with open(self.file_name) as f:
             report_log = yaml.safe_load(f)
+        if not report_log:
+            report_log = {}  # consumers expect dictionary structure
         return report_log
 
     @property





More information about the tor-commits mailing list