Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Issue 2672593002: raw_io module: Add text_input and text_output (Closed)

Created:
3 years, 10 months ago by martiniss
Modified:
3 years, 10 months ago
Reviewers:
dnj, iannucci
CC:
chromium-reviews, infra-reviews+recipes-py_chromium.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

raw_io module: Add text_input and text_output This CLs adds text_input and text_output to the raw io module. These are the same as input and output, except that they assume the data they handle is utf-8 encoded, and will decode or encode it as appropriate. If any errors are encountered while doing this, they will be replaced with an appropriate replacement character, as defined in https://docs.python.org/2/library/codecs.html#codec-base-classes BUG=686280, 664352 Review-Url: https://codereview.chromium.org/2672593002 Committed: https://github.com/luci/recipes-py/commit/9456147555cc76adec014709e02928b620d7d8d9

Patch Set 1 #

Patch Set 2 : Change approach #

Total comments: 2

Patch Set 3 : Full implementation #

Patch Set 4 : Remove TODOs, not needed #

Patch Set 5 : Add pragma no covers. #

Total comments: 3

Patch Set 6 : Add comment about no cover #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -16 lines) Patch
M recipe_modules/raw_io/api.py View 1 2 3 4 5 7 chunks +75 lines, -3 lines 0 comments Download
M recipe_modules/raw_io/example.py View 1 2 3 3 chunks +22 lines, -6 lines 0 comments Download
M recipe_modules/raw_io/example.expected/basic.json View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M recipe_modules/raw_io/test_api.py View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M recipe_modules/shutil/api.py View 1 2 4 chunks +8 lines, -7 lines 0 comments Download

Messages

Total messages: 20 (8 generated)
martiniss
PTAL It does require valid utf-8...
3 years, 10 months ago (2017-02-01 23:04:04 UTC) #3
martiniss
https://codereview.chromium.org/2106333004 was the change to force calling encode, but there's no bug number on it ...
3 years, 10 months ago (2017-02-01 23:04:48 UTC) #4
dnj
lgtm in spirit. WDYT about raising an exception if it's not UTF-8? I don't like ...
3 years, 10 months ago (2017-02-02 00:38:41 UTC) #5
iannucci
Uh... this looks really wrong to me. raw_io should be dealing with unencoded bytes. If ...
3 years, 10 months ago (2017-02-02 01:45:39 UTC) #6
iannucci
this approach lgtm https://codereview.chromium.org/2672593002/diff/20001/recipe_modules/raw_io/api.py File recipe_modules/raw_io/api.py (right): https://codereview.chromium.org/2672593002/diff/20001/recipe_modules/raw_io/api.py#newcode161 recipe_modules/raw_io/api.py:161: def input_text(data, suffix=''): docstring (and for ...
3 years, 10 months ago (2017-02-02 02:23:30 UTC) #8
martiniss
PTAL again.
3 years, 10 months ago (2017-02-06 20:04:52 UTC) #10
martiniss
On 2017/02/06 at 20:04:52, martiniss wrote: > PTAL again. Need to add more tests, but ...
3 years, 10 months ago (2017-02-06 21:20:12 UTC) #11
martiniss
On 2017/02/06 at 21:20:12, martiniss wrote: > On 2017/02/06 at 20:04:52, martiniss wrote: > > ...
3 years, 10 months ago (2017-02-07 19:22:31 UTC) #12
iannucci
lgtm https://codereview.chromium.org/2672593002/diff/80001/recipe_modules/raw_io/api.py File recipe_modules/raw_io/api.py (right): https://codereview.chromium.org/2672593002/diff/80001/recipe_modules/raw_io/api.py#newcode47 recipe_modules/raw_io/api.py:47: def encode(self, data): # pragma: no cover why ...
3 years, 10 months ago (2017-02-07 22:18:24 UTC) #13
martiniss
https://codereview.chromium.org/2672593002/diff/80001/recipe_modules/raw_io/api.py File recipe_modules/raw_io/api.py (right): https://codereview.chromium.org/2672593002/diff/80001/recipe_modules/raw_io/api.py#newcode47 recipe_modules/raw_io/api.py:47: def encode(self, data): # pragma: no cover On 2017/02/07 ...
3 years, 10 months ago (2017-02-08 00:25:56 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2672593002/100001
3 years, 10 months ago (2017-02-08 00:26:02 UTC) #17
commit-bot: I haz the power
3 years, 10 months ago (2017-02-08 00:29:03 UTC) #20
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://github.com/luci/recipes-py/commit/9456147555cc76adec014709e02928b620d...

Powered by Google App Engine
This is Rietveld 408576698