Bug 972703 - qpid-stat UnicodeEncodeError if output redirected.
qpid-stat UnicodeEncodeError if output redirected.
Status: NEW
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-tools (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ernie
Eric Sammons
: 913822 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2013-06-10 08:37 EDT by Leonid Zhaldybin
Modified: 2014-11-09 17:43 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Leonid Zhaldybin 2013-06-10 08:37:58 EDT
Description of problem:
After bug 841488 was fixed in 2.2 release, qpid-stat tool is capable of displaying entities with non-ASCII (UTF-8) names, for example:

[root@lzhaldyb-rhel64x ~]# qpid-config add queue тест
[root@lzhaldyb-rhel64x ~]# qpid-stat -q
  queue                                     dur  autoDel  excl  msg   msgIn  msgOut  bytes  bytesIn  bytesOut  cons  bind
  1a304d39-60c0-4bef-b29b-7afeb4ad2cd2:0.0       Y        Y        0     0      0       0      0        0         1     2

However, putting the qpid-stat output through pipe results in the following error:

[root@lzhaldyb-rhel64x ~]# qpid-stat -q | cat
  queue                                     dur  autoDel  excl  msg   msgIn  msgOut  bytes  bytesIn  bytesOut  cons  bind
  b1156582-a01c-485a-aded-1062aa5954b9: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)

This makes impossible parsing of qpid-stat provided information on queues and exchanges in bash scripts or using grep to select the entity we are currently interested in.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a queue or an exchange with non-ASCII characters in the name.
2. Get its statistics using qpid-stat tool.
3. Redirect qpid-stat output to a pipe or an ordinary file.

Actual results:
UnicodeEncodeError in the resulting output.

Expected results:
No encode errors.

Additional info:
qpid-config tools does not suffer from this particular problem:

[root@lzhaldyb-rhel64x ~]# qpid-config queues | cat
Queue Name                                Attributes
589227ec-0446-4b81-ada0-acfbe53342cd:0.0  auto-del excl 
[root@lzhaldyb-rhel64x ~]# echo $?

The stable (2.3) version behavior is exactly the same, so this is not a regression.
Comment 1 Leonid Zhaldybin 2014-05-15 08:30:57 EDT
*** Bug 913822 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.