bot wont boot up : ValueError: Expecting property name
Expected Behavior
start normally
Actual Behavior
-> # sudo python pokecli.py -cf ./configs/config.json
[06:46:21] PokemonGO Bot v1.0
Traceback (most recent call last):
File "pokecli.py", line 250, in <module>
main()
File "pokecli.py", line 229, in main
config = init_config()
File "pokecli.py", line 57, in init_config
load.update(json.load(data))
File "/usr/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 22 column 7 (char 607)
Steps to Reproduce
git clone latest build on dev branch doing initial step edit the config.json file
Other Information
OS: Debian x64_86 Git Commit: c4c34875c7af8d8ffdcc18e76b0ea0f0146c2422
I committed fix, please test.
after git pull : git log : 4555466ed1801f401e99670b17a9c98f4cb4ebb9
-> # sudo python pokecli.py -cf ./configs/config.json
[07:08:16] PokemonGO Bot v1.0
Traceback (most recent call last):
File "pokecli.py", line 250, in <module>
main()
File "pokecli.py", line 229, in main
config = init_config()
File "pokecli.py", line 57, in init_config
load.update(json.load(data))
File "/usr/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 22 column 7 (char 607)
im getting the same error as above with lastest pull. just to confirm
I get a different error:
$ python pokecli.py
[13:23:45] PokemonGO Bot v1.0
Traceback (most recent call last):
File "pokecli.py", line 250, in <module>
main()
File "pokecli.py", line 229, in main
config = init_config()
File "pokecli.py", line 55, in init_config
if os.path.isfile(config_arg):
File "/Users/***/Desktop/PokemonGo-Bot/_dev/PokemonGo-Bot/lib/python2.7/genericpath.py", line 37, in isfile
st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
Ensure that there is no comma separator in the last json value.
here is the last line of my json config file, just to eject this possibility
{
...
"use_lucky_egg": false,
"evolve_captured": false,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
// "Rattata": { "always_catch" : true }
},
"release": {
"any": {"release_below_cp": 500, "release_below_iv": 0.8, "logic": "and"},
// "Rattata": { "always_release" : true }
}
}
Try to completely remove the catch and release keys, and also the leftover comma friom the "evolve_captured" key afterwards.
@mehdi-S you have a malformed son in the configuration. Check for commas
I've been following this thread and after cleaning the catch and release keys I used the command posted by @mehdi-S sudo python pokecli.py -cf ./configs/config.json and now everything seems to be working fine 👍
what you see is exactly the defaut config.json.exemple with my value, so maybe the typo is also in the default file and need to be corrected
works fine without the catch/release key to confirm
Is the parser fine with the // comments in the JSON structure?
@ngkogkos trying with and without, not the issue here
now the bot dont release anything anymore
and frequently get into
Traceback (most recent call last):
File "pokecli.py", line 250, in <module>
main()
File "pokecli.py", line 241, in main
bot.take_step()
File "/root/PokemonGo-Bot-myprettyusername/pokemongo_bot/__init__.py", line 36, in take_step
location = self.navigator.take_step()
File "/root/PokemonGo-Bot-myprettyusername/pokemongo_bot/spiral_navigator.py", line 49, in take_step
point = self.points[self.ptr]
IndexError: list index out of range
The example config looks like this:
"release": {
"any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
// "Rattata": { "always_release" : true }
}
but since the last line is commented out there is one comma too much. It should be
"release": {
"any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"}
}
right?
yep, not a valid JSON with that last comma
Error: Parse error on line 9:
...logic": "or" }, // "Rattata": { "alw
---------------------^
Expecting 'STRING', got 'undefined'
Exactly. Same for the "catch" key also
had the same issue, after deleting the catch lines it works only if i put the config in the root direct...on windows it doestn work in the configs file....and realy...do we need for only ONE file a dir?! :/
@tpmodding files could increase in future
@tpmodding you maybe are on the master branch, where configs/ folder dont exist already ?
no i'm on dev, i have the dir but it works only when i put the file to pokecli.py and start with python pokecli.py -cf config.json