TypeError in Subscription Task #26

Closed
opened 2024-09-10 09:17:39 +00:00 by corbz · 1 comment
Owner

This error causes the entire task to fail, effectively cancelling it.

ERROR Unhandled exception in internal background task 'subscription_task'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop
    await self.coro(*args, **kwargs)
  File "/app/src/extensions/tasks.py", line 86, in subscription_task
    await self.execute_task()
  File "/app/src/extensions/tasks.py", line 100, in execute_task
    await self.process_subscriptions(subscriptions)
  File "/app/src/extensions/tasks.py", line 186, in process_subscriptions
    await asyncio.gather(*(semaphore_process(sub) for sub in subscriptions))
  File "/app/src/extensions/tasks.py", line 184, in semaphore_process
    await process_single_subscription(sub)
  File "/app/src/extensions/tasks.py", line 178, in process_single_subscription
    await self.process_items(sub, rss_feed)
  File "/app/src/extensions/tasks.py", line 205, in process_items
    await self.track_and_send(sub, feed, item, mutated_item, channel, blocked)
  File "/app/src/extensions/tasks.py", line 246, in track_and_send
    message = await channel.send(embed=await mutated_item.to_embed(sub, feed, self.api.session))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/feed.py", line 133, in to_embed
    desc = shorten(markdownify(self.description, strip=["img"]), 4096)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/markdownify/__init__.py", line 395, in markdownify
    return MarkdownConverter(**options).convert(html)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/markdownify/__init__.py", line 96, in convert
    soup = BeautifulSoup(html, 'html.parser')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bs4/__init__.py", line 315, in __init__
    elif len(markup) <= 256 and (
         ^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
This error causes the entire task to fail, effectively cancelling it. ``` ERROR Unhandled exception in internal background task 'subscription_task'. Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop await self.coro(*args, **kwargs) File "/app/src/extensions/tasks.py", line 86, in subscription_task await self.execute_task() File "/app/src/extensions/tasks.py", line 100, in execute_task await self.process_subscriptions(subscriptions) File "/app/src/extensions/tasks.py", line 186, in process_subscriptions await asyncio.gather(*(semaphore_process(sub) for sub in subscriptions)) File "/app/src/extensions/tasks.py", line 184, in semaphore_process await process_single_subscription(sub) File "/app/src/extensions/tasks.py", line 178, in process_single_subscription await self.process_items(sub, rss_feed) File "/app/src/extensions/tasks.py", line 205, in process_items await self.track_and_send(sub, feed, item, mutated_item, channel, blocked) File "/app/src/extensions/tasks.py", line 246, in track_and_send message = await channel.send(embed=await mutated_item.to_embed(sub, feed, self.api.session)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/src/feed.py", line 133, in to_embed desc = shorten(markdownify(self.description, strip=["img"]), 4096) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/markdownify/__init__.py", line 395, in markdownify return MarkdownConverter(**options).convert(html) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/markdownify/__init__.py", line 96, in convert soup = BeautifulSoup(html, 'html.parser') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/bs4/__init__.py", line 315, in __init__ elif len(markup) <= 256 and ( ^^^^^^^^^^^ TypeError: object of type 'NoneType' has no len() ```
corbz added the
bug
label 2024-09-10 09:17:39 +00:00
corbz added this to the PYRSS project 2024-09-10 09:17:44 +00:00
Author
Owner

fixed on latest

fixed on latest
corbz closed this issue 2024-09-10 10:02:01 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: corbz/PYRSS-Bot#26
No description provided.