Merge lp:~andidog/bzr-webdav/trunk into lp:bzr-webdav

Proposed by Andreas Sommer
Status: Merged
Merge reported by: Vincent Ladeuil
Merged at revision: not available
Proposed branch: lp:~andidog/bzr-webdav/trunk
Merge into: lp:bzr-webdav
Diff against target: 16 lines (+3/-2)
1 file modified
webdav.py (+3/-2)
To merge this branch: bzr merge lp:~andidog/bzr-webdav/trunk
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+96339@code.launchpad.net

Description of the change

Fix for change in bzrlib's SSL certificate checking: Parameter ca_certs was added to the Opener class. I added this as keyword argument with default value None, so that the webdav plugin should still work with older Bazaar versions.

See bzr revision "6238.2.22 revid:<email address hidden>" for the change.

To post a comment you must log in.
Revision history for this message
Andreas Sommer (andidog) wrote :

Sorry, in fact it won't work with older versions because I'm also passing that parameter on to the super class.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Thanks for looking into it, but yes, this is most likely unrelated to your push issue. The ca_certs parameter is only relevant for tests (for now).

Revision history for this message
Andreas Sommer (andidog) wrote :

I didn't say this is related to my push issue. Actually I first found out that pushing leads to an exception because of the missing ca_certs parameter (new in the revision I mentioned above). What I posted in the mailing list is something completely different.

I added the ca_certs parameter to __init__ here because the DavOpener class gets assigned to HttpDavTransport._opener_class, which in turn is used as follows (note the construction uses the ca_certs parameter):

class HttpTransport_urllib(http.HttpTransportBase):
    """Python urllib transport for http and https."""

    # In order to debug we have to issue our traces in sync with
    # httplib, which use print :(
    _debuglevel = 0

    _opener_class = Opener

    def __init__(self, base, _from_transport=None, ca_certs=None):
        super(HttpTransport_urllib, self).__init__(
            base, 'urllib', _from_transport=_from_transport)
        if _from_transport is not None:
            self._opener = _from_transport._opener
        else:
            self._opener = self._opener_class(
                report_activity=self._report_activity, ca_certs=ca_certs)

Revision history for this message
Vincent Ladeuil (vila) wrote :

Ooops, damn, will look into this asap :-/

Thanks for the heads-up !

Revision history for this message
Vincent Ladeuil (vila) wrote :

Sorry for the delay, lp:bzr-webdav now contains a moral equivalent of this proposal, thanks again for the heads-up.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'webdav.py'
--- webdav.py 2011-11-18 10:43:21 +0000
+++ webdav.py 2012-03-07 11:57:18 +0000
@@ -387,9 +387,10 @@
387class DavOpener(_urllib2_wrappers.Opener):387class DavOpener(_urllib2_wrappers.Opener):
388 """Dav specific needs regarding HTTP(S)"""388 """Dav specific needs regarding HTTP(S)"""
389389
390 def __init__(self, report_activity=None):390 def __init__(self, report_activity=None, ca_certs=None):
391 super(DavOpener, self).__init__(connection=DavConnectionHandler,391 super(DavOpener, self).__init__(connection=DavConnectionHandler,
392 report_activity=report_activity)392 report_activity=report_activity,
393 ca_certs=ca_certs)
393394
394395
395class HttpDavTransport(_urllib.HttpTransport_urllib):396class HttpDavTransport(_urllib.HttpTransport_urllib):

Subscribers

People subscribed via source and target branches

to all changes: