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

Support running app.py with a base URL again. #1875

Merged
merged 2 commits into from
May 30, 2024
Merged

Conversation

tdilauro
Copy link
Contributor

Description

Quick fix to support running app.py with a base URL again. It just pops the URL argument from the command line args, so that future ArgParsers don't get confused by it and exit.

Motivation and Context

How Has This Been Tested?

  • Ran locally.
  • CI tests pass.

Checklist

  • N/A I have updated the documentation accordingly.
  • All new and existing tests passed.

app.py Outdated
url = None
if len(sys.argv) > 1:
url = sys.argv[1]
url = sys.argv.pop()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails in the case where you don't pass in a URL right?

$ python app.py
Traceback (most recent call last):
  File "palace/circulation/app.py", line 43, in <module>
    run(url)
  File "palace/circulation/app.py", line 29, in run
    InstanceInitializationScript().run()
  File "palace/circulation/src/palace/manager/scripts/initialization.py", line 175, in run
    ArgumentParser(
  File ".pyenv/versions/3.10.10/lib/python3.10/argparse.py", line 1717, in __init__
    prog = _os.path.basename(_sys.argv[0])
IndexError: list index out of range

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, duh. Right.

Copy link
Member

@jonathangreen jonathangreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@tdilauro tdilauro merged commit ed812a1 into main May 30, 2024
20 checks passed
@tdilauro tdilauro deleted the bugfix/app-base-url branch May 30, 2024 16:53
@tdilauro tdilauro added the bug Something isn't working label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants