1

I might have stumbled into something that appears to be a bug with how rabbitmqadmin handles (or in fact, doesn't handle) unicode.

If I have a queue that has unicode characters in queue name the rabbitmqadmin command fails with UnicodeEncodeErrors.

I'm running RabbitMQ 3.6.6 on Mac, installed via Homebrew. Both the admin command and server are of same version.

Steps how to reproduce the queue name issue:

  1. Create a queue with unicode in it: 'rabbitmqadmin declare queue name=ööö'.
  2. List queues: 'rabbitmqadmin list queues'

Output:

Traceback (most recent call last):
  File "/usr/local/sbin/rabbitmqadmin", line 1007, in <module>
    main()
  File "/usr/local/sbin/rabbitmqadmin", line 413, in main
    method()
  File "/usr/local/sbin/rabbitmqadmin", line 588, in invoke_list
    format_list(self.get(uri), cols, obj_info, self.options)
  File "/usr/local/sbin/rabbitmqadmin", line 705, in format_list
    formatter_instance.display(json_list)
  File "/usr/local/sbin/rabbitmqadmin", line 716, in display
    (columns, table) = self.list_to_table(json.loads(json_list), depth)
  File "/usr/local/sbin/rabbitmqadmin", line 770, in list_to_table
    add('', 1, item, add_to_row)
  File "/usr/local/sbin/rabbitmqadmin", line 749, in add
    fun(column, subitem)
  File "/usr/local/sbin/rabbitmqadmin", line 756, in add_to_row
    row[column_ix[col]] = str(val)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 12-13: ordinal not in range(128)

I have similar issues with 'rabbitmqadmin get queue=' when the message payload contains unicode character(s).

Peter Hägg
  • 158
  • 1
  • 9

1 Answers1

1

I think you are right, you can use python3 , check this answer it explains why with python3 works.

EDIT

1 - I filed an issue

2 - Fixed to the version: 3.6.7 see the PR

Community
  • 1
  • 1
Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52