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

UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte #4718

Closed
davidspeijer opened this issue Aug 25, 2016 · 42 comments
Labels

Comments

@davidspeijer
Copy link

davidspeijer commented Aug 25, 2016

Expected Behavior

Bot running.

Actual Behavior

Error message, see traceback below.

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

http://pastebin.com/5X1ZKz2x

Output when issue occurred

http://pastebin.com/M3xHmRmS

Steps to Reproduce

Run the bot

Other Information

OS: CentOS

Branch: latest dev

Git Commit: 9605728

Python Version: Python 2.7.5

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

@balpoint
Copy link

Getting the exact same error output.

@lwq008
Copy link

lwq008 commented Aug 25, 2016

I hit into this and used VPN to resolve it. Looks like to me that my IP address was banned.

@balpoint
Copy link

nope with different IP still gtting this erro.r

@k4n30 k4n30 added the Bug label Aug 25, 2016
@Billy2Kid
Copy link

same probleme

@HerrmannHinz
Copy link

HerrmannHinz commented Aug 25, 2016

same error. debian 8 box on google computing.

2016-08-25 14:04:07,100 [PokemonGoBot] [INFO] [login_started] Login procedure started. Traceback (most recent call last): File "pokecli.py", line 705, in <module> main() File "pokecli.py", line 187, in main report_summary(bot) File "pokecli.py", line 221, in report_summary metrics.capture_stats() File "/opt/PokemonGo-Bot/pokemongo_bot/metrics.py", line 102, in capture_stats response_dict = request.call() File "/opt/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 239, in call result = self._call() File "/opt/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 163, in _call accelerometer_axes=3 File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 533, in init setattr(self, field_name, field_value) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter new_value = type_checker.CheckValue(new_value) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 134, in CheckValue raise ValueError('Value out of range: %d' % proposed_value) ValueError: Value out of range: -146 2016-08-25 14:04:09,729 [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 "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/opt/PokemonGo-Bot/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/lib/python2.7/httplib.py", line 1001, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request self.endheaders(body) File "/usr/lib/python2.7/httplib.py", line 997, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 848, in _send_output msg += message_body File "/opt/PokemonGo-Bot/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-08-25 14:04:09,731 [sentry.errors.uncaught] [ERROR] [u'ValueError: Value out of range: -146', u' File "pokecli.py", line 705, in <module>', u' File "pokecli.py", line 187, in main', u' File "pokecli.py", line 221, in report_summary', u' File "pokemongo_bot/metrics.py", line 102, in capture_stats', u' File "pokemongo_bot/api_wrapper.py", line 239, in call', u' File "pokemongo_bot/api_wrapper.py", line 163, in _call', u' File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 533, in init', u' File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter', u' File "/opt/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 134, in CheckValue'] Thu Aug 25 14:04:09 UTC 2016 Pokebot Stopped.

UPDATE: seems rly like its an IP issue in my case. found out that this IP (google cloud computing) is banned - which makes sense to me lol ;)

@Baconnaise
Copy link

Same error on here. I fired up my VPN and changed IP's to no avail.

@davidspeijer
Copy link
Author

Changing "health_record": true, to "health_record": false, took away some errors.

Now it is just:

Traceback (most recent call last): File "pokecli.py", line 705, in <module> main() File "pokecli.py", line 104, in main bot.start() File "/PokemonGo-Bot/pokemongo_bot/__init__.py", line 109, in start init_inventory(self) File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1219, in init_inventory _inventory = Inventory(bot) File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1086, in __init__ self.refresh() File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1096, in refresh self.update_web_inventory() File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1103, in update_web_inventory json_inventory = json.load(infile) File "/usr/lib64/python2.7/json/__init__.py", line 290, in load **kw) File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 381, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting object: line 1 column 6006 (char 6005)

Changing

{ 
         "type": "UpdateWebInventory",
         "config": {
            "enabled": true
         }
      },

To
{ "type": "UpdateWebInventory", "config": { "enabled": false } },
Doesnt change anything.

@sohje
Copy link
Contributor

sohje commented Aug 25, 2016

@davidspeijer Do you have this file web/inventory-botname.json? If so - whats inside? Can you try to clear it?

@r3pek
Copy link

r3pek commented Aug 25, 2016

@sohje I don't have it.... and yes, same error as OP

@sohje
Copy link
Contributor

sohje commented Aug 25, 2016

@r3pek could you please make file web/inventory-botname_here.json and try again?

@davidspeijer
Copy link
Author

Clearing the file result in:

Traceback (most recent call last):
File "pokecli.py", line 705, in
main()
File "pokecli.py", line 104, in main
bot.start()
File "/PokemonGo-Bot/pokemongo_bot/init.py", line 109, in start
init_inventory(self)
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1219, in init_inventory
_inventory = Inventory(bot)
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1086, in init
self.refresh()
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1096, in refresh
self.update_web_inventory()
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1103, in update_web_inventory
json_inventory = json.load(infile)
File "/usr/lib64/python2.7/json/init.py", line 290, in load
**kw)
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

@r3pek
Copy link

r3pek commented Aug 25, 2016

Nop... same problem. Either with empty file or with empty JSON

2016-08-25 15:54:04,825 [PokemonGoBot] [INFO] Traceback (most recent call last): File "pokecli.py", line 705, in <module> main() File "pokecli.py", line 187, in main report_summary(bot) File "pokecli.py", line 221, in report_summary metrics.capture_stats() File "/root/PokemonGo-Bot/pokemongo_bot/metrics.py", line 102, in capture_stats response_dict = request.call() File "/root/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 239, in call result = self._call() File "/root/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 188, in _call return PGoApiRequest.call(self, signature) TypeError: call() takes exactly 1 argument (2 given) 2016-08-25 15:54:04,905 [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/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/usr/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/usr/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/usr/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/usr/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/usr/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/usr/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/lib/python2.7/httplib.py", line 1057, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1097, in _send_request self.endheaders(body) File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 895, in _send_output msg += message_body File "/usr/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-08-25 15:54:04,913 [sentry.errors.uncaught] [ERROR] [u'TypeError: call() takes exactly 1 argument (2 given)', u' File "pokecli.py", line 705, in <module>', u' File "pokecli.py", line 187, in main', u' File "pokecli.py", line 221, in report_summary', u' File "pokemongo_bot/metrics.py", line 102, in capture_stats', u' File "pokemongo_bot/api_wrapper.py", line 239, in call', u' File "pokemongo_bot/api_wrapper.py", line 188, in _call']

@davidspeijer
Copy link
Author

Removing resulting in

Traceback (most recent call last):
File "pokecli.py", line 705, in
main()
File "pokecli.py", line 104, in main
bot.start()
File "/PokemonGo-Bot/pokemongo_bot/init.py", line 109, in start
init_inventory(self)
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1219, in init_inventory
_inventory = Inventory(bot)
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1086, in init
self.refresh()
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1096, in refresh
self.update_web_inventory()
File "/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1102, in update_web_inventory
with open(web_inventory, "r") as infile:
IOError: [Errno 2] No such file or directory: u'/PokemonGo-Bot/pokemongo_bot/../web/inventory-***.json'

@sohje
Copy link
Contributor

sohje commented Aug 25, 2016

@davidspeijer @r3pek Could you put this into file?

[]

or

{}

Sorry, im not sure about this, just trying to help 👯

@r3pek
Copy link

r3pek commented Aug 25, 2016

@sohje same problem...

@davidspeijer
Copy link
Author

@sohje {} solved it for me... :)

@sohje
Copy link
Contributor

sohje commented Aug 25, 2016

@davidspeijer good ;]

@r3pek
Copy link

r3pek commented Aug 25, 2016

@davidspeijer changed anything else besides adding {} to the file?

@davidspeijer
Copy link
Author

No, my original config is now working without any problems :).

@r3pek
Copy link

r3pek commented Aug 25, 2016

thx.... I open to ideas then ;) this is a fresh install...

@r3pek
Copy link

r3pek commented Aug 25, 2016

OK, mine is fixed too... pgoapi was too old ;)

@r3pek
Copy link

r3pek commented Aug 25, 2016

just an update, occasionally i still get this error.... so, it's not completely solved

@Gobberwart
Copy link
Contributor

I've put in a PR to fix this (create a "default" inventory file if it doesn't already exist). Hopefully that will resolve it.

@r3pek This specific error should only occur if the inventory file doesn't exist. When you say it "occasionally" still happens, is it exactly the same or something different? I'd like to know so I can track/fix any other bugs.

@r3pek
Copy link

r3pek commented Aug 26, 2016

This is what i have at start now (can't start it again, even with "empty" inventory)
http://pastebin.com/yLpVuvA7

@Gobberwart
Copy link
Contributor

@r3pek create inventory file just with [] at the top (nothing else) and restart. Does that work?

@r3pek
Copy link

r3pek commented Aug 26, 2016

@Gobberwart no. same error. with {} or []

@r3pek
Copy link

r3pek commented Aug 26, 2016

Same error as Issue #4380. Just at another place

@Gobberwart
Copy link
Contributor

@r3pek looks like your error is different and not related to inventory json file.

@r3pek
Copy link

r3pek commented Aug 26, 2016

yeah.... same error message though :(

@Gobberwart
Copy link
Contributor

@r3pek I assume you've tried updating requirements? This looks like pgoapi error which might be solved by updating.

Try: pip install -r requirements.txt --upgrade

@r3pek
Copy link

r3pek commented Aug 26, 2016

Nothing to upgrade. Same problem.

On Aug 26, 2016 02:27, "Stuart Travers" [email protected] wrote:

@r3pek https://github.com/r3pek I assume you've tried updating
requirements? This looks like pgoapi error which might be solved by
updating.

Try: pip install -r requirements.txt --upgrade


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4718 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC6MPNTjUgkrWePCss2R5XKiYGt0QziVks5qjkDlgaJpZM4Js3Rf
.

@Gobberwart
Copy link
Contributor

Please paste your most recent output/error

@r3pek
Copy link

r3pek commented Aug 26, 2016

It's the one on the pastebin. Nothing changed.

On Aug 26, 2016 02:39, "Stuart Travers" [email protected] wrote:

Please paste your most recent output/error


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4718 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC6MPBtGxCo1GWiKNMZHOIdCcHAa8xn1ks5qjkPngaJpZM4Js3Rf
.

@Gobberwart
Copy link
Contributor

Hmmm have you got the latest build?

@r3pek
Copy link

r3pek commented Aug 26, 2016

Yes... Running dev branch.

On Aug 26, 2016 02:52, "Stuart Travers" [email protected] wrote:

Hmmm have you got the latest build?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4718 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC6MPEdKPA9FXF3oaSDfbDfmh1GuE80Hks5qjkbDgaJpZM4Js3Rf
.

@hobbes3
Copy link

hobbes3 commented Aug 26, 2016

Latest commit 3622c03 fixes the problem for me.

@r3pek
Copy link

r3pek commented Aug 26, 2016

commit 09403f5 also works

@mjmadsen
Copy link
Contributor

Since the original poster's issue is resolved, I am closing.

@castorfou
Copy link

I have ths issues since last update this morning.
When calling for Most Perfect Pokemon, when starting Bot.

[2016-08-30 10:46:20] [ cli] [INFO] Most Perfect Pokemon: Traceback (most recent call last): File "pokecli.py", line 768, in <module> main() File "pokecli.py", line 119, in main bot = start_bot(bot,config) File "pokecli.py", line 86, in start_bot bot.start() File "/home/guillaume/Applications/PokemonGo-Bot/pokemongo_bot/__init__.py", line 127, in start init_inventory(self) File "/home/guillaume/Applications/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1273, in init_inventory _inventory = Inventory(bot) File "/home/guillaume/Applications/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1111, in __init__ self.refresh() File "/home/guillaume/Applications/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1121, in refresh self.update_web_inventory() File "/home/guillaume/Applications/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1148, in update_web_inventory self.bot.logger.info('[x] Error while opening inventory file for read: %s' % e, 'red') NameError: global name 'e' is not defined [2016-08-30 10:46:20] [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 "/home/guillaume/.local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/home/guillaume/.local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/home/guillaume/.local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/home/guillaume/.local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/home/guillaume/.local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/home/guillaume/.local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/home/guillaume/.local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/home/guillaume/.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/lib/python2.7/httplib.py", line 1057, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1097, in _send_request self.endheaders(body) File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders self._send_output(message_body) File "/usr/lib/python2.7/httplib.py", line 895, in _send_output msg += message_body File "/usr/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-08-30 10:46:20] [sentry.errors.uncaught] [ERROR] [u"NameError: global name 'e' is not defined", u' File "pokecli.py", line 768, in <module>', u' File "pokecli.py", line 119, in main', u' File "pokecli.py", line 86, in start_bot', u' File "pokemongo_bot/__init__.py", line 127, in start', u' File "pokemongo_bot/inventory.py", line 1273, in init_inventory', u' File "pokemongo_bot/inventory.py", line 1111, in __init__', u' File "pokemongo_bot/inventory.py", line 1121, in refresh', u' File "pokemongo_bot/inventory.py", line 1148, in update_web_inventory'] mardi 30 août 2016, 10:46:20 (UTC+0200) Pokebot Stopped.

@mjmadsen
Copy link
Contributor

@castorfou Try PR #4924

mjmadsen added a commit that referenced this issue Aug 30, 2016
* Add except variable

* Add except variable
alexyaoyang pushed a commit that referenced this issue Sep 1, 2016
* Update merge (#1)

* Expand simple logging options (#4832)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Changed ) to } (#4845)

Fixed an faulty character

* fix incubator logic (#4848)

* corrected logic to respect snipe = true

* Update configuration_files.md (#4854)

* corrected logic to respect snipe = true (#4855)

* Revert "corrected logic to respect snipe = true" (#4857)

* dont forget to update the docs when adding config changes... (#4856)

* dont forget to update the docs when adding config changes...

* reflect config changes....

* please keep this as is (#4859)

Add stuff in the right order.

* Clarify Max_distance for Sniping (#4858)

* Clarify Max_distance

* Added distance unit and updated configuration_files.md

* - debug improvements for MoveToMap (#4860)

- fix for Telegram to accept "@username" as "master", too, along with numeric  IDs

* Fixes catch rates. (#4863)

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Add exceptions to json file read/writes (#4877)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Incubate eggs fix (#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* add some sanitycheck (#4891)

* execute setup.sh -u if there is a need to (#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Call level_up_rewards on exp changes/Some pep-8 (#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* Improvements to evolve + config md updates (#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* 2000 pokestop in 24h limit (#4906)

* 2000 pokestop in 24h limit

* 2000 pokestop in 24h limit

* add config variable

* config update

* Update readme.md + Improve FollowPath & SleepSchedule messages (#4911)

* Use logger for follow path loiter message

* Update readme.md

* Improve sleep message

* Allow follow_path to use config's distance unit

* Allow follow_path to use config's distance unit

* Reduce API calls (#4916)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Update player data in web from metrics

Uses existing metrics instead of waiting on liveupdate

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Improvements to evolve + config md updates (#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* Incubate eggs fix (#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* Call level_up_rewards on exp changes/Some pep-8 (#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* add some sanitycheck (#4891)

* execute setup.sh -u if there is a need to (#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Refactoring to share inventory and reduce api calls

Modifications to share cached inventory and reduce overall required api
calls from 4 to 1. Only remaining api call comes from heartbeat which
updates the cached inventory for sanity reasons.

* Remove import of UpdateWebPlayerdata

Decided there was a better way to go with this, since both
UpdateWebInventory and UpdateWebPlayerdata share the same inventory
input/output, just different sections. Combined into UpdateWebInventory.

* Fixed conflict

* Import inventory added to metrics

Allows metrics to use the cached inventory to retrieve player stats
instead of making another api call

* Removed api call from incubate_eggs

Cached inventory should be accurate enough for this

* Swap auth and config position (#4909)

* add telegram check messages interval (#4919)

* add telegram check messages interval

* config changed

* fix config

* telegram doc update

* Add documentation (#4921)

See documentation for full list of new features

* documented docker for the auth.json use case (#4922)

add instructions for the docker run command for the multiple config files use case.

* Fix for #4718 (#4924)

* Add except variable

* Add except variable

* Fix filter (#4925)

* improve docker pull speed (#4899)

* Update inventory.py (#4928)

FIX: #4926

* fixed a runtime error caused by incorrect imports (#4931)

* Catch exception telegram.error.NetworkError.
Fixs some pylint complain.

* More config parameters for MoveToMap (#4937)

* fixed a runtime error caused by incorrect imports

* Moving module-level constants (snipe parameters) into config file

* Add experimental pokemon upgrade (power-up) logic (#4938)

Add upgrade cost data file
Add last pokemon level.

* Set default value of skip_rounds to 30 since many people just use the default value.
30 will behave close to human.

* Add exception handling for cached forts (#4943)

* Add exception handling for cached forts

* whitespace fix

* telegram to thread

* config update

* doc update

* update web repo to have better web ui contribute.

* Using $TIMEZONE environment variable to set timezone

* fix errors

* fix errors

* Fixing clean run issues.

* During startup, no bot object.

* Added option PokemonGo-Bot-Configurator

Smoothed some things up
Added option to run PokemonGo-Bot-Configurator at the end of the
installation.

* Hotfix for EvolvePokemon (#4960)

* Compatiable with old protocol define in map-chat.

* Update merge (#2)

* Expand simple logging options (#4832)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Changed ) to } (#4845)

Fixed an faulty character

* fix incubator logic (#4848)

* corrected logic to respect snipe = true

* Update configuration_files.md (#4854)

* corrected logic to respect snipe = true (#4855)

* Revert "corrected logic to respect snipe = true" (#4857)

* dont forget to update the docs when adding config changes... (#4856)

* dont forget to update the docs when adding config changes...

* reflect config changes....

* please keep this as is (#4859)

Add stuff in the right order.

* Clarify Max_distance for Sniping (#4858)

* Clarify Max_distance

* Added distance unit and updated configuration_files.md

* - debug improvements for MoveToMap (#4860)

- fix for Telegram to accept "@username" as "master", too, along with numeric  IDs

* Fixes catch rates. (#4863)

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Add exceptions to json file read/writes (#4877)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Incubate eggs fix (#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* add some sanitycheck (#4891)

* execute setup.sh -u if there is a need to (#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Call level_up_rewards on exp changes/Some pep-8 (#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* Improvements to evolve + config md updates (#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* 2000 pokestop in 24h limit (#4906)

* 2000 pokestop in 24h limit

* 2000 pokestop in 24h limit

* add config variable

* config update

* Update readme.md + Improve FollowPath & SleepSchedule messages (#4911)

* Use logger for follow path loiter message

* Update readme.md

* Improve sleep message

* Allow follow_path to use config's distance unit

* Allow follow_path to use config's distance unit

* Reduce API calls (#4916)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Update player data in web from metrics

Uses existing metrics instead of waiting on liveupdate

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Improvements to evolve + config md updates (#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* Incubate eggs fix (#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* Call level_up_rewards on exp changes/Some pep-8 (#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* add some sanitycheck (#4891)

* execute setup.sh -u if there is a need to (#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Refactoring to share inventory and reduce api calls

Modifications to share cached inventory and reduce overall required api
calls from 4 to 1. Only remaining api call comes from heartbeat which
updates the cached inventory for sanity reasons.

* Remove import of UpdateWebPlayerdata

Decided there was a better way to go with this, since both
UpdateWebInventory and UpdateWebPlayerdata share the same inventory
input/output, just different sections. Combined into UpdateWebInventory.

* Fixed conflict

* Import inventory added to metrics

Allows metrics to use the cached inventory to retrieve player stats
instead of making another api call

* Removed api call from incubate_eggs

Cached inventory should be accurate enough for this

* Swap auth and config position (#4909)

* add telegram check messages interval (#4919)

* add telegram check messages interval

* config changed

* fix config

* telegram doc update

* Add documentation (#4921)

See documentation for full list of new features

* documented docker for the auth.json use case (#4922)

add instructions for the docker run command for the multiple config files use case.

* Fix for #4718 (#4924)

* Add except variable

* Add except variable

* Fix filter (#4925)

* improve docker pull speed (#4899)

* Update inventory.py (#4928)

FIX: #4926

* fixed a runtime error caused by incorrect imports (#4931)

* Catch exception telegram.error.NetworkError.
Fixs some pylint complain.

* More config parameters for MoveToMap (#4937)

* fixed a runtime error caused by incorrect imports

* Moving module-level constants (snipe parameters) into config file

* Add experimental pokemon upgrade (power-up) logic (#4938)

Add upgrade cost data file
Add last pokemon level.

* Set default value of skip_rounds to 30 since many people just use the default value.
30 will behave close to human.

* Add exception handling for cached forts (#4943)

* Add exception handling for cached forts

* whitespace fix

* telegram to thread

* config update

* doc update

* update web repo to have better web ui contribute.

* Using $TIMEZONE environment variable to set timezone

* fix errors

* fix errors

* Fixing clean run issues.

* During startup, no bot object.

* Added option PokemonGo-Bot-Configurator

Smoothed some things up
Added option to run PokemonGo-Bot-Configurator at the end of the
installation.

* Hotfix for EvolvePokemon (#4960)

* Compatiable with old protocol define in map-chat.

* Provided a default for max_walking_distance and max_sniping_distance in
order to avoid unhandled exceptions

* Made sure nicknaming only waits if real api-relevant action was taken.
rawgni added a commit to rawgni/PokemonGo-Bot that referenced this issue Sep 1, 2016
Fix nickname (PokemonGoF#5031)

* Update merge (PokemonGoF#1)

* Expand simple logging options (PokemonGoF#4832)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Changed ) to } (PokemonGoF#4845)

Fixed an faulty character

* fix incubator logic (PokemonGoF#4848)

* corrected logic to respect snipe = true

* Update configuration_files.md (PokemonGoF#4854)

* corrected logic to respect snipe = true (PokemonGoF#4855)

* Revert "corrected logic to respect snipe = true" (PokemonGoF#4857)

* dont forget to update the docs when adding config changes... (PokemonGoF#4856)

* dont forget to update the docs when adding config changes...

* reflect config changes....

* please keep this as is (PokemonGoF#4859)

Add stuff in the right order.

* Clarify Max_distance for Sniping (PokemonGoF#4858)

* Clarify Max_distance

* Added distance unit and updated configuration_files.md

* - debug improvements for MoveToMap (PokemonGoF#4860)

- fix for Telegram to accept "@username" as "master", too, along with numeric  IDs

* Fixes catch rates. (PokemonGoF#4863)

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Add exceptions to json file read/writes (PokemonGoF#4877)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Incubate eggs fix (PokemonGoF#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* add some sanitycheck (PokemonGoF#4891)

* execute setup.sh -u if there is a need to (PokemonGoF#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (PokemonGoF#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* Improvements to evolve + config md updates (PokemonGoF#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* 2000 pokestop in 24h limit (PokemonGoF#4906)

* 2000 pokestop in 24h limit

* 2000 pokestop in 24h limit

* add config variable

* config update

* Update readme.md + Improve FollowPath & SleepSchedule messages (PokemonGoF#4911)

* Use logger for follow path loiter message

* Update readme.md

* Improve sleep message

* Allow follow_path to use config's distance unit

* Allow follow_path to use config's distance unit

* Reduce API calls (PokemonGoF#4916)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Update player data in web from metrics

Uses existing metrics instead of waiting on liveupdate

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Improvements to evolve + config md updates (PokemonGoF#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* Incubate eggs fix (PokemonGoF#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* add some sanitycheck (PokemonGoF#4891)

* execute setup.sh -u if there is a need to (PokemonGoF#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (PokemonGoF#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Refactoring to share inventory and reduce api calls

Modifications to share cached inventory and reduce overall required api
calls from 4 to 1. Only remaining api call comes from heartbeat which
updates the cached inventory for sanity reasons.

* Remove import of UpdateWebPlayerdata

Decided there was a better way to go with this, since both
UpdateWebInventory and UpdateWebPlayerdata share the same inventory
input/output, just different sections. Combined into UpdateWebInventory.

* Fixed conflict

* Import inventory added to metrics

Allows metrics to use the cached inventory to retrieve player stats
instead of making another api call

* Removed api call from incubate_eggs

Cached inventory should be accurate enough for this

* Swap auth and config position (PokemonGoF#4909)

* add telegram check messages interval (PokemonGoF#4919)

* add telegram check messages interval

* config changed

* fix config

* telegram doc update

* Add documentation (PokemonGoF#4921)

See documentation for full list of new features

* documented docker for the auth.json use case (PokemonGoF#4922)

add instructions for the docker run command for the multiple config files use case.

* Fix for PokemonGoF#4718 (PokemonGoF#4924)

* Add except variable

* Add except variable

* Fix filter (PokemonGoF#4925)

* improve docker pull speed (PokemonGoF#4899)

* Update inventory.py (PokemonGoF#4928)

FIX: PokemonGoF#4926

* fixed a runtime error caused by incorrect imports (PokemonGoF#4931)

* Catch exception telegram.error.NetworkError.
Fixs some pylint complain.

* More config parameters for MoveToMap (PokemonGoF#4937)

* fixed a runtime error caused by incorrect imports

* Moving module-level constants (snipe parameters) into config file

* Add experimental pokemon upgrade (power-up) logic (PokemonGoF#4938)

Add upgrade cost data file
Add last pokemon level.

* Set default value of skip_rounds to 30 since many people just use the default value.
30 will behave close to human.

* Add exception handling for cached forts (PokemonGoF#4943)

* Add exception handling for cached forts

* whitespace fix

* telegram to thread

* config update

* doc update

* update web repo to have better web ui contribute.

* Using $TIMEZONE environment variable to set timezone

* fix errors

* fix errors

* Fixing clean run issues.

* During startup, no bot object.

* Added option PokemonGo-Bot-Configurator

Smoothed some things up
Added option to run PokemonGo-Bot-Configurator at the end of the
installation.

* Hotfix for EvolvePokemon (PokemonGoF#4960)

* Compatiable with old protocol define in map-chat.

* Update merge (PokemonGoF#2)

* Expand simple logging options (PokemonGoF#4832)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Changed ) to } (PokemonGoF#4845)

Fixed an faulty character

* fix incubator logic (PokemonGoF#4848)

* corrected logic to respect snipe = true

* Update configuration_files.md (PokemonGoF#4854)

* corrected logic to respect snipe = true (PokemonGoF#4855)

* Revert "corrected logic to respect snipe = true" (PokemonGoF#4857)

* dont forget to update the docs when adding config changes... (PokemonGoF#4856)

* dont forget to update the docs when adding config changes...

* reflect config changes....

* please keep this as is (PokemonGoF#4859)

Add stuff in the right order.

* Clarify Max_distance for Sniping (PokemonGoF#4858)

* Clarify Max_distance

* Added distance unit and updated configuration_files.md

* - debug improvements for MoveToMap (PokemonGoF#4860)

- fix for Telegram to accept "@username" as "master", too, along with numeric  IDs

* Fixes catch rates. (PokemonGoF#4863)

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Add exceptions to json file read/writes (PokemonGoF#4877)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Incubate eggs fix (PokemonGoF#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* add some sanitycheck (PokemonGoF#4891)

* execute setup.sh -u if there is a need to (PokemonGoF#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (PokemonGoF#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* Improvements to evolve + config md updates (PokemonGoF#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* 2000 pokestop in 24h limit (PokemonGoF#4906)

* 2000 pokestop in 24h limit

* 2000 pokestop in 24h limit

* add config variable

* config update

* Update readme.md + Improve FollowPath & SleepSchedule messages (PokemonGoF#4911)

* Use logger for follow path loiter message

* Update readme.md

* Improve sleep message

* Allow follow_path to use config's distance unit

* Allow follow_path to use config's distance unit

* Reduce API calls (PokemonGoF#4916)

* Fix bot crash at start on permaban

* Expanded logging options

Added "logging" section to config, with options "color",
"show_datetime", "show_process_name" and "show_log_level"

* Added warning about deprecated logging_color arg

* Display log message moved

No point trying to use the logger before it's been initialised. Moved to
init_config.

* Remove milliseconds from datetime

Because really, do we need that?

* Reversed condition order for clarity

First check: "if not in config", OR
Second check: "is in config AND set to true"

If either condition matches, the logging detail will be displayed.

* Documented new log options

* Modified conditions again

Removed unnecessary second check for config values and slightly modified
parentheses as per suggestion from @mjmadsen

* Add exception handling to json file read/write ops

* Removed API call in update live stats

Instead of making a new api call, utilise stats already contained in
metrics.

* Update player data in web from metrics

Uses existing metrics instead of waiting on liveupdate

* Implemented more granularity in the "alert_catch" parameter for Telegram
alerts.

* Improvements to evolve + config md updates (PokemonGoF#4900)

* Better do not evolve handling

* Edit config

* Update config

* Edit config

* Edit config

* Edit config

* Update config.json.path.example

* Update config.json.map.example

* Update config.json.example

* Update config.json.cluster.example

* Updated configuration_files.md

* Add extra tests

* Update config

* Update config

* Update config

* Update config

* Update config.json.pokemon.example

* Update config.json.cluster.example

* Begin fixing configuration_files.md

* Small fix

* Small fix

* Bit for of config updated

* Bit more on config

* A few more to config md

* Bit more of of an update

* Incubate eggs fix (PokemonGoF#4881)

* Fixed incubator_eggs wrong print

* Fixed pokemon hatched from eggs not added to cached inventory

* Fix

* Fixed not using breakable incubators

* Fixed error adding pokemon to cached inventory

* Moved remove egg and add Pokemon to _hatch_eggs

* Call level_up_rewards on exp changes/Some pep-8 (PokemonGoF#4896)

* Call level_up_rewards on exp changes.

* Cleanup

* add some sanitycheck (PokemonGoF#4891)

* execute setup.sh -u if there is a need to (PokemonGoF#4870)

* execute setup.sh -u if there is a need to

* ask the user whether to run setup.sh -u or not

* fix grammatical error

* Add PokemonGo bot version to docker image (PokemonGoF#4886)

* fix pep8

* Add PokemonGo bot version to docker image

* Use https://api.github.com/repos/PokemonGoF/PokemonGo-Bot/commits{/sha} API

* Fix remove pyc, pyo files

* Refactoring to share inventory and reduce api calls

Modifications to share cached inventory and reduce overall required api
calls from 4 to 1. Only remaining api call comes from heartbeat which
updates the cached inventory for sanity reasons.

* Remove import of UpdateWebPlayerdata

Decided there was a better way to go with this, since both
UpdateWebInventory and UpdateWebPlayerdata share the same inventory
input/output, just different sections. Combined into UpdateWebInventory.

* Fixed conflict

* Import inventory added to metrics

Allows metrics to use the cached inventory to retrieve player stats
instead of making another api call

* Removed api call from incubate_eggs

Cached inventory should be accurate enough for this

* Swap auth and config position (PokemonGoF#4909)

* add telegram check messages interval (PokemonGoF#4919)

* add telegram check messages interval

* config changed

* fix config

* telegram doc update

* Add documentation (PokemonGoF#4921)

See documentation for full list of new features

* documented docker for the auth.json use case (PokemonGoF#4922)

add instructions for the docker run command for the multiple config files use case.

* Fix for PokemonGoF#4718 (PokemonGoF#4924)

* Add except variable

* Add except variable

* Fix filter (PokemonGoF#4925)

* improve docker pull speed (PokemonGoF#4899)

* Update inventory.py (PokemonGoF#4928)

FIX: PokemonGoF#4926

* fixed a runtime error caused by incorrect imports (PokemonGoF#4931)

* Catch exception telegram.error.NetworkError.
Fixs some pylint complain.

* More config parameters for MoveToMap (PokemonGoF#4937)

* fixed a runtime error caused by incorrect imports

* Moving module-level constants (snipe parameters) into config file

* Add experimental pokemon upgrade (power-up) logic (PokemonGoF#4938)

Add upgrade cost data file
Add last pokemon level.

* Set default value of skip_rounds to 30 since many people just use the default value.
30 will behave close to human.

* Add exception handling for cached forts (PokemonGoF#4943)

* Add exception handling for cached forts

* whitespace fix

* telegram to thread

* config update

* doc update

* update web repo to have better web ui contribute.

* Using $TIMEZONE environment variable to set timezone

* fix errors

* fix errors

* Fixing clean run issues.

* During startup, no bot object.

* Added option PokemonGo-Bot-Configurator

Smoothed some things up
Added option to run PokemonGo-Bot-Configurator at the end of the
installation.

* Hotfix for EvolvePokemon (PokemonGoF#4960)

* Compatiable with old protocol define in map-chat.

* Provided a default for max_walking_distance and max_sniping_distance in
order to avoid unhandled exceptions

* Made sure nicknaming only waits if real api-relevant action was taken.
@prusswan
Copy link

prusswan commented Sep 6, 2016

I have a similiar error "UnicodeDecodeError: 'utf8' codec can't decode byte 0x81 in position 38: invalid start byte", happens after 400, message bad request syntax

127.0.0.1 - - [06/Sep/2016 18:23:12] code 400, message Bad request syntax ("\x81\xfe\x00\x941\xb1\xb4\x1d\x05\x83\xef?S\xde\xc0'S\xc3\xdb|U\xd2\xd5nE\x93\x98=J\x93\xd5R\xde\xc1sE\x93\x8e=\x13\xc1\xdbvT\xc2\xd7|_\xee\xc7z\x13\x9d\x94?U\xd0\xc0|\x13\x8b\x94f\x13\xdc\xc7z\x13\x8b\x94?u\xd8\xc7P\xc3\xd0xU\x91\x87e\x11\xe1\xdbiX\xde\xda3\x13\x9d\x94?X\xc5\xd1p\x13\x8b\x94?a\xde\xc0t^\xdf\x961\x11\x93\xd5p^\xc4\xdai\x13\x8b\x94?\x02\x93\xc91\x11\x93\xd1kT\xdf\xc0?\x0b\x91\x96tE\xd4\xd9BU\xd8\xc7~P\xc3\xd0xU\x93\xc9@\x81\xfe\x013\x90\xc7\xf8\xa0\xa4\xf5\xa3\x82\xf2\xa8\x8c\x9a\xf2\xb5\x97\xc1\xf4\xa4\x99\xd3\xe4\xe5\xd4\x80\xeb\xe5\x99\xc3\xf3\xa8\x8d\xce\xe4\xe5\xc2\x80\xb2\xb7\x97\xcb\xf5\xb4\x9b\xc1\xfe\x98\x8b\xc7\xb2\xeb\xd8\x82\xf4\xa6\x8c\xc1\xb2\xfd\xd8\xdb\xb2\xb7\x97\xcb\xf5\xaa\x97\xce\xcf\xae\x9c\x82\xaa\xe7\xc9\x93\xbc\xe7\xda\xc5\xe8\xb7\x91\xd2\xf1\xb3\x91\xcf\xfe\x98\x8c\xc9\xfd\xa2\x8b\xd4\xf1\xaa\x88\xff\xfd\xb4\xda\x9a\xb0\xf6\xcc\x97\xa3\xf6\xcd\x97\xa5\xf3\xca\x98\xa1\xf5\xd4\x80\xb2\xab\x97\xce\xf7\xae\x8c\xd5\xf4\xa2\xda\x9a\xb0\xf6\xc8\x93\xbe\xff\xcb\x93\xa1\xf0\xcb\x99\xa6\xf0\xc1\x92\xa0\xf5\xca\x8c\xb0\xe5\x88\xcf\xfb\xa2\x95\xcf\xfe\x98\x96\xc1\xfd\xa2\xda\x9a\xb0\xe5\xaf\xc5\xf5\xa3\x94\xc5\xb2\xeb\xd8\x82\xfc\xa6\x8c\xc9\xe4\xb2\x9c\xc5\xb2\xfd\xd8\x91\xbe\xf4\xc8\x96\xa4\xf3\xcd\x97\xa2\xf3\xc1\x95\xa8\xf2\xc9\x93\xa5\xeb\xd8\x82\xe3\xb7\x99\xd7\xfe\x98\x88\xcf\xf9\xa9\x8c\xff\xf9\xa3\xda\x9a\xb0\xe5\xcb\x91\xf4\xa6\xc9\x99\xa8\xa3\xce\x91\xf6\xe5\xd4\x80\xb2\xa2\x96\xc3\xff\xb2\x96\xd4\xf5\xb5\xa7\xc9\xf4\xe5\xc2\x80\xa9\xf4\xc9\x92\xa3\xf2\xca\x92\xa2\xf2\xc0\x94\xa8\xf0\xcf\x98\xa2\xf6\x85\x8c\xb0\xe5\x9d\xd6\xf5\xa9\x8c\x82\xaa\xe7\xda\xc3\xf1\xb3\x9b\xc8\xf1\xa5\x94\xc5\xcf\xb7\x97\xcb\xf5\xaa\x97\xce\xb2\xba\xa5\x81\xfe\x013X\x99\x9d\xbdl\xab\xc6\x9f:\xf6\xe9\x87:\xeb\xf2\xdc<\xfa\xfc\xce,\xbb\xb1\x9d#\xbb\xfc\xde;\xf6\xe8\xd3,\xbb\xa7\x9dz\xe9\xf2\xd6=\xea\xfe\xdc6\xc6\xee\xdaz\xb5\xbd\x9f<\xf8\xe9\xdcz\xa3\xbd\xc6z\xe9\xf2\xd6=\xf4\xf2\xd3\x07\xf0\xf9\x9fb\xb9\xa9\x8bt\xb9\xbf\xd8 \xe9\xf4\xcf9\xed\xf4\xd26\xc6\xe9\xd45\xfc\xee\xc99\xf4\xed\xe25\xea\xbf\x87x\xa8\xa9\x8ak\xa8\xa8\x85h\xae\xa9\x8eh\xa1\xb1\x9dz\xf5\xf2\xd3?\xf0\xe9\xc8<\xfc\xbf\x87x\xa8\xad\x8ev\xa1\xae\x8eh\xa1\xae\x8ea\xab\xa8\x88h\xae\xa8\x91x\xbb\xed\xd23\xfc\xf0\xd26\xc6\xf3\xdc5\xfc\xbf\x87x\xbb\xcd\xdc_\xf8\xee\x9ft\xb9\xbf\xd19\xed\xf4\xc9-\xfd\xf8\x9fb\xb9\xac\x93k\xa9\xab\x85\xac\xac\x8bh\xab\xa8\x8co\xac\xaf\x91x\xbb\xee\xcd9\xee\xf3\xe2(\xf6\xf4\xd3,\xc6\xf4\xd9z\xa3\xbd\x9fk\xa8\xf9\xdci\xa0\xa5\xd9m\xff\xac\x9ft\xb9\xbf\xd86\xfa\xf2\xc86\xed\xf8\xcf\x07\xf0\xf9\x9fb\xb9\xac\x8eh\xa1\xa8\x8am\xa8\xac\x85\xa9\xae\x88j\xaa\xad\x89a\xaa\xe0\x91x\xbb\xf8\xcb=\xf7\xe9\x9fb\xb9\xbf\xde9\xed\xfe\xd59\xfb\xf1\xd8\x07\xe9\xf2\xd6=\xf4\xf2\xd3z\xe4\xc0\x81\xfe\x01S\x9alKH\xae^\x10j\xf8\x03?r\xf8\x1e$)\xfe\x0f_;\xeeNgh\xe1N_+\xf9\x03>&\xeeNqh\xb8\x1c$#\xff\x1f()\xf438/\xb8@kj\xfe\r?)\xb8Vk3\xb8")
Traceback (most recent call last):
File "/home/prusswan/Projects/PokemonGo-Bot/local/lib/python2.7/site-packages/eventlet/greenpool.py", line 82, in _spawn_n_impl
func(_args, **kwargs)
File "/home/prusswan/Projects/PokemonGo-Bot/local/lib/python2.7/site-packages/eventlet/wsgi.py", line 719, in process_request
proto.init(sock, address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 342, in handle
self.handle_one_request()
File "/home/prusswan/Projects/PokemonGo-Bot/local/lib/python2.7/site-packages/eventlet/wsgi.py", line 351, in handle_one_request
if not self.parse_request():
File "/usr/lib/python2.7/BaseHTTPServer.py", line 286, in parse_request
self.send_error(400, "Bad request syntax (%r)" % requestline)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 365, in send_error
self.send_response(code, message)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 396, in send_response
self.log_request(code)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 433, in log_request
self.requestline, str(code), str(size))
File "/usr/lib/python2.7/BaseHTTPServer.py", line 469, in log_message
format%args))
File "/home/prusswan/Projects/PokemonGo-Bot/lib/python2.7/codecs.py", line 369, in write
data, consumed = self.encode(object, self.errors)
File "/home/prusswan/Projects/PokemonGo-Bot/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 0x81 in position 38: invalid start byte

@belinux
Copy link

belinux commented Sep 6, 2016

Same here.. Output in case it helps:

127.0.0.1 - - [06/Sep/2016 13:59:42] code 400, message Bad request syntax ('\x81\xfe\x00\xd4\x1c\x7fw\xd9(M,\xfb~\x10\x03\xe3~\r\x18\xb8x\x1c\x16\xaah][\xf9g]\x16\xba\x7f\x10\x02\xb7h]M\xf9>\x14\x16\xb7}\x12\x12\xef%IN\xfb0_U\xbd}\x0b\x16\xfb&_\x0c\xfbq\x0c\x10\xfb&U\x9c{\x18\x04\xf9u\x11\x14\xac~\x1e\x03\xb0r\x18M\xf9GOY\xef+PB\xf7,\x1c\xb4A__\x9c{\x18\x04\xf9p\x1a\x11\xad&_A\xf5<6\x19\xbai\x1d\x16\xadu\x11\x10\xe3<N^\xfb0_U\xbc{\x18\x04\xfb&_U\xe92I@\xf6)QG\xf9w\x12U\xf5<]\x12\xbe{\x0c(\xb5y\x19\x03\xfb&_A\xf5<]\x12\xbe{\x0c(\xb0r\x1cU\xe3<N')
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/eventlet/greenpool.py", line 82, in _spawn_n_impl
func(_args, *_kwargs)
File "/usr/lib/python2.7/site-packages/eventlet/wsgi.py", line 719, in process_request
proto.init(sock, address, self)
File "/usr/lib/python2.7/SocketServer.py", line 652, in init
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 342, in handle
self.handle_one_request()
File "/usr/lib/python2.7/site-packages/eventlet/wsgi.py", line 351, in handle_one_request
if not self.parse_request():
File "/usr/lib/python2.7/BaseHTTPServer.py", line 286, in parse_request
self.send_error(400, "Bad request syntax (%r)" % requestline)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 365, in send_error
self.send_response(code, message)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 396, in send_response
self.log_request(code)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 433, in log_request
self.requestline, str(code), str(size))
File "/usr/lib/python2.7/BaseHTTPServer.py", line 469, in log_message
format%args))
File "/usr/lib/python2.7/codecs.py", line 369, in write
data, consumed = self.encode(object, self.errors)
File "/usr/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 0x81 in position 38: invalid start byte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests