foss-news / fossnewsbot

FOSS News Telegram Bot sends you news collected for the next digest one by one to filter and categorize.
https://t.me/fossnewsbot
GNU Affero General Public License v3.0
7 stars 0 forks source link

Ошибка "Can't parse entities: character '-' is reserved and must be escaped with the preceding '\'" #17

Closed Gim6626 closed 3 years ago

Gim6626 commented 3 years ago
fossnewsbot        | 2021-09-25 05:44:26,379 ERROR    fossnewsbot - strptime() argument 1 must be str, not None
fossnewsbot        | 2021-09-25 05:44:26,394 ERROR    asyncio - Task exception was never retrieved
fossnewsbot        | future: <Task finished name='Task-35079' coro=<Dispatcher._process_polling_updates() done, defined at /srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py:409> exception=CantParseEntities("Can't parse entities: character '-' is reserved and must be escaped with the preceding '\\'")>
fossnewsbot        | Traceback (most recent call last):
fossnewsbot        |   File "/srv/fossnewsbot/fossnewsbot/handlers.py", line 171, in handler
fossnewsbot        |     await msg_next(callback)
fossnewsbot        |   File "/srv/fossnewsbot/fossnewsbot/handlers.py", line 97, in msg_next
fossnewsbot        |     text = format_news(news)
fossnewsbot        |   File "/srv/fossnewsbot/fossnewsbot/handlers.py", line 49, in format_news
fossnewsbot        |     dt = datetime.strptime(news['dt'], '%Y-%m-%dT%H:%M:%S%z').strftime('%x')
fossnewsbot        | TypeError: strptime() argument 1 must be str, not None
fossnewsbot        | 
fossnewsbot        | During handling of the above exception, another exception occurred:
fossnewsbot        | 
fossnewsbot        | Traceback (most recent call last):
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 417, in _process_polling_updates
fossnewsbot        |     for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 238, in process_updates
fossnewsbot        |     return await asyncio.gather(*tasks)
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify
fossnewsbot        |     response = await handler_obj.handler(*args, **partial_data)
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 286, in process_update
fossnewsbot        |     return await self.callback_query_handlers.notify(update.callback_query)
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify
fossnewsbot        |     response = await handler_obj.handler(*args, **partial_data)
fossnewsbot        |   File "/srv/fossnewsbot/fossnewsbot/handlers.py", line 237, in handler
fossnewsbot        |     await error(callback)
fossnewsbot        |   File "/srv/fossnewsbot/fossnewsbot/handlers.py", line 131, in error
fossnewsbot        |     await callback.message.edit_text(text=text, disable_web_page_preview=True)
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/types/message.py", line 2616, in edit_text
fossnewsbot        |     return await self.bot.edit_message_text(
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/bot/bot.py", line 2411, in edit_message_text
fossnewsbot        |     result = await self.request(api.Methods.EDIT_MESSAGE_TEXT, payload)
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/bot/base.py", line 208, in request
fossnewsbot        |     return await api.make_request(self.session, self.server, self.__token, method, data, files,
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/bot/api.py", line 140, in make_request
fossnewsbot        |     return check_result(method, response.content_type, response.status, await response.text())
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/bot/api.py", line 115, in check_result
fossnewsbot        |     exceptions.BadRequest.detect(description)
fossnewsbot        |   File "/srv/fossnewsbot/venv/lib/python3.9/site-packages/aiogram/utils/exceptions.py", line 140, in detect
fossnewsbot        |     raise err(cls.text or description)
fossnewsbot        | aiogram.utils.exceptions.CantParseEntities: Can't parse entities: character '-' is reserved and must be escaped with the preceding '\'