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

Bug: "ValueError: Invalid format string" when using countdoom from the command line #6

Open
Andrei-Iosifescu123 opened this issue Feb 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Andrei-Iosifescu123
Copy link

Andrei-Iosifescu123 commented Feb 9, 2023

Bug Report

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Scripts\countdoom.exe\__main__.py", line 7, in <module>
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Lib\site-packages\countdoom\cli.py", line 41, in cli
    loop.run_until_complete(main(args))
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Lib\site-packages\countdoom\cli.py", line 73, in main
    data = await countdoom_client.fetch_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Lib\site-packages\countdoom\client.py", line 131, in fetch_data
    'clock': self.clock(),
             ^^^^^^^^^^^^
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Lib\site-packages\countdoom\client.py", line 85, in clock
    return self.countdown_to_time(self._countdown, clock_format)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Andrei\AppData\Local\Programs\Python\Python311\Lib\site-packages\countdoom\client.py", line 325, in countdown_to_time
    return (midnight - delta).strftime(time_format)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Invalid format string

Steps to Reproduce (unless obvious)

open cmd and type "countdoom" or run in python:

from typing import Dict, Union
import asyncio
from countdoom import CountdoomClient


async def async_get_doomsday_clock() -> Dict[str, Union[str, float, None]]:
    """
    Get current Doomsday Clock value using AsyncIO.

    :return: Dictionary of Doomsday Clock representation styles
    """
    client = CountdoomClient()
    data = await client.fetch_data()
    return data

async def main():
    doomsday_clock = await async_get_doomsday_clock()
    print("Doomsday Clock:", doomsday_clock)

asyncio.run(main())

Environment Info

Windows 10 22H2, python 3.11

@Andrei-Iosifescu123 Andrei-Iosifescu123 added the bug Something isn't working label Feb 9, 2023
@welcome
Copy link

welcome bot commented Feb 9, 2023

🎉 Thanks for opening your first issue here! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant