Giter Club home page Giter Club logo

Comments (2)

rjclocks avatar rjclocks commented on June 10, 2024

Found the problem: Windows and asynchio

Solution: Add the following into the end of the code

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(main())

from surepy.

rjclocks avatar rjclocks commented on June 10, 2024

Ran up against a second chellenge. The code now starts to run, but throws a different error:

Traceback (most recent call last): File "Z:\programming\python\surepy_testing\catflap_test.py", line 42, in <module> asyncio.run(main()) File "C:\Program Files\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "Z:\programming\python\surepy_testing\catflap_test.py", line 24, in main pets: List[Pet] = await surepy.get_pets() File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\__init__.py", line 297, in get_pets return [pet for pet in (await self.get_entities()).values() if isinstance(pet, Pet)] File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\__init__.py", line 349, in get_entities if response := await self.sac.call(method="GET", resource=MESTART_RESOURCE): File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\client.py", line 218, in call self._auth_token = await self.get_token() File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\client.py", line 188, in get_token raise SurePetcareError() surepy.exceptions.SurePetcareError

from surepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.