Do unicode migration for rbtools/api/
Review Request #6686 — Created Dec. 9, 2014 and submitted
This change updates the code in the rbtools/api/ directory to have a correct
separation of unicode vs bytes, and use unicode literals everywhere.
Ran unit tests.
| Description | From | Last Updated |
|---|---|---|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 21 E128 continuation line under-indented for visual indent |
|
|
|
Col: 80 E501 line too long (80 > 79 characters) |
|
|
|
Col: 80 E501 line too long (84 > 79 characters) |
|
|
|
This looks kind of funky. Can we not use a byte string and feed in key.encode('utf-8'), like: content.write(b'Content-Disposition: formd-ata; name="%s"' … |
|
|
|
Blank line between these. |
|
|
|
Blank line. |
|
|
|
Blank line. |
|
|
|
We should probably update these (and any above) to use formatting strings instead of concatenation, since the latter is slower. |
|
|
|
Same question as above. |
|
|
|
""" on the next line. |
|
|
|
This should probably be using formatting strings to. |
|
|
|
Is this needed for regexes? I'd expect r. |
|
|
|
Same here. We should also move this out and compile it so we don't have eto do that each time … |
|
|
|
repr doesn't seem like the right thing here, at least conceptually. What are we using it for? |
|
- Commit:
-
414e034fbc435a27110142afa26ca1c6fd034341cd5b8c712cf6a900eb337c06da5fd19fb2ae52e0
-
Tool: Pyflakes Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py Tool: PEP8 Style Checker Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py
-
-
This looks kind of funky. Can we not use a byte string and feed in
key.encode('utf-8'), like:content.write(b'Content-Disposition: formd-ata; name="%s"' % key.encode('utf-8')) -
-
-
-
We should probably update these (and any above) to use formatting strings instead of concatenation, since the latter is slower.
-
-
-
-
-
Same here.
We should also move this out and compile it so we don't have eto do that each time in this loop.
- Commit:
-
cd5b8c712cf6a900eb337c06da5fd19fb2ae52e0cf7944675cbd0a286fdcde4ce042e3af61924fbb
-
Tool: Pyflakes Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py Tool: PEP8 Style Checker Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py
- Commit:
-
cf7944675cbd0a286fdcde4ce042e3af61924fbb5317e315b6582eea6462a3dadf1aa5be40e1ddbf
-
Tool: Pyflakes Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py Tool: PEP8 Style Checker Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py
Tool: Pyflakes Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py Tool: PEP8 Style Checker Processed Files: rbtools/api/client.py rbtools/api/resource.py rbtools/api/decorators.py rbtools/api/factory.py rbtools/api/decode.py rbtools/api/capabilities.py rbtools/api/tests.py rbtools/api/request.py rbtools/api/errors.py rbtools/api/utils.py