Bug 622552

Summary: Python 2.7 xmlrpclib breaks bzr due to API change
Product: [Fedora] Fedora Reporter: Tom "spot" Callaway <tcallawa>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: a.badger, dmalcolm, henrik, ivazqueznet, james.antill, jonathansteffan, peter.hutterer, swilmet
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-04 01:20:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 620817    

Description Tom "spot" Callaway 2010-08-09 17:40:01 UTC
Description of problem:

[spot@pterodactyl master]$ bzr export -r 794 gwibber-794bzr.tar.gz lp:gwibber
bzr: ERROR: exceptions.AttributeError: addinfourl instance has no attribute 'getheader'

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/bzrlib/commands.py", line 1111, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib64/python2.7/site-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib64/python2.7/site-packages/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/bzrlib/builtins.py", line 2838, in run
    b, subdir = Branch.open_containing(branch_or_subdir)
  File "/usr/lib64/python2.7/site-packages/bzrlib/branch.py", line 189, in open_containing
    possible_transports)
  File "/usr/lib64/python2.7/site-packages/bzrlib/bzrdir.py", line 966, in open_containing
    transport = get_transport(url, possible_transports)
  File "/usr/lib64/python2.7/site-packages/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/bzrlib/transport/__init__.py", line 1569, in get_transport
    base = directories.dereference(base)
  File "/usr/lib64/python2.7/site-packages/bzrlib/directory_service.py", line 58, in dereference
    return service().look_up(name, url)
  File "/usr/lib64/python2.7/site-packages/bzrlib/plugins/launchpad/lp_directory.py", line 59, in look_up
    return self._resolve(url)
  File "/usr/lib64/python2.7/site-packages/bzrlib/plugins/launchpad/lp_directory.py", line 69, in _resolve
    result = resolve.submit(service)
  File "/usr/lib64/python2.7/site-packages/bzrlib/plugins/launchpad/lp_registration.py", line 272, in submit
    self._authenticated)
  File "/usr/lib64/python2.7/site-packages/bzrlib/plugins/launchpad/lp_registration.py", line 195, in send_request
    result = method(*method_params)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/site-packages/bzrlib/plugins/launchpad/lp_registration.py", line 78, in request
    return self.parse_response(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1449, in parse_response
    if response.getheader("Content-Encoding", "") == "gzip":
AttributeError: addinfourl instance has no attribute 'getheader'

bzr 2.2b4 on python 2.7.0 (Linux-2.6.35-0.57.rc6.git1.fc14.x86_64-x86_64-with-fedora-14-Branched)
arguments: ['/usr/bin/bzr', 'export', '-r', '794', 'gwibber-794bzr.tar.gz', 'lp:gwibber']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bash_completion      /usr/lib64/python2.7/site-packages/bzrlib/plugins/bash_completion [2.2b4]
  launchpad            /usr/lib64/python2.7/site-packages/bzrlib/plugins/launchpad [2.2b4]
  netrc_credential_store /usr/lib64/python2.7/site-packages/bzrlib/plugins/netrc_credential_store [2.2b4]
  news_merge           /usr/lib64/python2.7/site-packages/bzrlib/plugins/news_merge [2.2b4]

*** Bazaar has encountered an internal error.  This probably indicates a
    bug in Bazaar.  You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.


===========

It looks like this bug is already in the upstream tracker, here:

http://psf.upfronthosting.co.za/roundup/tracker/issue8194

There is a patch in that ticket, and there has been since March. I generated a scratch build with the patch applied here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=2389452

With that scratch build installed, bzr starts working again.

Comment 1 Dave Malcolm 2010-08-10 15:30:11 UTC
This looks similar to bug 619276 and to bug 621298.

Does Koji still work with the scratch build?
Does python-bugzilla still work with the scratch build?

Comment 2 Tom "spot" Callaway 2010-08-13 13:59:00 UTC
I know that koji still works, because I've successfully kicked off builds since installing the scratch python. Can't be sure about python-bugzilla, if there is a good way to test it, I'd be happy to do so.

Comment 3 Henrik Nordström 2010-09-16 08:47:50 UTC
There is also a upstream bzr bug report on this issue:

  https://bugs.launchpad.net/bzr/+bug/612096

As discussed there we can work around the Python2.7 xmprpxlib transport API change by patching bzr.

Comment 4 Toshio Ernie Kuratomi 2010-09-16 14:25:45 UTC
The patch in the merge request was approved for merging to bzr trunk:

https://code.launchpad.net/~toshio/bzr/python27-lp-fix/+merge/35487

Comment 5 Fedora Update System 2010-09-21 13:27:22 UTC
bzr-2.2.1-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/bzr-2.2.1-2.fc14

Comment 6 Fedora Update System 2010-09-23 12:47:21 UTC
bzr-2.2.1-2.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Toshio Ernie Kuratomi 2011-01-04 01:20:26 UTC
I'm closing this as fixed.  If someone thinks this is not fixed, please re-open.