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) |
reviewbot | |
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
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"' … |
chipx86 | |
Blank line between these. |
chipx86 | |
Blank line. |
chipx86 | |
Blank line. |
chipx86 | |
We should probably update these (and any above) to use formatting strings instead of concatenation, since the latter is slower. |
chipx86 | |
Same question as above. |
chipx86 | |
""" on the next line. |
chipx86 | |
This should probably be using formatting strings to. |
chipx86 | |
Is this needed for regexes? I'd expect r. |
chipx86 | |
Same here. We should also move this out and compile it so we don't have eto do that each time … |
chipx86 | |
repr doesn't seem like the right thing here, at least conceptually. What are we using it for? |
chipx86 |
-
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.
-
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