dulwich.client.get_transport_and_path sensitive to change in Python's urlparse.urlparse behaviour, causes test failures on <= karmic

Bug #707438 reported by Max Bowsher
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Dulwich
Fix Released
Medium
Max Bowsher

Bug Description

dulwich.client.get_transport_and_path uses urlparse to break apart the url into various parts.

Python's urlparse.urlparse behaviour concerning whether unknown protocols are handled in a netloc-aware manner has changed over time, and the result is that the behaviour of this function differs on <= karmic in ways that cause the testsuite to fail.

This is an obstruction to updating dulwich in the ~bzr PPA for <= karmic.

Related branches

Revision history for this message
Dave Borowitz (dborowitz) wrote :

Sigh, I noticed that urlparse had some weird corner cases, but I thought it would at least be consistent. Can you give examples of URLs and the results of urlparse in different python versions?

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 707438] [NEW] dulwich.client.get_transport_and_path sensitive to change in Python's urlparse.urlparse behaviour, causes test failures on <= karmic

On Tue, 2011-01-25 at 14:27 +0000, Max Bowsher wrote:
> dulwich.client.get_transport_and_path uses urlparse to break apart the
> url into various parts.
>
> Python's urlparse.urlparse behaviour concerning whether unknown
> protocols are handled in a netloc-aware manner has changed over time,
> and the result is that the behaviour of this function differs on <=
> karmic in ways that cause the testsuite to fail.
>
> This is an obstruction to updating dulwich in the ~bzr PPA for <=
> karmic.
We hit this in bzr-git earlier as well. The fix was to monkey patch
urlparse to extend the list of allowed URL schemes. I guess we'll have
to do that in dulwich as well (perhaps just the testsuite? I'm concerned
about modifying global state).

  status triaged
  importance medium

Cheers,

Jelmer

Jelmer Vernooij (jelmer)
Changed in dulwich:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Max Bowsher (maxb) wrote :

The key change appears to be between Python 2.6.4 and 2.6.5 - the urlparse module changed from interpreting the netloc "//" signifier only in a fixed list of schemes, to interpreting it regardless of scheme.

For now, we can fix the tests by appending 'foo' to urlparse.uses_netloc.

It may also be appropriate for dulwich to add 'git' and 'git+ssh' to uses_netloc if not already present - they were added upstream in the post-2.6.5 snapshot version present in maverick

Revision history for this message
Max Bowsher (maxb) wrote :

Whoops, I mis-speak. Adding 'git' and 'git+ssh' will also be required to get the tests passing, so they will presumably be needed to make the actual code function as expected too

Jelmer Vernooij (jelmer)
Changed in dulwich:
status: Triaged → Fix Committed
assignee: nobody → Max Bowsher (maxb)
Jelmer Vernooij (jelmer)
Changed in dulwich:
milestone: none → 0.7.1
milestone: 0.7.1 → none
milestone: none → 0.7.1
Jelmer Vernooij (jelmer)
Changed in dulwich:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.