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
Kwallet backend fails in environments where sys.argv is not present #445
Comments
Added a check that argv exists and has at least some value before accessing it.
Added a check that argv exists and has at least some value before accessing it.
It seems to me you've found a bug in those Python implementations. Even the docs of Python reference |
I don't think it's necessarily a matter of the Python implementation. Looking at the discussion on https://bugs.python.org/issue839151 and an example usage in a C++ interface at https://stackoverflow.com/questions/12230210/attributeerror-module-object-has-no-attribute-argv-when-using-python-h , it's not clear to me that Python defines the presence of argv as canonical. The interface provides for it and the linked docs seem to be but a simplified general usage example. Yes, I agree that the docs should probably note this. For my particular use case, I'm looking at CPython via Postgres plpython code at https://github.com/postgres/postgres/blob/master/src/pl/plpython/plpy_main.c I think there's a valid argument that a script name in that context isn't appropriate and that CPython within Postgresql isn't that cornery of a corner case. |
Thanks for that additional evidence. I've filed bpo-41615 to track the issue upstream. In the meantime, I agree it would be worthwhile to address this issue in keyring. |
…as indicated by the Python docs and might in fact be empty or uninitialized or not a list. Ref #445.
Use default appid if sys.argv doesn't exist. Ref #445
Kwallet backend fails in environments where sys does not have argv available.
In my particular case, I was trying to utilize the Snowflake connector for SQLAlchemy through PostgreSQL Multicorn FDW. I encountered the following stacktrace in my log:
I was able to successfully work around this by setting
sys.argv
to['']
when absent.The text was updated successfully, but these errors were encountered: