Commits

Anonymous committed 8e21874

[svn r7277] Fix two issues with special characters in job url:
1. properly handle '%' in url
2. escape non-safe characters in url (such as spaces, non-ascii characters,
etc)

This fixes #6349.

Comments (0)

Files changed (1)

0.10/HudsonTrac/HudsonTracPlugin.py

                           'successfully" etc messages.')
 
     def __init__(self):
-        api_url = self.job_url
+        api_url = urllib2.quote(self.job_url, '/%:@')
         if api_url[-1] != '/':
             api_url += '/'
         api_url += 'api/xml'
                 path  += '|/*/job/module/build[timestamp>=%(start)s][timestamp<=%(stop)s]'
                 depth += 1
 
-        self.info_url = '%s?xpath=%s&depth=%s&exclude=//action|//artifact|//changeSet|//culprit&wrapper=builds' % (api_url, path, depth)
+        self.info_url = '%s?xpath=%s&depth=%s&exclude=//action|//artifact|//changeSet|//culprit&wrapper=builds' % (api_url.replace('%', '%%'), path, depth)
 
         self.env.log.debug("Build-info url: '%s'" % self.info_url)