RHEL gdb command fails with Fatal Python error: Py_Initialize: Unable to get the locale encoding

Solution Verified - Updated -

Issue

  • Running The GNU Debugger command gdb fails with the following error.

    $ gdb
    Fatal Python error: Py_Initialize: Unable to get the locale encoding
      File "/usr/lib64/python2.7/encodings/__init__.py", line 123
        raise CodecRegistryError,\
                                ^
    SyntaxError: invalid syntax
    
    Current thread 0x00007fb99529dbc0 (most recent call first):
    Aborted
    

Environment

  • Red Hat Enterprise Linux 8
  • Python 2.7.17

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content