-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
catalog/onix/onix.py attempts to use a global variable in init(), but doesn't declare it global #2
Comments
I've fixed this in my fork: http://github.com/rbarlow/openlibrary/commit/a892f5a35f727587b1e1cae9210a8a0882da9ea3 |
ghost
assigned EdwardBetts
Jul 13, 2011
Perhaps should do a pull request? :) |
@mekarpeles I think we should close this! |
This was referenced Jul 21, 2020
roshanr11
added a commit
to joycewu37/openlibrary
that referenced
this issue
Dec 6, 2021
yoonmgyg
pushed a commit
to yoonmgyg/openlibrary
that referenced
this issue
Nov 30, 2022
Update README.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
onix_codelists and onix_shortnames are both initialized to None. Later in the module loading, init() gets called, which attempts to set them to useful dictionaries. Because they aren't declared global in init(), new variables are created within init() that exist only within the scope of that method. The fix is to add these lines to the top of init():
global onix_codelists
global onix_shortnames
I've forked the project and intend to make a push that will fix this issue soon. I'll post back here with the revision that you can pull to get the fix. Thanks!
The text was updated successfully, but these errors were encountered: