Some syntax errors can be caught and handled, like eval( " " ), but these are rare. Shell script fails: Syntax error: “ ( ” unexpected. Running this script with sudo will raise a syntax error in recent versions of Ubuntu and Debian. Never used Python, but am trying to debug some old python code that started failing from time to time. After tracing the module, i pinpointed the problem to be in an eval( someString) line that. Cannot resolve SyntaxError: unexpected EOF while. if choice in menu_ d: dict_ list = menu_ d[ choice] eval( dict _ list[ 0. but it get the following error when the. For them who are facing syntax error when try execute code in eval,