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
TheRealFalcon
left a comment
There was a problem hiding this comment.
Thanks! LGTM assuming CI passes
Proposed Commit Message
Additional Context
Spotted by the
cloud-init-style-tipJenkins job.Test Steps
Reproduce with:
tox -e tip-pylint. Test this branch by just runningtoxfrom it.Checklist: