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

ValueError: You must use datetime, date, timedelta, time or tuple (for periods) #126

Open
ArtemSBulgakov opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ArtemSBulgakov
Copy link
Member

[2024-10-28 12:16:12,502] [INFO] [uvicorn.access] 74.125.150.37:0 - "GET /fall24-b22-ai-02.ics?user_id=0&export_type=url HTTP/1.0" 500
[2024-10-28 12:16:12,502] [ERROR] [uvicorn.error] Exception in ASGI application

Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/prometheus_fastapi_instrumentator/middleware.py", line 174, in __call__
    raise exc
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/prometheus_fastapi_instrumentator/middleware.py", line 172, in __call__
    await self.app(scope, receive, send_wrapper)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/code/src/logging_.py", line 36, in run_endpoint_function
    r = await dependant.call(**values)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/code/src/modules/ics/routes.py", line 354, in get_event_group_ics_by_alias
    parent.add("EXDATE", recurrence_ids[0] if len(recurrence_ids) == 1 else recurrence_ids)
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/icalendar/cal.py", line 194, in add
    value = self._encode(name, value, parameters, encode)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/icalendar/cal.py", line 145, in _encode
    obj = klass(value)
          ^^^^^^^^^^^^
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/icalendar/prop.py", line 244, in __init__
    dt = vDDDTypes(dt)
         ^^^^^^^^^^^^^
  File "/opt/pysetup/.venv/lib/python3.12/site-packages/icalendar/prop.py", line 315, in __init__
    raise ValueError('You must use datetime, date, timedelta, '
ValueError: You must use datetime, date, timedelta, time or tuple (for periods)
@ArtemSBulgakov ArtemSBulgakov added the bug Something isn't working label Dec 19, 2024
@ArtemSBulgakov ArtemSBulgakov moved this to 🔖 Todo in InNoHassle Dec 19, 2024
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
Status: 🔖 Todo
Development

No branches or pull requests

1 participant