From fd93ceef874cadd8ce06dedb5983118910b3e961 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 20 Jun 2018 21:14:51 +0000 Subject: [PATCH 61/64] Python 3 preparation: avoid string.join(). --- frontends/roundup.cgi | 4 ++-- roundup/cgi/apache.py | 2 +- roundup/cgi/cgitb.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontends/roundup.cgi b/frontends/roundup.cgi index 6bfb77e..9988073 100755 --- a/frontends/roundup.cgi +++ b/frontends/roundup.cgi @@ -140,14 +140,14 @@ class RequestWrapper: # Main CGI handler # def main(out, err): - import os, string + import os import roundup.instance path = os.environ.get('PATH_INFO', '/').split('/') request = RequestWrapper(out) request.path = os.environ.get('PATH_INFO', '/') tracker = path[1] os.environ['TRACKER_NAME'] = tracker - os.environ['PATH_INFO'] = string.join(path[2:], '/') + os.environ['PATH_INFO'] = '/'.join(path[2:]) if tracker in TRACKER_HOMES: # redirect if we need a trailing '/' if len(path) == 2: diff --git a/roundup/cgi/apache.py b/roundup/cgi/apache.py index 9cf5dd5..22a1a93 100644 --- a/roundup/cgi/apache.py +++ b/roundup/cgi/apache.py @@ -123,7 +123,7 @@ def handler(req): _env = dict(req.subprocess_env) # XXX classname must be the first item in PATH_INFO. roundup.cgi does: # path = os.environ.get('PATH_INFO', '/').split('/') - # os.environ['PATH_INFO'] = string.join(path[2:], '/') + # os.environ['PATH_INFO'] = '/'.join(path[2:]) # we just remove the first character ('/') _env["PATH_INFO"] = req.path_info[1:] if _timing: diff --git a/roundup/cgi/cgitb.py b/roundup/cgi/cgitb.py index e65bd90..a5ad9cf 100644 --- a/roundup/cgi/cgitb.py +++ b/roundup/cgi/cgitb.py @@ -7,7 +7,7 @@ from __future__ import print_function __docformat__ = 'restructuredtext' -import sys, os, string, keyword, linecache, tokenize, inspect, cgi +import sys, os, keyword, linecache, tokenize, inspect, cgi import pydoc, traceback from roundup.cgi import templating, TranslationService @@ -180,7 +180,7 @@ def html(context=5, i18n=None): name = 'global %s' % name lvals.append('%s = %s'%(name, value)) if lvals: - lvals = string.join(lvals, ', ') + lvals = ', '.join(lvals) lvals = indent + '%s'\ '
'%lvals else: @@ -200,7 +200,7 @@ def html(context=5, i18n=None): if i == lnum: excerpt.append(lvals) i = i + 1 - traceback.append('

' + level + string.join(excerpt, '\n')) + traceback.append('

' + level + '\n'.join(excerpt)) traceback.reverse() @@ -210,7 +210,7 @@ def html(context=5, i18n=None): value = pydoc.html.repr(getattr(evalue, name)) attribs.append('
%s%s = %s' % (indent, name, value)) - return head + string.join(attribs) + string.join(traceback) + '

 

' + return head + ' '.join(attribs) + ' '.join(traceback) + '

 

' def handler(): print(breaker()) -- 2.7.4