When running ghunt email with flag --json gets error about photo not being defined.
To Reproduce
ghunt email someuser@gmail.com --json output.json
Expected behavior
Should return json, but CLI command stops due to error.
Traceback
[-] No public Google Calendar.
Traceback (most recent call last):
File ".../ghunt", line 8, in <module>
sys.exit(main())
File ".../ghunt/ghunt.py", line 18, in main
parse_and_run()
File ".../ghunt/cli.py", line 63, in parse_and_run
process_args(args)
File ".../ghunt/cli.py", line 73, in process_args
asyncio.run(email.hunt(None, args.email_address, args.json))
File ".../ghunt/modules/email.py", line 142, in hunt
"photos": photos,
NameError: name 'photos' is not defined
System (please complete the following information):
- GHunt version: 2.3.4 (Spider Edition)
- Python: 3.14.0
- OS: macOS
Root cause
In ghunt/modules/email.py, the hunt() function references photos and reviews
in the JSON output block (line ~142), but neither variable is ever assigned.
gmaps.get_reviews() only returns (err, stats).
# line ~117
err, stats = await gmaps.get_reviews(as_client, target.personId)
# line ~141 — photos and reviews are undefined here
"maps": {
"photos": photos, # NameError
"reviews": reviews, # NameError
"stats": stats
},
Suggested fix
Add defaults after the gmaps.get_reviews() call:
err, stats = await gmaps.get_reviews(as_client, target.personId)
gmaps.output(err, stats, target.personId)
photos = None # not yet fetched; see commented-out loop below
reviews = None
When running ghunt email with flag --json gets error about photo not being defined.
To Reproduce
ghunt email someuser@gmail.com --json output.json
Expected behavior
Should return json, but CLI command stops due to error.
Traceback
System (please complete the following information):
Root cause
In
ghunt/modules/email.py, thehunt()function referencesphotosandreviewsin the JSON output block (line ~142), but neither variable is ever assigned.
gmaps.get_reviews()only returns(err, stats).Suggested fix
Add defaults after the
gmaps.get_reviews()call: