PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.86k stars 1.54k forks source link

TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>) #2975

Closed seehuily closed 8 years ago

seehuily commented 8 years ago

2016-08-07 19:08:24,969 [ cli] [INFO] Highest CP Pokemon: Weepinbell [CP: 802] [IV: 8/0/0] Potential: 0.18 2016-08-07 19:08:24,969 [ cli] [INFO] Most Perfect Pokemon: Pinsir [CP: 92] [IV: 14/14/12] Potential: 0.89 Traceback (most recent call last): File "pokecli.py", line 502, in main() File "pokecli.py", line 133, in main raise e TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>) 2016-08-07 19:08:24,983 [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/) Traceback (most recent call last): File "C:\Python27\lib\site-packages\raven\transport\threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "C:\Python27\lib\site-packages\raven\transport\http.py", line 47, in send ca_certs=self.ca_certs, File "C:\Python27\lib\site-packages\raven\utils\http.py", line 66, in urlopen return opener.open(url, data, timeout) File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 494, in open response = self._open(req, data) File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 512, in _open '_open', req) File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 466, in _call_chain result = func(*args) File "C:\Python27\lib\site-packages\raven\utils\http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "C:\Python27\lib\site-packages\future\backports\urllib\request.py", line 1284, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "C:\Python27\lib\httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "C:\Python27\lib\httplib.py", line 1093, in _send_request self.endheaders(body) File "C:\Python27\lib\httplib.py", line 1049, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 891, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) 2016-08-07 19:08:24,983 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u' File "pokecli.py", line 502, in ', u' File "pokecli.py", line 133, in main']

seehuily commented 8 years ago

DEV branch, Windows. $ git log -2 commit dee28d9fb1a973b95019bc07fb1e206872bd986d Author: Eli White github@eli-white.com Date: Sun Aug 7 15:58:16 2016 -0700

Rename load_path to load_plugin (#2947)

.

jryd commented 8 years ago

Getting this on - OS: Debian 8 Commit: 5b3fe3d187b6b5fdfdede00f064bf7bcbd5a484d (dev branch) Python: 2.7.9

It happens after running for about 30 minutes.

chadhao commented 8 years ago

same here OS: Ubuntu 14.04

Traceback (most recent call last):
  File "pokecli.py", line 502, in <module>
    main()
  File "pokecli.py", line 133, in main
    raise e
TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)
2016-08-08 13:53:22,578 [sentry.errors] [ERROR] Sentry responded with an error: 'module' object has no attribute 'HTTPSHandler' (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
  File "/root/bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/root/bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/root/bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 44, in urlopen
    class ValidHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'
2016-08-08 13:53:22,579 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u'  File "pokecli.py", line 502, in <module>', u'  File "pokecli.py", line 133, in main']
Happyrain67 commented 8 years ago

same here. Master branch. Debian 8 KALI

After running 7 min or 30 min or 1 hour.

nujabse commented 8 years ago

Same on Archlinux, Dev branch, running for about an hour.

faegan commented 8 years ago

Traceback (most recent call last): File "pokecli.py", line 502, in <module> main() File "pokecli.py", line 133, in main raise e TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>) Happens after about 30 minutes; Windows 10 64-bit, master branch

Happyrain67 commented 8 years ago

is fixed by pgoapi. Update your git src with use "pip install -r requirements.txt".

2874

nujabse commented 8 years ago

Still got the error after updating to the latest pgoapi, bot exited after running an hour.

faegan commented 8 years ago

Same, [ cli] [INFO] Ran for 0:59:56 and crashes (windows 10, 64bit)

Traceback (most recent call last): File "pokecli.py", line 502, in <module> main() File "pokecli.py", line 133, in main raise e TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

mico commented 8 years ago

I've got full traceback!

Traceback (most recent call last):
  File "pokecli.py", line 501, in <module>
    main()
  File "pokecli.py", line 88, in main
    bot.tick()
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/pokemongo_bot/__init__.py", line 395, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/pokemongo_bot/cell_workers/evolve_pokemon.py", line 27, in work
    response_dict = self.api.get_inventory()
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 122, in function
    return request.call()
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 106, in call
    result = self._call()
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 63, in _call
    return PGoApiRequest.call(self)
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 220, in call
    response = request.request(self._api_endpoint, self._req_method_list, self.get_position())
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 126, in request
    request_proto = self._build_main_request(subrequests, player_position)
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 216, in _build_main_request
    request.auth_info.token.contents = self._auth_provider.get_access_token()
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter
    new_value = type_checker.CheckValue(new_value)
  File "/Users/mico/Documents/Projects/PokemonGo-Bot/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue
    raise TypeError(message)
TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)
Happyrain67 commented 8 years ago

Bot Crash again after update pgoapi.... :s

web0net commented 8 years ago

2016-08-08 14:46:33,515 [ cli] [INFO] 2016-08-08 14:46:33,516 [ cli] [INFO] Ran for 0:59:50 2016-08-08 14:46:33,516 [ cli] [INFO] Total XP Earned: 5860 Average: 5876.86/h 2016-08-08 14:46:33,517 [ cli] [INFO] Travelled 1.76km 2016-08-08 14:46:33,517 [ cli] [INFO] Visited 19 stops 2016-08-08 14:46:33,517 [ cli] [INFO] Encountered 16 pokemon, 16 caught, 14 released, 3 evolved, 0 never seen before 2016-08-08 14:46:33,517 [ cli] [INFO] Threw 17 pokeballs 2016-08-08 14:46:33,517 [ cli] [INFO] Earned 1600 Stardust 2016-08-08 14:46:33,517 [ cli] [INFO] 2016-08-08 14:46:33,517 [ cli] [INFO] Highest CP Pokemon: Drowzee [CP: 745] [IV: 12/3/14] Potential: 0.64 2016-08-08 14:46:33,518 [ cli] [INFO] Most Perfect Pokemon: Krabby [CP: 10] [IV: 15/9/14] Potential: 0.84 Traceback (most recent call last): File "pokecli.py", line 503, in main() File "pokecli.py", line 89, in main bot.tick() File "/home/poke/pokemongo_bot/init.py", line 434, in tick if worker.work() == WorkerResult.RUNNING: File "/home/poke/pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work response_dict = self.api.get_inventory() File "/home/poke/src/pgoapi/pgoapi/pgoapi.py", line 122, in function return request.call() File "/home/poke/pokemongo_bot/api_wrapper.py", line 106, in call result = self._call() File "/home/poke/pokemongo_bot/api_wrapper.py", line 63, in _call return PGoApiRequest.call(self) File "/home/poke/src/pgoapi/pgoapi/pgoapi.py", line 220, in call response = request.request(self._api_endpoint, self._req_method_list, self.get_position()) File "/home/poke/src/pgoapi/pgoapi/rpc_api.py", line 126, in request request_proto = self._build_main_request(subrequests, player_position) File "/home/poke/src/pgoapi/pgoapi/rpc_api.py", line 216, in _build_main_request request.auth_info.token.contents = self._auth_provider.get_access_token() File "/usr/local/lib/python2.7/dist-packages/google/protobuf/internal/python_message.py", line 669, in field_setter new_value = type_checker.CheckValue(new_value) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue raise TypeError(message) TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>) 2016-08-08 14:46:33,540 [sentry.errors] [ERROR] Sentry responded with an error: 'module' object has no attribute 'HTTPSHandler' (url: https://app.getsentry.com/api/90254/store/) Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/usr/local/lib/python2.7/dist-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/usr/local/lib/python2.7/dist-packages/raven/utils/http.py", line 44, in urlopen class ValidHTTPSHandler(urllib2.HTTPSHandler): AttributeError: 'module' object has no attribute 'HTTPSHandler' 2016-08-08 14:46:33,540 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u' File "pokecli.py", line 503, in ', u' File "pokecli.py", line 89, in main', u' File "pokemongo_bot/init.py", line 434, in tick', u' File "pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work', u' File "pgoapi/pgoapi.py", line 122, in function', u' File "pokemongo_bot/api_wrapper.py", line 106, in call', u' File "pokemongo_bot/api_wrapper.py", line 63, in _call', u' File "pgoapi/pgoapi.py", line 220, in call', u' File "pgoapi/rpc_api.py", line 126, in request', u' File "pgoapi/rpc_api.py", line 216, in _build_main_request', u' File "usr/local/lib/python2.7/dist-packages/google/protobuf/internal/python_message.py", line 669, in field_setter', u' File "usr/local/lib/python2.7/dist-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue']

Same problem! Debian 7 , Python 2.7

Happyrain67 commented 8 years ago

See #3075.

noncicredo commented 8 years ago

still crashing afte 1 hour. i've tried #3075 but didnt work how can we fix this? thanks

jrjhealey commented 8 years ago

Least recently updated thread, so assuming no longer a problem. Closed.