Bug #72569 mysqluc exits because of ValueError: No closing quotation
Submitted: 8 May 2014 11:49 Modified: 16 Jul 2014 4:30
Reporter: Shahriyar Rzayev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Utilities Severity:S1 (Critical)
Version:1.4.2 OS:Linux (CentOS 6.5)
Assigned to: CPU Architecture:Any

[8 May 2014 11:49] Shahriyar Rzayev
Description:
Dear all,
mysqluc exits , with python errors if not to write closing quotation mark:

[root@linuxsrv3 ~]# mysqluc
Launching console ...

Welcome to the MySQL Utilities Client (mysqluc) version 1.4.2
Copyright (c) 2010, 2014 Oracle and/or its affiliates. All rights reserved.
.
.
mysqluc> mysqluserclone --source='root:12345@localhost' --dump 'ssluser'@'%
Traceback (most recent call last):
  File "/usr/bin/mysqluc", line 179, in <module>
    util_con.run_console()
  File "/usr/lib/python2.6/site-packages/mysql/utilities/common/console.py", line 956, in run_console
    if self._do_command(command):
  File "/usr/lib/python2.6/site-packages/mysql/utilities/common/console.py", line 757, in _do_command
    cmd, parameters = self._get_util_parameters(command)
  File "/usr/lib/python2.6/site-packages/mysql/utilities/common/console.py", line 871, in _get_util_parameters
    tokens = shlex.split(cmd_string)
  File "/usr/lib64/python2.6/shlex.py", line 279, in split
    return list(lex)
  File "/usr/lib64/python2.6/shlex.py", line 269, in next
    token = self.get_token()
  File "/usr/lib64/python2.6/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib64/python2.6/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"
ValueError: No closing quotation
[root@linuxsrv3 ~]# 

How to repeat:
For eg, use mysqluserclone without writing the closing quotation mark:

# mysqluserclone --source='root:12345@localhost' --dump 'ssluser'@'%

Suggested fix:
Maybe some informative error message but not exiting suddenly.
[9 May 2014 9:01] MySQL Verification Team
Hello Shahriyar,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[9 May 2014 9:02] MySQL Verification Team
// if quotes are missing then it raises exception instead of error or warning 

mysqluc> mysqluserclone --source='root@localhost' --dump 'ushastry'@'%Traceback (most recent call last):
  File "scripts/mysqluc", line 179, in <module>
    util_con.run_console()
  File "/usr/lib/python2.6/site-packages/mysql/utilities/common/console.py", line 956, in run_console
    if self._do_command(command):
  File "/usr/lib/python2.6/site-packages/mysql/utilities/common/console.py", line 757, in _do_command
    cmd, parameters = self._get_util_parameters(command)
  File "/usr/lib/python2.6/site-packages/mysql/utilities/common/console.py", line 871, in _get_util_parameters
    tokens = shlex.split(cmd_string)
  File "/usr/lib64/python2.6/shlex.py", line 279, in split
    return list(lex)
  File "/usr/lib64/python2.6/shlex.py", line 269, in next
    token = self.get_token()
  File "/usr/lib64/python2.6/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib64/python2.6/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"
ValueError: No closing quotation
[16 Jul 2014 4:30] Philip Olson
Fixed as of the upcoming MySQL Utilities/Fabric 1.4.4 release, and here's the changelog entry:

The "mysqluc" utility would suddenly exit when a command was wrongly
formatted, like when a closing quote was missing. This action now
generates a warning instead of exiting from the console, which allows the
command to be edited.

Thank you for the bug report.