-
Notifications
You must be signed in to change notification settings - Fork 856
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
tox: bump the pinned flake8 and pylint version (SC-422) #1029
Conversation
The u prefix for strings is no longer necessary in Python >=3.0.
This is a WIP because I'm not sure on how to fix this:
This happens here:
and the reason is that load_yaml() can return None , which of course has no membership test and isn't subscriptable: Line 840 in e27c307
One way to fix this by applying this change to
And this works, however I wonder if we should make |
I don't think this encoding change is safe to do as a bulk change. I'm guessing that most of these calls will work fine specifying utf-8, but are we sure that every single If I've specified my locale to use ISO-8859, are we sure that none of the files that we're reading will be encoded with ISO-8859 rather than utf-8? If we need to be explicit, then I think For the yaml question, given that our load yaml definition is def load_yaml(blob, default=None, allowed=(dict,)): I think it makes sense to keep the default as None and do None checks for what has been returned. |
I see your point and I'm find dropping the |
5e1db95
to
b2bdd73
Compare
The new warning stems form https://www.python.org/dev/peps/pep-0597, which says: Developers using macOS or Linux may forget that the default encoding is not always UTF-8. [...] Even Python experts may assume that the default encoding is UTF-8. This creates bugs that only happen on Windows. The warning could be fixed by always specifying encoding='utf-8', however we should be careful to not break environments which are not utf-8 (or explicitly state that only utf-8 is supported). Let's silence the warning for now.
Spotted by pylint: - E1135 (unsupported-membership-test) - E1136 (unsubscriptable-object)
b2bdd73
to
a756976
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM assuming CI passes
Proposed Commit Message
Additional Context
Spotted by the
cloud-init-style-tip
Jenkins job.Test Steps
Reproduce with:
tox -e tip-pylint
. Test this branch by just runningtox
from it.Checklist: