8000 Error With Adding Handler · Issue #4803 · python-telegram-bot/python-telegram-bot · GitHub
[go: up one dir, main page]

Skip to content

Error With Adding Handler #4803

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

Closed
kadir5131 opened this issue May 25, 2025 · 2 comments · Fixed by #4802
Closed

Error With Adding Handler #4803

kadir5131 opened this issue May 25, 2025 · 2 comments · Fixed by #4802
Labels
🔌 bug pr description: bug

Comments

@kadir5131
Copy link

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

\Python312\Lib\site-packages\telegram\ext_application.py", line 1259, in process_update
for handlers in self.handlers.values():
^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: dictionary changed size during iteration

I want the buttons in that menu to be active when navigating between menus in Telegram, but sometimes ı encounter this problem when I try to add or delete handlers for the buttons.

Describe the solution you'd like

We need to be able to add or remove handlers while the code is running, this is a big deficiency.

Describe alternatives you've considered

No response

Additional context

No response

@kadir5131 kadir5131 added the 📋 triage work status: triage label May 25, 2025
@aelkheir
Copy link
Member

Hey, thanks for the report. A fix is on the way #4802

@aelkheir aelkheir added 🔌 bug pr description: bug and removed 📋 triage work status: triage labels May 26, 2025
@Bibo-Joshi
Copy link
Member

for completeness let me add that, depending on your use case, ConversationHandler will be a cleaner solution that using add/remove_handler at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌 bug pr description: bug
Projects
None yet
3 participants
0