Closed Bug 1460707 Opened 6 years ago Closed 6 years ago

fix python 3 linting errors

Categories

(Socorro :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: cmiller)

References

Details

(Whiteboard: [good first bug])

When porting code such that it works with both Python 2 and 3, a good first pass is to run it through flake8. flake8 catches a bunch of Python syntax issues that prevent module loading.

This bug covers using the new test scaffolding and fixing all the flake8 linting issues.
Whiteboard: [good first bug]
Hi Will,
Could I work on this issue?
Flags: needinfo?(willkg)
We talked on IRC about this and other bugs. I mentioned that we have a couple of interns starting on Monday one or both of which will be working on Python 3 porting work which includes this bug so I want to hold it for a bit.
Flags: needinfo?(willkg)
Assignee: nobody → cmiller
Commits pushed to master at https://github.com/mozilla-services/socorro

https://github.com/mozilla-services/socorro/commit/1d01d44db13124cc1c1ef4749b53e363b7bd788f
fix bug 1460707: fixed python 3 lint errors

Fixed linting errors via flake8. Modified code so that test pass in both
python 2 & 3. Most modifications for flake errors were done using find
and replace. New imports were added according to pep8 import
conventions. After linting errors were fixed another crontabber test
failed because explicit type checking wanted 'unicode' type. Unicode
type is only in python 2.A string was passed instead.Checked 2/3 cheat
sheet. Cheat sheet suggested to import from builtins library and use
str. But this failed because the str function doesnt provide the casting
behavior needed. So instead I coerced the string to unicode using its
own decode method. Lastly there was an error of types being used.
Buildin library types vs actual native language types. I used the six
library to import string_types which is a compatibility package for both
python 2 & 3.

https://github.com/mozilla-services/socorro/commit/a908026c974c61cfb74c3a7665575a3d05a83fa1
fix bug 1460707: fixed python 3 lint errors

Addressed reviewer comments with incorporating six library.

https://github.com/mozilla-services/socorro/commit/e95208c514b64c8b59470d8a8dd293b08f5de6a1
fix bug 1460707: fixed python 3 lint errors

Addressed comment issues

https://github.com/mozilla-services/socorro/commit/1263dbcbb428a75ddbf9f3edc5e672dc392fe4ec
fix bug 1460707: fixed python 3 lint errors

Addressed last outstanding comment I missed

https://github.com/mozilla-services/socorro/commit/cf995d1ad4628fec074156bd3fd78a01f5cf6920
fix bug 1460707: fixed python 3 lint errors

Addressed review commets

https://github.com/mozilla-services/socorro/commit/0d4db30cdb779e25f21300f41a92c7420084320f
Merge pull request #4463 from ceddy-cedd/1460707-fix-python-3-linting-errors

fix bug 1460707: fixed python 3 lint errors
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.