• Jérome Perrin's avatar
    Fix zodb analyze with empty reports · 8c76eae2
    Jérome Perrin authored
    Fix for this kind of errors:
    
    ```
    (env)$ zodb analyze demo.fs ffffffffffffffff..
    # ø
    Processed 0 records in 0 transactions
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart8/srv/runner/project/zodbtools/env/bin/zodb", line 11, in <module>
        load_entry_point('zodbtools', 'console_scripts', 'zodb')()
      File "/srv/slapgrid/slappart8/srv/runner/project/zodbtools/zodbtools/zodb.py", line 130, in main
        return command_module.main(argv)
      File "/srv/slapgrid/slappart8/srv/runner/project/zodbtools/zodbtools/zodbanalyze.py", line 305, in main
        report(analyze(path, use_dbm, delta_fs, tidmin, tidmax), csv)
      File "/srv/slapgrid/slappart8/srv/runner/project/zodbtools/zodbtools/zodbanalyze.py", line 102, in report
        print "Average record size is %7.2f bytes" % (rep.DBYTES * 1.0 / rep.OIDS)
    ZeroDivisionError: float division by zero
    ```
    
    and also small fixes for python3 compatibility
    
    /reviewed-on nexedi/zodbtools!9
    8c76eae2
Name
Last commit
Last update
zodbtools Loading commit data...
.gitignore Loading commit data...
CHANGELOG.rst Loading commit data...
COPYING Loading commit data...
LICENSE-ZPL.txt Loading commit data...
MANIFEST.in Loading commit data...
README.rst Loading commit data...
setup.py Loading commit data...