Bug 1311705 - traceback when trying to push
Summary: traceback when trying to push
Alias: None
Product: Fedora
Classification: Fedora
Component: zanata-python-client
Version: rawhide
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Sundeep Anand
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2016-02-24 19:29 UTC by David Lehman
Modified: 2016-05-18 12:09 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-05-18 12:09:32 UTC
Type: Bug

Attachments (Terms of Use)

Description David Lehman 2016-02-24 19:29:19 UTC
Description of problem:
I got a traceback when I tried to run a zanata push command.

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

How reproducible:
1/1 so far.

Steps to Reproduce:
1. run zanata push --srcdir ./po/ --push-type source --force

Actual results:
$ zanata push --srcdir ./po/ --push-type source --force
[INFO] Loading zanata project config from: /home/dlehman/src/blivet/zanata.xml
[INFO] Loading zanata user config from: /home/dlehman/.config/zanata.ini
[INFO] zanata server: https://fedora.zanata.org
[INFO] zanata python client version: UNKNOWN, zanata server API version: 3.8.3
[WARN] Locale mappings are now handled using locale aliases on the server, so locale mappings in the project config file (zanata.xml) are now deprecated.
Please add a locale alias in the project language settings to replace each locale mapping in zanata.xml, then remove the <locales> section from zanata.xml.
[INFO] Project: blivet
[INFO] Version: 2.0
[INFO] Project Type: gettext
[INFO] Username: dlehman
[INFO] Source language: en-US
[INFO] PO directory (originals):./po/
[INFO] This will overwrite/delete any existing documents on the server.
[INFO] Send local translation: False
[INFO] Pushing the content of ./po/blivet.pot to server:
Traceback (most recent call last):
  File "/usr/bin/zanata", line 25, in <module>
  File "/usr/lib/python2.7/site-packages/zanataclient/zanata.py", line 756, in run
  File "/usr/lib/python2.7/site-packages/zanataclient/command.py", line 348, in handle_program
    command(command_options, args)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanata.py", line 391, in run_func
  File "/usr/lib/python2.7/site-packages/zanataclient/pushcmd.py", line 96, in run
    self.zanatacmd.push_command(filelist, tmlfolder, self.project_id, self.version_id, self.copytrans, self.plural_support)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanatacmd.py", line 421, in push_command
    result = self.update_template(project_id, iteration_id, filename, body, copytrans)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanatacmd.py", line 126, in update_template
    result = self.zanata_resource.documents.update_template(project_id, iteration_id, request_name, body, copytrans)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanatalib/docservice.py", line 47, in update_template
    body=resources, headers=self.http_headers, extension=ext)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanatalib/rest/client.py", line 108, in process_request
    return self.request(self.base_url + resource, service_details.http_method, body, headers, extension)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanatalib/rest/client.py", line 57, in request
    body = StringIO(body)
TypeError: initial_value must be unicode or None, not str

Expected results:
No traceback and successful push.

Additional info:

Comment 1 Sundeep Anand 2016-04-13 07:25:48 UTC
Thanks for reporting. Most probably PR https://github.com/zanata/zanata-python-client/pull/44 should fix this.

Planning for a release soon.

Comment 2 Sundeep Anand 2016-04-28 10:16:09 UTC
I hope zanata-python-client-1.5.0-2.fc24 would be available now. Would request you to give it a try.

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