Fixed #23551 -- Fixed bash autocompletion crash on Python 3.