except do nothing python

try:
    do_something()
except Exception:
    pass

Here is what the above code is Doing:
1. It’s trying to run the do_something() function.
2. If there’s an exception, it ignores it.

This is a very bad way to handle exceptions.

The problem is that you don’t know what kind of exception will be raised.
It could be a ValueError, a TypeError, an AttributeError, or something else entirely.

If you don’t know what kind of exception will be raised, you can’t handle it properly.

A better way to handle exceptions is to be specific about the exceptions you’re expecting: