Project

General

Profile

Bug #12287

ceph command line tool chokes on ceph –w (the dash is unicode 'en dash' &ndash, copy-paste to reproduce)

Added by Samuel Just over 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
07/10/2015
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

ubuntu@mira040:~$ sudo ceph –w
Traceback (most recent call last):
File "/usr/bin/ceph", line 896, in <module>
retval = main()
File "/usr/bin/ceph", line 839, in main
sigdict, inbuf, verbose)
File "/usr/bin/ceph", line 409, in new_style_command
valid_dict = validate_command(sigdict, cmdargs, verbose)
File "/usr/lib/python2.7/dist-packages/ceph_argparse.py", line 920, in validate_command
matched = matchnum(args, sig, partial=True)
File "/usr/lib/python2.7/dist-packages/ceph_argparse.py", line 733, in matchnum
validate_one(word, desc, partial and (len(words) == 0))
File "/usr/lib/python2.7/dist-packages/ceph_argparse.py", line 705, in validate_one
desc.instance.valid(word, partial)
File "/usr/lib/python2.7/dist-packages/ceph_argparse.py", line 496, in valid
if self.prefix.startswith(s):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

Not sure what the right behavior here should be, probably should just catch UnicodeDecodeError and print a useful error message instead.


Related issues

Copied to Ceph - Backport #16798: jewel: ceph command line tool chokes on ceph –w (the dash is unicode 'en dash' &ndash, copy-paste to reproduce) Resolved

Associated revisions

Revision 1b2e70fa (diff)
Added by Kefu Chai over 3 years ago

pybind/ceph_argparse: do not choke on non-ascii prefix

  • add a test for it
  • add the comments for utf-8 encoding, which is needed by python
    module loader. because the new test has a non-ascii string in
    it. it's the Chinese translation of "octopus and squid".

Fixes: #12287
Signed-off-by: Kefu Chai <>

History

#1 Updated by Kefu Chai over 3 years ago

  • Assignee set to Kefu Chai

#2 Updated by Kefu Chai over 3 years ago

  • Status changed from New to Need Review

#3 Updated by Kefu Chai about 3 years ago

  • Status changed from Need Review to Resolved

#4 Updated by Kefu Chai almost 3 years ago

  • Status changed from Resolved to Verified

#5 Updated by Kefu Chai almost 3 years ago

  • Status changed from Verified to Need Review

#6 Updated by Ken Dreyer almost 3 years ago

  • Backport set to jewel

#7 Updated by Kefu Chai over 2 years ago

  • Status changed from Need Review to Pending Backport

#8 Updated by Nathan Cutler over 2 years ago

  • Copied to Backport #16798: jewel: ceph command line tool chokes on ceph –w (the dash is unicode 'en dash' &ndash, copy-paste to reproduce) added

#9 Updated by Nathan Cutler over 2 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF