kefir500/ghstats

Error on empty release title

jschueller opened this issue · 2 comments

ghstats 1.1.1, python 3.6:

$ ~/.local/bin/ghstats openturns otconda -d
GitHub Download Stats
Author: Alexander Gorishnyak <kefir500@gmail.com>

Downloading openturns/otconda stats...
Downloaded in 0.591s

          ---  ---

         Tag: v1.11rc1
      Author: jschueller
         URL: https://github.com/openturns/otconda/releases/tag/v1.11rc1
Published at: Sun Apr 15 10:42:43 2018

            0 otconda2-1.11rc1-Linux-x86_64.sh
            4 otconda2-1.11rc1-Windows-x86_64.exe
            0 otconda3-1.11rc1-Linux-x86_64.sh
            0 otconda3-1.11rc1-Windows-x86_64.exe
            4 Total
Traceback (most recent call last):
  File "/home/schueller/.local/bin/ghstats", line 11, in <module>
    sys.exit(main_cli())
  File "/home/schueller/.local/lib/python3.6/site-packages/ghstats/ghstats.py", line 349, in main_cli
    return main(user, repo, tag, latest, detail, token, quiet)
  File "/home/schueller/.local/lib/python3.6/site-packages/ghstats/ghstats.py", line 306, in main
    total = get_stats_downloads(stats, quiet or not detail)
  File "/home/schueller/.local/lib/python3.6/site-packages/ghstats/ghstats.py", line 263, in get_stats_downloads
    total += get_release_downloads(release, quiet)
  File "/home/schueller/.local/lib/python3.6/site-packages/ghstats/ghstats.py", line 227, in get_release_downloads
    title = release["name"].encode(encoding, 'ignore').decode(encoding)
AttributeError: 'NoneType' object has no attribute 'encode'

Fixed in 95c45f5 (v1.2.0).

Thank you!