petermr / pygetpapers

a Python version of getpapers
Apache License 2.0
78 stars 9 forks source link

"NoneType object is not iterable" stackdump when 0 hits found #14

Closed petermr closed 3 years ago

petermr commented 3 years ago
(base) pm286macbook:physchem pm286$ pygetpapers -q kbsdcsdcsdck 
INFO: Total Hits are 0
WARNING: Could not find more papers
Traceback (most recent call last):
  File "/opt/anaconda3/bin/pygetpapers", line 8, in <module>
    sys.exit(main())
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 655, in main
    callpygetpapers.handlecli()
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 634, in handlecli
    self.apipaperdownload(args.query, args.limit,
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 452, in apipaperdownload
    self.makecsv(query_result, makecsv=makecsv, makehtml=makehtml)
  File "/opt/anaconda3/lib/python3.8/site-packages/pygetpapers/pygetpapers.py", line 59, in makecsv
    for paper_number, papers in enumerate(searchvariable):
TypeError: 'NoneType' object is not iterable
(base) pm286macbook:physchem pm286$ 
ayush4921 commented 3 years ago

This has already been dealt with in a previous patch. Please update the repo and try again. On my pygetpapers, this is the output: image