Skip to content
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

Fixed string format index out of range error #51517

Merged
merged 3 commits into from Feb 13, 2019

Conversation

@damianosSemmle
Copy link
Contributor

commented Feb 6, 2019

What does this PR do?

The string formats fixed reference index {1} when there is only one argument in the format call.
The string formats are changed to reference the correct index of {0}.

Disclaimer: I work for Semmle and I've found these errors using our LGTM code analyzer
https://lgtm.com/projects/g/saltstack/salt/alerts/?mode=tree&severity=error&lang=python&ruleFocus=9990090

Previous Behavior

An IndexError: tuple index out of range error is thrown

New Behavior

Correct string format index doesn't throw error

Tests written?

No

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

damianosSemmle and others added 3 commits Feb 6, 2019
The string formats fixed where referencing index `{1}` when there was only one argument in the format call.
The string formats were changed to reference the correct index of `{0}`.

Disclaimer: I work for Semmle and I've found these errors using our LGTM code analyzer
https://lgtm.com/projects/g/saltstack/salt/alerts/?mode=tree&severity=error&lang=python&ruleFocus=9990090
@dwoz dwoz merged commit e3c9a3e into saltstack:2019.2 Feb 13, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
@damianosSemmle damianosSemmle deleted the damianosSemmle:fix-string-format-index branch Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.