Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid confusing SyntaxError message when connections fail #641

Open
d-w-moore opened this issue Oct 16, 2024 · 0 comments
Open

avoid confusing SyntaxError message when connections fail #641

d-w-moore opened this issue Oct 16, 2024 · 0 comments

Comments

@d-w-moore
Copy link
Collaborator

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/irods/session.py", line 326, in server_version
    return tuple(ast.literal_eval(reported_vsn))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/ast.py", line 64, in literal_eval
    node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<unknown>", line 0
    
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

The above excerpt (the beginning of a stack trace) was obtained from a case of failing to contact the server. This part need not even be printed , and would not be except that normal program flow sends us into the raising of an exception , just because the user has not defined the environment variable PYTHON_IRODSCLIENT_REPORTED_SERVER_VERSION. This can be handled better with a simple if/then so that we don't see the Syntax Error.

Python error dumps are complicated enough, let's do better in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants