Bug 972703 - qpid-stat UnicodeEncodeError if output redirected.
Summary: qpid-stat UnicodeEncodeError if output redirected.
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-tools
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
: 913822 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-10 12:37 UTC by Leonid Zhaldybin
Modified: 2022-04-23 08:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Leonid Zhaldybin 2013-06-10 12:37:58 UTC
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
Queues
  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
Queues
  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):
qpid-tools-0.22-2

How reproducible:
100%

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 $?
0

The stable (2.3) version behavior is exactly the same, so this is not a regression.

Comment 1 Leonid Zhaldybin 2014-05-15 12:30:57 UTC
*** 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.