Fix REQUESTS_TIMEOUT by converting to int#526
Open
rogu-beta wants to merge 1 commit intoaboutcode-org:mainfrom
Open
Fix REQUESTS_TIMEOUT by converting to int#526rogu-beta wants to merge 1 commit intoaboutcode-org:mainfrom
rogu-beta wants to merge 1 commit intoaboutcode-org:mainfrom
Conversation
The commit 65c725c introduced DEJACODE_INTEGRATION_REQUESTS_TIMEOUT to control the timeout behavior for requests that DejaCode makes. The dejacode_toolkit\__init__.py uses the function `get_settings` which either returns `getenv` or `getattr`. Since `getenv` returns a string, the usage of `get_settings` must convert to int before assigning it to REQUESTS_TIMEOUT, otherwise requests will raise an exception for not receiving an int or float. Signed-off-by: Robert Guetzkow <robert.guetzkow@betasystems.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commit 65c725c introduced
DEJACODE_INTEGRATION_REQUESTS_TIMEOUTto control the timeout behavior for requests that DejaCode makes. The dejacode_toolkit_init_.py uses the functionget_settingswhich either returnsgetenvorgetattr. Sincegetenvreturns a string, the usage ofget_settingsmust convert to int before assigning it toREQUESTS_TIMEOUT, otherwise requests will raise an exception for not receiving an int or float.Issues
Changes
The return value of
get_settingsis converted into an integer, ensuring that in either case ofget_settingsREQUESTS_TIMEOUTcontains an integer.Checklist