Python telegram bot shows urllib3 upstream warning message

I’m getting a warning message when I start my telegram bot application. The warning shows up in the console and says something about python-telegram-bot using upstream urllib3. It mentions that this is allowed but not supported by the maintainers.

The exact warning looks like this:

/usr/local/lib/python3.7/dist-packages/python_telegram_bot-12.4.2-py3.7.egg/telegram/utils/request.py:47: UserWarning: python-telegram-bot is using upstream urllib3. This is allowed but not supported by python-telegram-bot maintainers.

My bot still works but I’m worried about this warning. Is this something I should fix? How can I resolve this issue and make the warning go away? Any help would be great.

Had the same urllib3 warning about six months back when deploying a client’s bot. It’s usually a version mismatch between python-telegram-bot and urllib3 - happens all the time after pip updates or switching virtual environments. Your bot will work fine despite the warning, but if you want it gone, check your python-telegram-bot version and grab the urllib3 version that was tested with it. The compatibility matrix is in their official docs. The warning also disappears when you upgrade to newer telegram library versions, so might be worth updating if you’re not stuck on a specific version.

hey, no worries about that warning! it’s common and won’t affect your bot’s functionality. if it really bothers you, maybe downgrade urllib3 or see if there’s a newer version of python-telegram-bot out that addresses it.

This warning appears when python-telegram-bot identifies that you’re using an urllib3 version not officially tested with it. I encountered this issue on my production bot a while ago. Fortunately, it’s just an informational warning, and your bot will continue to function correctly as urllib3 is designed for backward compatibility. If you’d like to eliminate the warning, consider checking your requirements.txt file to pin urllib3 to a version recommended by the telegram library. Alternatively, you can suppress the warning using Python’s warnings module if it’s becoming bothersome in your development logs.