[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit da614dfd225ddf493b6d039111539cce7acf95eb
Author: Simone Basso <bassosimone@xxxxxxxxx>
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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits