Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CLI: fix container list with non-ASCII characters #1913

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

fvennetier
Copy link
Member

SUMMARY

Fix an issue with container list and non-ASCII characters.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • Python API
  • CLI
SDS VERSION
openio 4.8.2.dev12
ADDITIONAL INFORMATION

The bug manifested itself with something like:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 401, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/fvennetier/src/public_git/oio-sds/oio/cli/__init__.py", line 126, in run
    super(Lister, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 119, in run
    self.produce_output(parsed_args, column_names, data)
  File "/usr/lib/python2.7/site-packages/cliff/lister.py", line 82, in produce_output
    parsed_args,
  File "/usr/lib/python2.7/site-packages/cliff/formatters/table.py", line 101, in emit_list
    self.add_rows(x, column_names, data)
  File "/usr/lib/python2.7/site-packages/cliff/formatters/table.py", line 80, in add_rows
    first_row = next(data_iter)
  File "/home/fvennetier/src/public_git/oio-sds/oio/cli/container/container.py", line 463, in <genexpr>
    for v in listing)
  File "/home/fvennetier/src/public_git/oio-sds/oio/common/utils.py", line 177, in cid_from_name
    hash_.update(v)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)

@fvennetier fvennetier force-pushed the fix-unicode-container-list branch from 595778f to 8df1521 Compare October 22, 2019 13:16
@codecov-io
Copy link

Codecov Report

Merging #1913 into 5.x will decrease coverage by 1.6%.
The diff coverage is 90.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##              5.x    #1913      +/-   ##
==========================================
- Coverage   79.21%   77.61%   -1.59%     
==========================================
  Files         391      358      -33     
  Lines       73844    70126    -3718     
  Branches     7016     6797     -219     
==========================================
- Hits        58485    54424    -4061     
- Misses      15120    15570     +450     
+ Partials      239      132     -107
Impacted Files Coverage Δ
tests/utils.py 95.2% <ø> (-0.56%) ⬇️
oio/common/utils.py 72.27% <100%> (+1.51%) ⬆️
oio/directory/indexer.py 73.39% <75%> (+0.06%) ⬆️
tests/functional/cli/container/test_container.py 65.76% <92%> (+0.83%) ⬆️
metautils/lib/utils_svc_policy.c 56.6% <0%> (-22.12%) ⬇️
meta2v2/meta2_dedup_utils.c 0% <0%> (-18.55%) ⬇️
metautils/lib/utils_resolv.c 49.63% <0%> (-14.81%) ⬇️
meta1v2/meta1_backend_references.c 73% <0%> (-14%) ⬇️
sqliterepo/election.c 80.01% <0%> (-9.8%) ⬇️
metautils/lib/utils_addr_info.c 49.34% <0%> (-9.33%) ⬇️
... and 102 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5b8d0a...8df1521. Read the comment docs.

@fvennetier fvennetier merged commit a9f7fc1 into open-io:5.x Oct 22, 2019
@fvennetier fvennetier deleted the fix-unicode-container-list branch October 22, 2019 14:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants