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

archive step assumed LD_LIBRARY_PATH populated #307

Closed
aidanheerdegen opened this issue Aug 2, 2021 · 1 comment · Fixed by #366
Closed

archive step assumed LD_LIBRARY_PATH populated #307

aidanheerdegen opened this issue Aug 2, 2021 · 1 comment · Fixed by #366
Assignees
Labels

Comments

@aidanheerdegen
Copy link
Collaborator

In the archive step payu assumed LD_LIBRARY_PATH is populated and errors if it doesn't:

https://github.com/payu-org/payu/blob/master/payu/experiment.py#L781

Traceback (most recent call last):
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-21.07/bin/payu", line 10, in <module>                                          
    sys.exit(parse())
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/payu/cli.py", line 42, in parse               
    run_cmd(**args)
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/payu/subcommands/archive_cmd.py", line 18, in runcmd
    expt.archive()
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/site-packages/payu/experiment.py", line 781, in archive     
    ld_libpaths = os.environ['LD_LIBRARY_PATH']
  File "/g/data/hh5/public/apps/miniconda3/envs/analysis3-21.07/lib/python3.9/os.py", line 679, in __getitem__                            
    raise KeyError(key) from None

Should use get and supply an appropriate default if it doesn't exist.

@marshallward
Copy link
Collaborator

os.environ.get('LD_LIBRARY_PATH', '') looks like it might work here. I agree this was an oversight.

(I think at the time, it would have not been possible to use Python without some sort of active module.)

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

Successfully merging a pull request may close this issue.

3 participants