-
Notifications
You must be signed in to change notification settings - Fork 483
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
properly handle integer environment values, fixes issue with specifying ports via environment vars #2947
Conversation
Thanks for the PR! The proper place to fix this is in the Where conversion is already being done: Line 101 in 8be1c83
Tests that need to be updated to reproduce the problem you are experiencing: lbry-sdk/tests/unit/test_conf.py Lines 91 to 95 in 8be1c83
|
Might need some help, I cannot find where the environment variables are being converted into a type. Line 277 in 1d1f052
|
I think you've found the problem, if you look at the |
Thanks! I updated the conf.py to a working version, adding some type parsing and loading to the EnivronmentAccess |
It should be very close to how Also, this needs tests, they would go here: https://github.com/lbryio/lbry-sdk/blob/master/tests/unit/test_conf.py#L91 (look at all of the other tests in that file to get inspiration). You are making good progress, don't hesitate to ask about how something work if you are confused, this https://docs.python.org/3/howto/descriptor.html |
Cool, think I have it now. I'll try to add the tests (I'm new to Python, but the examples you mentioned should be enough). Cheers! |
Looking good! Instead of adding two new config options to the test config could you just re-use |
@thebubbleindex thanks for the PR, congrats on your first one! Can we show you some appreciation for the contribution? Also, please consider signing up for our dev list at the bottom of lbry.tech! |
make sure tcp and udp port for dht are int type
make sure tcp and udp port for dht are int type
Reason for fix (Ubuntu 20.04 and desktop app):