Bug 913822

Summary: qpid-stat unable to redirect unicode characters.
Product: Red Hat Enterprise MRG Reporter: Leonid Zhaldybin <lzhaldyb>
Component: qpid-toolsAssignee: Ernie <eallen>
Status: CLOSED DUPLICATE QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 2.3CC: esammons, jross
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-15 12:30:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leonid Zhaldybin 2013-02-22 08:30:02 UTC
Description of problem:
Currently, the qpid-stat tool is able to display queues or exchanges information in case that unicode characters are used in the entities names. For example:

[root@lzhaldyb-rhel64x ~]# qpid-config add queue šššš
[root@lzhaldyb-rhel64x ~]# qpid-stat -q
Queues
  queue                                     dur  autoDel  excl  msg   msgIn  msgOut  bytes  bytesIn  bytesOut  cons  bind
  =========================================================================================================================
  27e49df9-d3d0-47f4-8269-c7fe30adc874:0.0       Y        Y        0     0      0       0      0        0         1     2
  šššš                                                             0     0      0       0      0        0         0     1

However, if the output of qpid-stat command is redirected to a pipe or to a file, it gets corrupted:

[root@lzhaldyb-rhel64x ~]# qpid-stat -q | grep -v blah
Queues
  queue                                     dur  autoDel  excl  msg   msgIn  msgOut  bytes  bytesIn  bytesOut  cons  bind
  =========================================================================================================================
  13be10d0-4f43-4c9d-ab24-89c285e45b40:0.0       Y        Y        0     0      0       0      0        0         1     2
Failed: UnicodeEncodeError - 'ascii' codec can't encode characters in position 2-5: ordinal not in range(128)

NOTE: the qpid-config tool does not have this problem:

[root@lzhaldyb-rhel64x ~]# qpid-config queues | grep -v blah
Queue Name                                Attributes
=================================================================
af2e5d7d-dc10-4b90-9721-de7c9a911e8a:0.0  auto-del excl 
šššš 

Version-Release number of selected component (if applicable):
qpid-tools-0.18-8

How reproducible:
100%

Steps to Reproduce:
1. Create a queue with non-ASCII characters in the name "qpid-config add queue šššš"
2. Run the qpid-stat tool and redirect its output to a pipe: "qpid-stat -q | cat"
3.
  
Actual results:
The non-ASCII name is not shown in the resulting output. There is an error instead from 'ascii' codec.

Expected results:
The non-ASCII characters are displayed properly even after their redirection.

Additional info:

Comment 1 Leonid Zhaldybin 2014-05-15 12:30:57 UTC

*** This bug has been marked as a duplicate of bug 972703 ***