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

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

Closed
seehuily opened this issue Aug 8, 2016 · 15 comments

Comments

@seehuily
Copy link
Contributor

seehuily commented Aug 8, 2016

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
Copy link
Contributor Author

seehuily commented Aug 8, 2016

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

Rename load_path to load_plugin (#2947)

.

@jryd
Copy link

jryd commented Aug 8, 2016

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

It happens after running for about 30 minutes.

@chadhao
Copy link

chadhao commented Aug 8, 2016

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
Copy link

same here.
Master branch.
Debian 8 KALI

After running 7 min or 30 min or 1 hour.

@nujabse
Copy link

nujabse commented Aug 8, 2016

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

@faegan
Copy link

faegan commented Aug 8, 2016

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
Copy link

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

@nujabse
Copy link

nujabse commented Aug 8, 2016

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

@faegan
Copy link

faegan commented Aug 8, 2016

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
Copy link

mico commented Aug 8, 2016

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
Copy link

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

@web0net
Copy link

web0net commented Aug 8, 2016

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
Copy link

See #3075.

@noncicredo
Copy link

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

@jrjhealey
Copy link

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

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

10 participants