appy.shared.dav fails on https urls

Bug #913171 reported by Luc Saffre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Appy
Fix Released
Undecided
Unassigned

Bug Description

Hi Gaetan,

the following is the little bug we discovered in Eupen. We did the fix together in my appy copy, now I see that in 0.8.0 it is still there, so I remind you to apply this bugfix to your code.

In appy/shared/dav.py, line 117 is currently:

  urlRex = re.compile(r'http://([^:/]+)(:[0-9]+)?(/.+)?', re.I)

It should be:

  urlRex = re.compile(r'http[s]?://([^:/]+)(:[0-9]+)?(/.+)?', re.I)

to accept also URLs starting with "https:"

And another suggestion for line 142 of the same file:

        else: raise 'Wrong URL: %s' % str(url)

should be replaed by

        else: raise Exception('Wrong URL: %s' % str(url))

because newer Python versions (at least 2.7.1) no longer accept to raise simple strings. If you specify a wrong URL, you wouldn't get an exception "Wrong URL: foo://bar" but the following:

Traceback (most recent call last):
  ...
  File "l:\snapshots\appy-0.8.0\appy\shared\dav.py", line 142, in __init__
    else: raise 'Wrong URL: %s' % str(url)
TypeError: exceptions must be old-style classes or derived from BaseException, not str

Luc

Revision history for this message
Gaëtan Delannay (gaetan-delannay) wrote :

Hi Luc,
OK I've integrated both updates, they will be released in Appy 0.8.1 !
Thanks a lot ;-)
Gaetan

Changed in appy:
status: New → In Progress
Changed in appy:
status: In Progress → 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.