Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizer : TypeError: 'NoneType' object is not iterable #5047

Closed
loflol opened this issue Sep 1, 2016 · 2 comments
Closed

Optimizer : TypeError: 'NoneType' object is not iterable #5047

loflol opened this issue Sep 1, 2016 · 2 comments

Comments

@loflol
Copy link

loflol commented Sep 1, 2016

Expected Behavior

The bot with optimizer function stop when it has to decide which pokemon has to evolve.

Actual Behavior

Bot stop with error

Your FULL config.json (remove your username, password, gmapkey and any other private info)

config.json.txt

Output when issue occurred

[2016-09-01 12:02:07] [MainThread] [ cli] [INFO]
[2016-09-01 12:02:07] [MainThread] [ cli] [INFO] Highest CP Pokemon:
[2016-09-01 12:02:07] [MainThread] [ cli] [INFO] Most Perfect Pokemon:
Traceback (most recent call last):
File "pokecli.py", line 781, in
main()
File "pokecli.py", line 139, in main
bot.tick()
File "/Users/lofphotographe/PokemonGo-Bot/pokemongo_bot/init.py", line 662, in tick
if worker.work() == WorkerResult.RUNNING:
File "/Users/lofphotographe/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_optimizer.py", line 95, in work
try_evolve, try_upgrade, keep = self.get_best_pokemon_for_rule(pokemon_list, rule)
File "/Users/lofphotographe/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_optimizer.py", line 241, in get_best_pokemon_for_rule
sorted_pokemon = self.sort_pokemon_list(pokemon_list, rule)
File "/Users/lofphotographe/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_optimizer.py", line 319, in sort_pokemon_list
return sorted(pokemon_list, key=lambda p: self.get_score(p, rule)[0], reverse=True)
File "/Users/lofphotographe/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_optimizer.py", line 319, in
return sorted(pokemon_list, key=lambda p: self.get_score(p, rule)[0], reverse=True)
File "/Users/lofphotographe/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_optimizer.py", line 328, in get_score
for a in rule.get("sort"):
TypeError: 'NoneType' object is not iterable
[2016-09-01 12:02:07] [MainThread] [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/usr/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/usr/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
response = self._open(req, data)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
'_open', req)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
return self.do_open(ValidHTTPSConnection, req)
File "/usr/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1057, in request
self._send_request(method, url, body, headers)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1097, in _send_request
self.endheaders(body)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in endheaders
self._send_output(message_body)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 895, in _send_output
msg += message_body
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
[2016-09-01 12:02:07] [MainThread] [sentry.errors.uncaught] [ERROR] [u"TypeError: 'NoneType' object is not iterable", u' File "pokecli.py", line 781, in ', u' File "pokecli.py", line 139, in main', u' File "pokemongo_bot/init.py", line 662, in tick', u' File "pokemongo_bot/cell_workers/pokemon_optimizer.py", line 95, in work', u' File "pokemongo_bot/cell_workers/pokemon_optimizer.py", line 241, in get_best_pokemon_for_rule', u' File "pokemongo_bot/cell_workers/pokemon_optimizer.py", line 319, in sort_pokemon_list', u' File "pokemongo_bot/cell_workers/pokemon_optimizer.py", line 319, in ', u' File "pokemongo_bot/cell_workers/pokemon_optimizer.py", line 328, in get_score']

Steps to Reproduce

Start bot with pokemons to evole using Optimizer

Other Information

OS: OS X 10.11.6

Branch: dev

Git Commit:

commit d5059ed

Python Version:

Python 2.7.12

Any other relevant files/configs (eg: path files)

Short Description

Possible solution

How it would help others

@dokhed
Copy link

dokhed commented Sep 1, 2016

as the Error...
"[2016-09-01 12:02:07] [MainThread] [ cli] [INFO] Most Perfect Pokemon:
Traceback (most recent call last):....."
the bot stoped when it was trying to run the task "Most Perfect Pokemon"
Did you set the "order_by" section to something else?
Try to use the defult parameter first; like order_by: "cp"

@julienlavergne
Copy link
Contributor

julienlavergne commented Sep 1, 2016

It is strange, your stacktrace does not match the code in the commit you said you are on.
Correction it matches.

@Jcolomar
Yes. However it does not explain the error. It is like the "sort" parameter is missing.

@k4n30 k4n30 closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants