I have read all the other solutions for this error and modified my code accordingly, but the error still persists. What am I doing wrong here?
This is my code:
LOGGER.error(
'There are no frames to download in the chosen ' +
'time range: %s to %s. Try a different time range with the ' +
'--start_date and --end_date options. This error can also arise ' +
'if the downloaded files have been deleted or modified during' +
'execution.', str(start_date), str(end_date))
Error message:
.tox/pylint/lib/python3.8/site-packages/polaris/fetch/data_fetch_decoder.py:143:8: W1201: Specify string format arguments as logging function parameters (logging-not-lazy)
------------------------------------------------------------------ Your code has been rated at 9.99/10 (previous run: 9.99/10, +0.00)
ERROR: InvocationError for command /home/jai/polaris/.tox/pylint/bin/pylint tests .tox/pylint/lib/python3.8/site-packages/polaris .tox/pylint/lib/python3.8/site-packages/contrib (exited with code 4)
Update 1: Removing the str() conversion gives me the same output but the error persists. As a comment pointed out, the error is caused by some other issue, but my question is still about why is linter giving me that output.
Update 2: Used implicit string concatenation and now I get the following error
W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
Code for implicit string concatenation using formatting:
LOGGER.error(
'{0} {1} {2} {3} {4}'.format(
'There are no frames to download in the chosen time range:',
'%s to %s. Try a different time range with the',
'--start_date and --end_date options. This error can',
'also arise if the downloaded files have been deleted',
'or modified during execution.'), start_date, end_date)