Bug 696468 - Ctrl+C should exit python client quietly
Ctrl+C should exit python client quietly
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-PythonClient (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: James Ni
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-14 01:57 EDT by Sean Flanigan
Modified: 2011-10-27 00:28 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-27 00:28:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sean Flanigan 2011-04-14 01:57:59 EDT
Description of problem:
Interrupting the client with Control-C produces too much error information.  We should avoid printing a traceback in this case.

Version-Release number of selected component (if applicable):
0:1.2.2-1.fc13

How reproducible:
Always

Steps to Reproduce:
1. zanata publican push for a large project
2. interrupt with Ctrl+C
  
Actual results:
^CTraceback (most recent call last):
  File "/usr/bin/zanata", line 26, in <module>
    client.run()
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 1398, in run
    self._push_publican(command_args)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 999, in _push_publican
    self.import_po(publicanutil, trans_folder, zanata, project_id, iteration_id, filename)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 481, in import_po
    result = zanata.documents.commit_translation(project_id, iteration_id, request_name, lang, body)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanatalib/docservice.py", line 151, in commit_translation
    res, content = self.projects.restclient.request_put('/seam/resource/restv1/projects/p/%s/iterations/i/%s/r/%s/translations/%s'%(projectid,iterationid,fileid,localeid), args=resources, headers=headers)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanatalib/rest/client.py", line 49, in request_put
    return self.request(resource, "put", args, body, headers, extension, copytrans = copytrans)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanatalib/rest/client.py", line 72, in request
    response, content = http.request("%s%s%s" % (self.base_url, resource, ext), method.upper(), body, headers=headers)
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 1068, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 872, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python2.6/site-packages/httplib2/__init__.py", line 842, in _conn_request
    response = conn.getresponse()
  File "/usr/lib/python2.6/httplib.py", line 974, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 349, in _read_status
    line = self.fp.readline()
  File "/usr/lib/python2.6/socket.py", line 397, in readline
    data = recv(1)
KeyboardInterrupt


Expected results:
^C

Additional info:
Comment 1 James Ni 2011-05-10 03:44:14 EDT
Add Ctrl+C processing in commit 44a2d22 of devel branch of zanata client on git-hub.
Comment 2 Ding-Yi Chen 2011-07-27 20:59:24 EDT
VERIFIED with zanata-python-client-1.2.6-1.el5

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