[openstack-dev] [nova] pep8 failures on master

Kevin L. Mitchell klmitch at mit.edu
Tue Apr 3 22:18:58 UTC 2018


On Wed, 2018-04-04 at 07:54 +1000, Michael Still wrote:
> Thanks to jichenjc for fixing the pep8 failures I was seeing on
> master. I'd decided they were specific to my local dev environment
> given no one else was seeing them.
> 
> As I said in the patch that fixed the issue [1], I think its worth
> exploring how these got through the gate in the first place. There is
> nothing in the patch which stops us from ending up here again, and no
> real explanation for what caused the issue in the first place.

While there was no discussion in the patch, the topic of the patch
hints at the cause: "fix_pep8_py3".  These were probably pep8 errors
that would only occur if pep8 was running under Python 3 and not Python
2.  The first error was fixed by removing a debugging print that was
formatted as "print (…)", which would satisfy pep8 under Python 2—since
'print' is a statement—but not under Python 3, where it's a function. 
The second error was in a clause protected by six.PY2, and was caused
by "unicode" being missing in Python 3; the solution jichenjc chose
there was to disable the pep8 check for that line.

The only way I can imagine stopping these errors in the future would be
to double-up on the pep8 check: have the gate run pep8 under both
Python 2 and Python 3.
-- 
Kevin L. Mitchell <klmitch at mit.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 220 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20180403/b8af71a4/attachment.sig>


More information about the OpenStack-dev mailing list