PokeAPI / pokebase

Python 3 wrapper for Pokéapi v2
BSD 3-Clause "New" or "Revised" License
286 stars 53 forks source link

Certain Moves Returning ValueError? #19

Closed stango12 closed 4 years ago

stango12 commented 4 years ago

I'm not sure when it started to happen, but I'm trying to get access to move data and am getting the same error of

ValueError: resource not found (18), check spelling

As an example, I have a program that just gets the move "Leaf Storm"

import pokebase as pb
pb.move("leaf-storm")

Running this gives me this error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\site-packages\pokebase\loaders.py", line 267, in move
    return NamedAPIResource('move', id_or_name)
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 319, in __init__
    self.load()
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 367, in load
    self.__setattr__(k, [make_obj(i) for i in v])
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 278, in make_obj
    return APIMetadata(d)
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 464, in __init__
    self.__setattr__(k, make_obj(v))
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 276, in make_obj
    return NamedAPIResource(location, name, False)
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 311, in __init__
    n = APIResourceList(r).id_to_name(name)
  File "c:\Python27\lib\site-packages\pokebase\api.py", line 433, in id_to_name
    .format(id_))
ValueError: resource not found (18), check spelling

I've checked on the PokeAPI website using the same spelling to search the move and it has been successful. Has anyone else had this issue? I've tried to run this in Python3 as well and it produces the same error.

leverglowh commented 4 years ago

I checked and works fine

pb.move("leaf-storm")
<move - leaf-storm>
GregHilmes commented 4 years ago

@stango12 can you reconfirm this issue for me? I'm having no such issue, and I notice you're using Python 2.7, which was unsupported by pokebase at the time of writing your original issue and is now unsupported by Python itself. Anyway, I'm trying to clean things up, let me know if this issue still persists for you on Python 3.6, otherwise I will assume this is a Python 2 issue and close.

stango12 commented 4 years ago

can confirm on python 3 it works now on cmd