Mock Version: 1.2.17 Mock Version: 1.2.17 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/python-tornado.spec'], chrootPath='/var/lib/mock/centos6-rutgers-staging-build-5312-8316/root'shell=FalseprintOutput=Falseenv={'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'}gid=135user='mockbuild'timeout=86400logger=uid=486) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/python-tornado.spec'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False warning: Could not canonicalize hostname: opus3 Building target platforms: noarch Building for target noarch Wrote: /builddir/build/SRPMS/python-tornado-2.2.1-7.ru6.src.rpm Child return code was: 0 ENTER ['do'](['bash', '--login', '-c', u'/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-tornado.spec'], chrootPath='/var/lib/mock/centos6-rutgers-staging-build-5312-8316/root'shell=Falseuid=486env={'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'}gid=135user='mockbuild'timeout=86400private_network=Truelogger=printOutput=False) Executing command: ['bash', '--login', '-c', u'/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-tornado.spec'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) Building target platforms: noarch Building for target noarch Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.JXjLZ0 + umask 022 + cd /builddir/build/BUILD + LANG=C + export LANG + unset DISPLAY + cd /builddir/build/BUILD + rm -rf tornado-2.2.1 + /usr/bin/gzip -dc /builddir/build/SOURCES/tornado-2.2.1.tar.gz + /bin/tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd tornado-2.2.1 + /bin/chmod -Rf a+rX,u+w,g-w,o-w . Patch #0 (python-tornado-removed-custom-match_hostname.patch): + echo 'Patch #0 (python-tornado-removed-custom-match_hostname.patch):' + /bin/cat /builddir/build/SOURCES/python-tornado-removed-custom-match_hostname.patch + /usr/bin/patch -p1 --fuzz=0 patching file tornado/simple_httpclient.py Hunk #1 succeeded at 7 (offset 1 line). Hunk #2 succeeded at 447 (offset 1 line). + /bin/sed -i.orig -e '/^#!\//, 1d' setup.py tornado/__init__.py tornado/auth.py tornado/autoreload.py tornado/curl_httpclient.py tornado/database.py tornado/escape.py tornado/gen.py tornado/httpclient.py tornado/httpserver.py tornado/httputil.py tornado/ioloop.py tornado/iostream.py tornado/locale.py tornado/netutil.py tornado/options.py tornado/process.py tornado/simple_httpclient.py tornado/stack_context.py tornado/template.py tornado/testing.py tornado/util.py tornado/web.py tornado/websocket.py tornado/wsgi.py tornado/platform/__init__.py tornado/platform/auto.py tornado/platform/interface.py tornado/platform/posix.py tornado/platform/twisted.py tornado/platform/windows.py tornado/test/__init__.py tornado/test/auth_test.py tornado/test/curl_httpclient_test.py tornado/test/escape_test.py tornado/test/gen_test.py tornado/test/httpclient_test.py tornado/test/httpserver_test.py tornado/test/httputil_test.py tornado/test/import_test.py tornado/test/ioloop_test.py tornado/test/iostream_test.py tornado/test/process_test.py tornado/test/run_pyversion_tests.py tornado/test/runtests.py tornado/test/simple_httpclient_test.py tornado/test/stack_context_test.py tornado/test/template_test.py tornado/test/testing_test.py tornado/test/twisted_test.py tornado/test/web_test.py tornado/test/wsgi_test.py + rm -rf /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6 + cp -a . /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6 + find /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6 -name '*.py' + xargs sed -i '1s|^#!python|#!/usr/bin/python3|' + 2to3 --write --nobackups /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6 RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/setup.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/blog.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/markdown.py --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/blog.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/blog.py (refactored) @@ -147,7 +147,7 @@ settings = { - "blog_title": u"Tornado Blog", + "blog_title": "Tornado Blog", "template_path": os.path.join(os.path.dirname(__file__), "templates"), "ui_modules": {"Entry": EntryModule}, "xsrf_cookies": True, --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/markdown.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/markdown.py (refactored) @@ -71,7 +71,7 @@ for i in sequence[::-1]: yield i def _unicode_decode(s, encoding, errors='xmlcharrefreplace'): - return unicode(s, encoding, errors) + return str(s, encoding, errors) else: def _unicode_decode(s, encoding, errors='strict'): return s.decode(encoding, errors) @@ -198,9 +198,9 @@ # articles): self.reset() - if not isinstance(text, unicode): + if not isinstance(text, str): #TODO: perhaps shouldn't presume UTF-8 for string input? - text = unicode(text, 'utf-8') + text = str(text, 'utf-8') if self.use_file_vars: # Look for emacs-style file variable hints. @@ -370,7 +370,7 @@ emacs_vars[variable] = value # Unquote values. - for var, val in emacs_vars.items(): + for var, val in list(emacs_vars.items()): if len(val) > 1 and (val.startswith('"') and val.endswith('"') or val.startswith('"') and val.endswith('"')): emacs_vars[var] = val[1:-1] @@ -485,11 +485,11 @@ # Delimiters for next comment block. try: start_idx = text.index("", start_idx) + 3 - except ValueError, ex: + except ValueError as ex: break # Start position for next comment block search. @@ -779,7 +779,7 @@ return ''.join(tokens) def _unhash_html_spans(self, text): - for key, sanitized in self.html_spans.items(): + for key, sanitized in list(self.html_spans.items()): text = text.replace(key, sanitized) return text @@ -1429,7 +1429,7 @@ return text def _encode_backslash_escapes(self, text): - for ch, escape in g_escape_table.items(): + for ch, escape in list(g_escape_table.items()): text = text.replace("\\"+ch, escape) return text @@ -1504,13 +1504,13 @@ hash = md5(link).hexdigest() link_from_hash[hash] = link text = text[:start] + hash + text[end:] - for hash, link in link_from_hash.items(): + for hash, link in list(link_from_hash.items()): text = text.replace(hash, link) return text def _unescape_special_chars(self, text): # Swap back in all the special characters we've hidden. - for ch, hash in g_escape_table.items(): + for ch, hash in list(g_escape_table.items()): text = text.replace(hash, ch) return text @@ -1569,7 +1569,7 @@ except KeyError: raise ValueError("unsupported regex flag: '%s' in '%s' " "(must be one of '%s')" - % (char, s, ''.join(flag_from_char.keys()))) + % (char, s, ''.join(list(flag_from_char.keys())))) return re.compile(s[1:idx], flags) else: # not an encoded regex return re.compile(re.escape(s)) @@ -1589,8 +1589,8 @@ """ DEBUG = False if DEBUG: - print "dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ - %RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/auth/authdemo.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/benchmark.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/chunk_benchmark.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/template_benchmark.py (tabsize, skip_first_line) + print("dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ + % (tabsize, skip_first_line)) indents = [] margin = None for i, line in enumerate(lines): @@ -1607,12 +1607,12 @@ break else: continue # skip all-whitespace lines - if DEBUG: print "dedent: indent=%d: %r" % (indent, line) + if DEBUG: print("dedent: indent=%d: %r" % (indent, line)) if margin is None: margin = indent else: margin = min(margin, indent) - if DEBUG: print "dedent: margin=%r" % margin + if DEBUG: print("dedent: margin=%r" % margin) if margin is not None and margin > 0: for i, line in enumerate(lines): @@ -1624,7 +1624,7 @@ elif ch == '\t': removed += tabsize - (removed % tabsize) elif ch in '\r\n': - if DEBUG: print "dedent: %r: EOL -> strip up to EOL" % line + if DEBUG: print("dedent: %r: EOL -> strip up to EOL" % line) lines[i] = lines[i][j:] break else: @@ -1632,8 +1632,8 @@ "line %r while removing %d-space margin" % (ch, line, margin)) if DEBUG: - print "dedent: %r: %r -> removed %d/%d"\ - % (line, ch, removed, margin) + print("dedent: %r: %r -> removed %d/%d"\ + % (line, ch, removed, margin)) if removed == margin: lines[i] = lines[i][j+1:] break @@ -1845,13 +1845,13 @@ "Markdown.pl") for path in paths: if opts.compare: - print "==== Markdown.pl ====" + print("==== Markdown.pl ====") perl_cmd = 'perl %s "%s"' % (markdown_pl, path) o = os.popen(perl_cmd) perl_html = o.read() o.close() sys.stdout.write(perl_html) - print "==== markdown2.py ====" + print("==== markdown2.py ====") html = markdown_path(path, encoding=opts.encoding, html4tags=opts.html4tags, safe_mode=opts.safe_mode, @@ -1869,7 +1869,7 @@ else: norm_html = html norm_perl_html = perl_html - print "==== match? %r ====" % (norm_perl_html == norm_html) + print("==== match? %r ====" % (norm_perl_html == norm_html)) if __name__ == "__main__": --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/benchmark.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/benchmark.py (refactored) @@ -51,7 +51,7 @@ def main(): parse_command_line() - for i in xrange(options.num_runs): + for i in range(options.num_runs): run() def run(): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/chunk_benchmark.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/chunk_benchmark.py (refactored) @@ -15,7 +15,7 @@ class ChunkHandler(RequestHandler): def get(self): - for i in xrange(options.num_chunks): + for i in range(options.num_chunks): self.write('A' * options.chunk_size) self.flush() self.finish() --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/template_benchmark.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/template_benchmark.py (refactored) @@ -57,11 +57,11 @@ def main(): parse_command_line() if options.dump: - print tmpl.code + print(tmpl.code) sys.exit(0) t = Timer(render) results = t.timeit(options.num) / options.num - print '%0.3f ms per iteration' % (results*1000) + print('%0.3f ms per iteration' % (results*1000)) if __name__ RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/blog.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/markdown.py == '__main__': main() --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/blog.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/blog.py (refactored) @@ -46,7 +46,7 @@ (r"/auth/logout", AuthLogoutHandler), ] settings = dict( - blog_title=u"Tornado Blog", + blog_title="Tornado Blog", template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.path.dirname(__file__), "static"), ui_modules={"Entry": EntryModule}, --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/markdown.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/markdown.py (refactored) @@ -71,7 +71,7 @@ for i in sequence[::-1]: yield i def _unicode_decode(s, encoding, errors='xmlcharrefreplace'): - return unicode(s, encoding, errors) + return str(s, encoding, errors) else: def _unicode_decode(s, encoding, errors='strict'): return s.decode(encoding, errors) @@ -198,9 +198,9 @@ # articles): self.reset() - if not isinstance(text, unicode): + if not isinstance(text, str): #TODO: perhaps shouldn't presume UTF-8 for string input? - text = unicode(text, 'utf-8') + text = str(text, 'utf-8') if self.use_file_vars: # Look for emacs-style file variable hints. @@ -370,7 +370,7 @@ emacs_vars[variable] = value # Unquote values. - for var, val in emacs_vars.items(): + for var, val in list(emacs_vars.items()): if len(val) > 1 and (val.startswith('"') and val.endswith('"') or val.startswith('"') and val.endswith('"')): emacs_vars[var] = val[1:-1] @@ -485,11 +485,11 @@ # Delimiters for next comment block. try: start_idx = text.index("", start_idx) + 3 - except ValueError, ex: + except ValueError as ex: break # Start position for next comment block search. @@ -779,7 +779,7 @@ return ''.join(tokens) def _unhash_html_spans(self, text): - for key, sanitized in self.html_spans.items(): + for key, sanitized in list(self.html_spans.items()): text = text.replace(key, sanitized) return text @@ -1429,7 +1429,7 @@ return text def _encode_backslash_escapes(self, text): - for ch, escape in g_escape_table.items(): + for ch, escape in list(g_escape_table.items()): text = text.replace("\\"+ch, escape) return text @@ -1504,13 +1504,13 @@ hash = md5(link).hexdigest() link_from_hash[hash] = link text = text[:start] + hash + text[end:] - for hash, link in link_from_hash.items(): + for hash, link in list(link_from_hash.items()): text = text.replace(hash, link) return text def _unescape_special_chars(self, text): # Swap back in all the special characters we've hidden. - for ch, hash in g_escape_table.items(): + for ch, hash in list(g_escape_table.items()): text = text.replace(hash, ch) return text @@ -1569,7 +1569,7 @@ except KeyError: raise ValueError("unsupported regex flag: '%s' in '%s' " "(must be one of '%s')" - % (char, s, ''.join(flag_from_char.keys()))) + % (char, s, ''.join(list(flag_from_char.keys())))) return re.compile(s[1:idx], flags) else: # not an encoded regex return re.compile(re.escape(s)) @@ -1589RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/chat/chatdemo.py RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/facebook/facebook.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/s3server/s3server.py ,8 +1589,8 @@ """ DEBUG = False if DEBUG: - print "dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ - % (tabsize, skip_first_line) + print("dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ + % (tabsize, skip_first_line)) indents = [] margin = None for i, line in enumerate(lines): @@ -1607,12 +1607,12 @@ break else: continue # skip all-whitespace lines - if DEBUG: print "dedent: indent=%d: %r" % (indent, line) + if DEBUG: print("dedent: indent=%d: %r" % (indent, line)) if margin is None: margin = indent else: margin = min(margin, indent) - if DEBUG: print "dedent: margin=%r" % margin + if DEBUG: print("dedent: margin=%r" % margin) if margin is not None and margin > 0: for i, line in enumerate(lines): @@ -1624,7 +1624,7 @@ elif ch == '\t': removed += tabsize - (removed % tabsize) elif ch in '\r\n': - if DEBUG: print "dedent: %r: EOL -> strip up to EOL" % line + if DEBUG: print("dedent: %r: EOL -> strip up to EOL" % line) lines[i] = lines[i][j:] break else: @@ -1632,8 +1632,8 @@ "line %r while removing %d-space margin" % (ch, line, margin)) if DEBUG: - print "dedent: %r: %r -> removed %d/%d"\ - % (line, ch, removed, margin) + print("dedent: %r: %r -> removed %d/%d"\ + % (line, ch, removed, margin)) if removed == margin: lines[i] = lines[i][j+1:] break @@ -1845,13 +1845,13 @@ "Markdown.pl") for path in paths: if opts.compare: - print "==== Markdown.pl ====" + print("==== Markdown.pl ====") perl_cmd = 'perl %s "%s"' % (markdown_pl, path) o = os.popen(perl_cmd) perl_html = o.read() o.close() sys.stdout.write(perl_html) - print "==== markdown2.py ====" + print("==== markdown2.py ====") html = markdown_path(path, encoding=opts.encoding, html4tags=opts.html4tags, safe_mode=opts.safe_mode, @@ -1869,7 +1869,7 @@ else: norm_html = html norm_perl_html = perl_html - print "==== match? %r ====" % (norm_perl_html == norm_html) + print("==== match? %r ====" % (norm_perl_html == norm_html)) if __name__ == "__main__": --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/chat/chatdemo.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/chat/chatdemo.py (refactored) @@ -70,7 +70,7 @@ cls = MessageMixin if cursor: index = 0 - for i in xrange(len(cls.cache)): + for i in range(len(cls.cache)): index = len(cls.cache) - i - 1 if cls.cache[index]["id"] == cursor: break recent = cls.cache[index + 1:] --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/s3server/s3server.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/s3server/s3server.py (refactored) @@ -36,7 +36,7 @@ import hashlib import os import os.path -import urllib +import urllib.request, urllib.parse, urllib.error from tornado import escape from tornado import httpserver @@ -77,24 +77,24 @@ def render_xml(self, value): assert isinstance(value, dict) and len(value) == 1 self.set_header("Content-Type", "application/xml; charset=UTF-8") - name = value.keys()[0] + name = list(value.keys())[0] parts = [] parts.append('<' + escape.utf8(name) + ' xmlns="http://docRefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/__init__.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/auth.py .s3.amazonaws.com/2006-03-01">') - self._render_parts(value.values()[0], parts) + self._render_parts(list(value.values())[0], parts) parts.append('') self.finish('\n' + ''.join(parts)) def _render_parts(self, value, parts=[]): - if isinstance(value, (unicode, bytes_type)): + if isinstance(value, (str, bytes_type)): parts.append(escape.xhtml_escape(value)) - elif isinstance(value, int) or isinstance(value, long): + elif isinstance(value, int) or isinstance(value, int): parts.append(str(value)) elif isinstance(value, datetime.datetime): parts.append(value.strftime("%Y-%m-%dT%H:%M:%S.000Z")) elif isinstance(value, dict): - for name, subvalue in value.iteritems(): + for name, subvalue in value.items(): if not isinstance(subvalue, list): subvalue = [subvalue] for subsubvalue in subvalue: @@ -135,8 +135,8 @@ class BucketHandler(BaseRequestHandler): def get(self, bucket_name): - prefix = self.get_argument("prefix", u"") - marker = self.get_argument("marker", u"") + prefix = self.get_argument("prefix", "") + marker = self.get_argument("marker", "") max_keys = int(self.get_argument("max-keys", 50000)) path = os.path.abspath(os.path.join(self.application.directory, bucket_name)) @@ -212,7 +212,7 @@ class ObjectHandler(BaseRequestHandler): def get(self, bucket, object_name): - object_name = urllib.unquote(object_name) + object_name = urllib.parse.unquote(object_name) path = self._object_path(bucket, object_name) if not path.startswith(self.application.directory) or \ not os.path.isfile(path): @@ -228,7 +228,7 @@ object_file.close() def put(self, bucket, object_name): - object_name = urllib.unquote(object_name) + object_name = urllib.parse.unquote(object_name) bucket_dir = os.path.abspath(os.path.join( self.application.directory, bucket)) if not bucket_dir.startswith(self.application.directory) or \ @@ -246,7 +246,7 @@ self.finish() def delete(self, bucket, object_name): - object_name = urllib.unquote(object_name) + object_name = urllib.parse.unquote(object_name) path = self._object_path(bucket, object_name) if not path.startswith(self.application.directory) or \ not os.path.isfile(path): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/auth.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/auth.py (refactored) @@ -49,8 +49,8 @@ import hmac import logging import time -import urllib -import urlparse +import urllib.request, urllib.parse, urllib.error +import urllib.parse import uuid from tornado import httpclient @@ -77,7 +77,7 @@ """ callback_uri = callback_uri or self.request.uri args = self._openid_args(callback_uri, ax_attrs=ax_attrs) - self.redirect(self._OPENID_ENDPOINT + "?" + urllib.urlencode(args)) + self.redirect(self._OPENID_ENDPOINT + "?" + urllib.parse.urlencode(args)) def get_authenticated_user(self, callback, http_client=None): """Fetches the authenticated user data upon redirect. @@ -87,16 +87,16 @@ methods. """ # Verify the OpenID response via direct request to the OP - args = dict((k, v[-1]) for k, v in self.request.arguments.iteritems()) - args["openid.mode"] = u"check_authentication" + args = dict((k, v[-1]) for k, v in self.request.arguments.items()) + args["openid.mode"] = "check_authentication" url = self._OPENID_ENDPOINT if http_client is None: http_client = httpclient.AsyncHTTPClient() http_client.fetch(url, self.async_callback( self._on_authentication_verified, callback), - method="POST", body=urllib.urlencode(args)) + method="POST", body=urllib.parse.urlencode(args)) def _openid_args(self, callback_uri, ax_attrs=[], oauth_scope=None): - url = urlparse.urljoin(self.request.full_url(), callback_uri) + url = urllib.parse.urljoin(self.request.full_url(), callback_uri) args = { "openid.ns": "http://specs.openid.net/auth/2.0", "openid.claimed_id": @@ -104,7 +104,7 @@ "openid.identity": "http://specs.openid.net/auth/2.0/identifier_select", "openid.return_to": url, - "openid.realm": urlparse.urljoin(url, '/'), + "openid.realm": urllib.parse.urljoin(url, '/'), "openid.mode": "checkid_setup", } if ax_attrs: @@ -152,22 +152,22 @@ # Make sure we got back at least an email from attribute exchange ax_ns = None - for name in self.request.arguments.iterkeys(): + for name in self.request.arguments.keys(): if name.startswith("openid.ns.") and \ - self.get_argument(name) == u"http://openid.net/srv/ax/1.0": + self.get_argument(name) == "http://openid.net/srv/ax/1.0": ax_ns = name[10:] break def get_ax_arg(uri): - if not ax_ns: return u"" + if not ax_ns: return "" prefix = "openid." + ax_ns + ".type." ax_name = None - for name in self.request.arguments.iterkeys(): + for name in self.request.arguments.keys(): if self.get_argument(name) == uri and name.startswith(prefix): part = name[len(prefix):] ax_name = "openid." + ax_ns + ".value." + part break - if not ax_name: return u"" - return self.get_argument(ax_name, u"") + if not ax_name: return "" + return self.get_argument(ax_name, "") email = get_ax_arg("http://axschema.org/contact/email") name = get_ax_arg("http://axschema.org/namePerson") @@ -186,7 +186,7 @@ if name: user["name"] = name elif name_parts: - user["name"] = u" ".join(name_parts) + user["name"] = " ".join(name_parts) elif email: user["name"] = email.split("@")[0] if email: user["email"] = email @@ -280,7 +280,7 @@ ) if getattr(self, "_OAUTH_VERSION", "1.0a") == "1.0a": if callback_uri: - args["oauth_callback"] = urlparse.urljoin( + args["oauth_callback"] = urllib.parse.urljoin( self.request.full_url(), callback_uri) if extra_params: args.update(extra_params) signature = _oauth10a_signature(consumer_token, "GET", url, args) @@ -288,7 +288,7 @@ signature = _oauth_signature(consumer_token, "GET", url, args) args["oauth_signature"] = signature - return url + "?" + urllib.urlencode(args) + return url + "?" + urllib.parse.urlencode(args) def _on_request_token(self, authorize_url, callback_uri, response): if response.error: @@ -299,9 +299,9 @@ self.set_cookie("_oauth_request_token", data) args = dict(oauth_token=request_token["key"]) if callback_uri: - args["oauth_callback"] = urlparse.urljoin( + args["oauth_callback"] = urllib.parse.urljoin( self.request.full_url(), callback_uri) - self.redirect(authorize_url + "?" + urllib.urlencode(args)) + self.redirect(authorize_url + "?" + urllib.parse.urlencode(args)) def _oauth_access_token_url(self, request_token): consumer_token = self._oauth_consumer_token() @@ -325,7 +325,7 @@ request_token) args["oauth_signature"] = signature - return url + "?" + urllib.urlencode(args) + return url + "?" + urllib.parse.urlencode(args) def _on_access_token(self, callback, response): if response.error: @@ -513,11 +513,11 @@ oauth = self._oauth_request_parameters( url, access_token, all_args, method=method) args.update(oauth) - if args: url += "?" + urllib.urlencode(args) + if args: url += "?" + urllib.parse.urlencode(args) callback = self.async_callback(self._on_twitter_request, callback) http = httpclient.AsyncHTTPClient() if post_args is not None: - http.fetch(url, method="POST", body=urllib.urlencode(post_args), + http.fetch(url, method="POST", body=urllib.parse.urlencode(post_args), callback=callback) else: http.fetch(url, callback=callback) @@ -635,11 +635,11 @@ oauth = self._oauth_request_parameters( url, access_token, all_args, method=method) args.update(oauth) - if args: url += "?" + urllib.urlencode(args) + if args: url += "?" + urllib.parse.urlencode(args) callback = self.async_callback(self._on_friendfeed_request, callback) http = httpclient.AsyncHTTPClient() if post_args is not None: - http.fetch(url, method="POST", body=urllib.urlencode(post_args), + http.fetch(url, method="POST", body=urllib.parse.urlencode(post_args), callback=callback) else: http.fetch(url, callback=callback) @@ -715,15 +715,15 @@ callback_uri = callback_uri or self.request.uri args = self._openid_args(callback_uri, ax_attrs=ax_attrs, oauth_scope=oauth_scope) - self.redirect(self._OPENID_ENDPOINT + "?" + urllib.urlencode(args)) + self.redirect(self._OPENID_ENDPOINT + "?" + urllib.parse.urlencode(args)) def get_authenticated_user(self, callback): """Fetches the authenticated user data upon redirect.""" # Look to see if we are doing combined OpenID/OAuth oauth_ns = "" - for name, values in self.request.arguments.iteritems(): + for name, values in self.request.arguments.items(): if name.startswith("openid.ns.") and \ - values[-1] == u"http://specs.openid.net/extensions/oauth/1.0": + values[-1] == "http://specs.openid.net/extensions/oauth/1.0": oauth_ns = name[10:] break token = self.get_argument("openid." + oauth_ns + ".request_token", "") @@ -789,18 +789,18 @@ "v": "1.0", "fbconnect": "true", "display": "page", - "next": urlparse.urljoin(self.request.full_url(), callback_uri), + "next": urllib.parse.urljoin(self.request.full_url(), callback_uri), "return_session": "true", } if cancel_uri: - args["cancel_url"] = urlparse.urljoin( + args["cancel_url"] = urllib.parse.urljoin( self.request.full_url(), cancel_uri) if extended_permissions: - if isinstance(extended_permissions, (unicode, bytes_type)): + if isinstance(extended_permissions, (str, bytes_type)): extended_permissions = [extended_permissions] args["req_perms"] = ",".join(extended_permissions) self.redirect("http://www.facebook.com/login.php?" + - urllib.urlencode(args)) + urllib.parse.urlencode(args)) def authorize_redirect(self, extended_permissions, callback_uri=None, cancel_uri=None): @@ -878,11 +878,11 @@ args["api_key"] = self.settings["facebook_api_key"] args["v"] = "1.0" args["method"] = method - args["call_id"] = str(long(time.time() * 1e6)) + args["call_id"] = str(int(time.time() * 1e6)) args["format"] = "json" args["sig"] = self._signature(args) url = "http://api.facebook.com/restserver.php?" + \ - urllib.urlencode(args) + urllib.parse.urlencode(args) RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/autoreload.py http = httpclient.AsyncHTTPClient() http.fetch(url, callback=self.async_callback( self._parse_response, callback)) @@ -925,7 +925,7 @@ def _signature(self, args): parts = ["%s=%s" % (n, args[n]) for n in sorted(args.keys())] body = "".join(parts) + self.settings["facebook_secret"] - if isinstance(body, unicode): body = body.encode("utf-8") + if isinstance(body, str): body = body.encode("utf-8") return hashlib.md5(body).hexdigest() class FacebookGraphMixin(OAuth2Mixin): @@ -1052,11 +1052,11 @@ all_args["access_token"] = access_token all_args.update(args) all_args.update(post_args or {}) - if all_args: url += "?" + urllib.urlencode(all_args) + if all_args: url += "?" + urllib.parse.urlencode(all_args) callback = self.async_callback(self._on_facebook_request, callback) http = httpclient.AsyncHTTPClient() if post_args is not None: - http.fetch(url, method="POST", body=urllib.urlencode(post_args), + http.fetch(url, method="POST", body=urllib.parse.urlencode(post_args), callback=callback) else: http.fetch(url, callback=callback) @@ -1074,7 +1074,7 @@ See http://oauth.net/core/1.0/#signing_process """ - parts = urlparse.urlparse(url) + parts = urllib.parse.urlparse(url) scheme, netloc, path = parts[:3] normalized_url = scheme.lower() + "://" + netloc.lower() + path @@ -1097,7 +1097,7 @@ See http://oauth.net/core/1.0a/#signing_process """ - parts = urlparse.urlparse(url) + parts = urllib.parse.urlparse(url) scheme, netloc, path = parts[:3] normalized_url = scheme.lower() + "://" + netloc.lower() + path @@ -1108,17 +1108,17 @@ for k, v in sorted(parameters.items()))) base_string = "&".join(_oauth_escape(e) for e in base_elems) - key_elems = [escape.utf8(urllib.quote(consumer_token["secret"], safe='~'))] - key_elems.append(escape.utf8(urllib.quote(token["secret"], safe='~') if token else "")) + key_elems = [escape.utf8(urllib.parse.quote(consumer_token["secret"], safe='~'))] + key_elems.append(escape.utf8(urllib.parse.quote(token["secret"], safe='~') if token else "")) key = b("&").join(key_elems) hash = hmac.new(key, escape.utf8(base_string), hashlib.sha1) return binascii.b2a_base64(hash.digest())[:-1] def _oauth_escape(val): - if isinstance(val, unicode): + if isinstance(val, str): val = val.encode("utf-8") - return urllib.quote(val, safe="~") + return urllib.parse.quote(val, safe="~") def _oauth_parse_response(body): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/autoreload.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/autoreload.py (refactored) @@ -25,7 +25,7 @@ multi-process mode is used. """ -from __future__ import with_statement + import functools import logging @@ -89,7 +89,7 @@ _reload_hooks.append(fn) def _close_all_fds(io_loop): - for fd in io_loop._handlers.keys(): + for fd in list(io_loop._handlers.keys()): try: os.close(fd) except Exception: @@ -106,7 +106,7 @@ # processes restarted themselves, they'd all restart and then # all call fork_processes again. return - for module in sys.modules.values(): + for module in list(sys.modules.values()): # Some modules play games with sys.modules (e.g. email/__init__.py # in the standard library), and occasionally this can cause strange # failures in getattr. Just ignore anything that's not an ordinary @@ -196,7 +196,7 @@ script = sys.argv[1] sys.argv = sys.argv[1:] else: - print >>sys.stderr, _USAGE + print(_USAGE, file=sys.stderr) sys.exit(1) try: @@ -210,10 +210,10 @@ # Use globals as our "locals" dictionary so that # something that tries to importRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/curl_httpclient.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/database.py __main__ (e.g. the unittest # module) will see the right things. - exec f.read() in globals(), globals() - except SystemExit, e: + exec(f.read(), globals(), globals()) + except SystemExit as e: logging.info("Script exited with status %s", e.code) - except Exception, e: + except Exception as e: logging.warning("Script exited with uncaught exception", exc_info=True) if isinstance(e, SyntaxError): watch(e.filename) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/curl_httpclient.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/curl_httpclient.py (refactored) @@ -15,9 +15,9 @@ """Blocking and non-blocking HTTP client implementations using pycurl.""" -from __future__ import with_statement - -import cStringIO + + +import io import collections import logging import pycurl @@ -39,7 +39,7 @@ self._multi.setopt(pycurl.M_TIMERFUNCTION, self._set_timeout) self._multi.setopt(pycurl.M_SOCKETFUNCTION, self._handle_socket) self._curls = [_curl_create(max_simultaneous_connections) - for i in xrange(max_clients)] + for i in range(max_clients)] self._free_list = self._curls[:] self._requests = collections.deque() self._fds = {} @@ -120,7 +120,7 @@ while True: try: ret, num_handles = self._socket_action(fd, action) - except pycurl.error, e: + except pycurl.error as e: ret = e.args[0] if ret != pycurl.E_CALL_MULTI_PERFORM: break @@ -134,7 +134,7 @@ try: ret, num_handles = self._socket_action( pycurl.SOCKET_TIMEOUT, 0) - except pycurl.error, e: + except pycurl.error as e: ret = e.args[0] if ret != pycurl.E_CALL_MULTI_PERFORM: break @@ -165,7 +165,7 @@ while True: try: ret, num_handles = self._multi.socket_all() - except pycurl.error, e: + except pycurl.error as e: ret = e.args[0] if ret != pycurl.E_CALL_MULTI_PERFORM: break @@ -195,7 +195,7 @@ (request, callback) = self._requests.popleft() curl.info = { "headers": httputil.HTTPHeaders(), - "buffer": cStringIO.StringIO(), + "buffer": io.StringIO(), "request": request, "callback": callback, "curl_start_time": time.time(), @@ -293,7 +293,7 @@ [utf8("%s: %s" % i) for i in request.headers.get_all()]) else: curl.setopt(pycurl.HTTPHEADER, - [utf8("%s: %s" % i) for i in request.headers.iteritems()]) + [utf8("%s: %s" % i) for i in request.headers.items()]) if request.header_callback: curl.setopt(pycurl.HEADERFUNCTION, request.header_callback) @@ -359,7 +359,7 @@ "HEAD": pycurl.NOBODY, } custom_methods = set(["DELETE"]) - for o in curl_options.values(): + for o in list(curl_options.values()): curl.setopt(o, False) if request.method in curl_options: curl.unsetopt(pycurl.CUSTOMREQUEST) @@ -371,7 +371,7 @@ # Handle curl's cryptic options for every individual HTTP method if request.method in ("POST", "PUT"): - request_buffer = cStringIO.StringIO(utf8(request.body)) + request_buffer = io.StringIO(utf8(request.body)) curl.setopt(pycurl.READFUNCTION, request_buffer.read) if request.method == "POST": def ioctl(cmd): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/database.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/database.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/escape.py (refactored) @@ -98,7 +98,7 @@ self._execute(cursor, query, parameters) column_names = [d[0] for d in cursor.description] for row in cursor: - yield Row(zip(column_names, row)) + yield Row(list(zip(column_names, row))) finally: cursor.close() @@ -108,7 +108,7 @@ try: self._execute(cursor, query, parameters) column_names = [d[0] for d in cursor.description] - return [Row(itertools.izip(column_names, row)) for row in cursor] + return [Row(zip(column_names, row)) for row in cursor] finally: cursor.close() --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/escape.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/escape.py (refactored) @@ -19,17 +19,17 @@ have crept in over time. """ -import htmlentitydefs +import html.entities import re import sys -import urllib +import urllib.request, urllib.parse, urllib.error # Python3 compatibility: On python2.5, introduce the bytes alias from 2.6 try: bytes except Exception: bytes = str try: - from urlparse import parse_qs # Python 2.6+ + from urllib.parse import parse_qs # Python 2.6+ except ImportError: from cgi import parse_qs @@ -95,7 +95,7 @@ def url_escape(value): """Returns a valid URL-encoded version of the given value.""" - return urllib.quote_plus(utf8(value)) + return urllib.parse.quote_plus(utf8(value)) # python 3 changed things around enough that we need two separate # implementations of url_unescape. We also need our own implementation @@ -110,9 +110,9 @@ the result is a unicode string in the specified encoding. """ if encoding is None: - return urllib.unquote_plus(utf8(value)) + return urllib.parse.unquote_plus(utf8(value)) else: - return unicode(urllib.unquote_plus(utf8(value)), encoding) + return str(urllib.parse.unquote_plus(utf8(value)), encoding) parse_qs_bytes = parse_qs else: @@ -127,7 +127,7 @@ if encoding is None: return urllib.parse.unquote_to_bytes(value) else: - return urllib.unquote_plus(to_basestring(value), encoding=encoding) + return urllib.parse.unquote_plus(to_basestring(value), encoding=encoding) def parse_qs_bytes(qs, keep_blank_values=False, strict_parsing=False): """Parses a query string like urlparse.parse_qs, but returns the @@ -142,7 +142,7 @@ result = parse_qs(qs, keep_blank_values, strict_parsing, encoding='latin1', errors='strict') encoded = {} - for k,v in result.iteritems(): + for k,v in result.items(): encoded[k] = [i.encode('latin1') for i in v] return encoded @@ -157,10 +157,10 @@ """ if isinstance(value, _UTF8_TYPES): return value - assert isinstance(value, unicode) + assert isinstance(value, str) return value.encode("utf-8") -_TO_UNICODE_TYPES = (unicode, type(None)) +_TO_UNICODE_TYPES = (str, type(None)) def to_unicode(value): """Converts a string argument to a unicode string. @@ -178,12 +178,12 @@ # When dealing with the standard library across python 2 and 3 it is # sometimes useful to have a direct conversion to the native string type -if str is unicode: +if str is str: native_str = to_unicode else: native_str = utf8 -_BASESTRING_TYPES = (basestring, type(None)) +_BASESTRING_TYPES = (str, type(None)) def to_basestring(value): """Converts a string argument to a subclass of basestring. @@ -204,7 +204,7 @@ Supports lists, tuples, and dictionaries. """ if isinstance(obj, dict): - return dict((recursive_unicode(k), recursive_unicode(v)) for (k,v) in obj.iteritems()) + return dict((recursive_unicode(k), recursive_unicode(v)) for (k,v) in obj.items()) elif isinstance(obj, list): return list(recursive_unicode(i) for i in oRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/gen.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpclient.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpserver.py bj) elif isinstance(obj, tuple): @@ -219,7 +219,7 @@ # but it gets all exponential on certain patterns (such as too many trailing # dots), causing the regex matcher to never return. # This regex should avoid those problems. -_URL_RE = re.compile(ur"""\b((?:([\w-]+):(/{1,3})|www[.])(?:(?:(?:[^\s&()]|&|")*(?:[^!"#$%&'()*+,.:;<=>?@\[\]^`{|}~\s]))|(?:\((?:[^\s&()]|&|")*\)))+)""") +_URL_RE = re.compile(r"""\b((?:([\w-]+):(/{1,3})|www[.])(?:(?:(?:[^\s&()]|&|")*(?:[^!"#$%&'()*+,.:;<=>?@\[\]^`{|}~\s]))|(?:\((?:[^\s&()]|&|")*\)))+)""") def linkify(text, shorten=False, extra_params="", @@ -296,7 +296,7 @@ # have a status bar, such as Safari by default) params += ' title="%s"' % href - return u'%s' % (href, params, url) + return '%s' % (href, params, url) # First HTML-escape so that our strings are all safe. # The regex is modified to avoid character entites other than & so @@ -308,7 +308,7 @@ def _convert_entity(m): if m.group(1) == "#": try: - return unichr(int(m.group(2))) + return chr(int(m.group(2))) except ValueError: return "&#%s;" % m.group(2) try: @@ -319,8 +319,8 @@ def _build_unicode_map(): unicode_map = {} - for name, value in htmlentitydefs.name2codepoint.iteritems(): - unicode_map[name] = unichr(value) + for name, value in html.entities.name2codepoint.items(): + unicode_map[name] = chr(value) return unicode_map _HTML_UNICODE_MAP = _build_unicode_map() --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/gen.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/gen.py (refactored) @@ -62,7 +62,7 @@ called with more than one argument or any keyword arguments, the result is an `Arguments` object, which is a named tuple ``(args, kwargs)``. """ -from __future__ import with_statement + import functools import operator --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpclient.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpclient.py (refactored) @@ -31,7 +31,7 @@ import calendar import email.utils -import httplib +import http.client import time import weakref @@ -193,7 +193,7 @@ AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient") """ - if isinstance(impl, (unicode, bytes_type)): + if isinstance(impl, (str, bytes_type)): impl = import_object(impl) if impl is not None and not issubclass(impl, AsyncHTTPClient): raise ValueError("Invalid AsyncHTTPClient implementation") @@ -363,7 +363,7 @@ raise self.error def __repr__(self): - args = ",".join("%s=%r" % i for i in self.__dict__.iteritems()) + args = ",".join("%s=%r" % i for i in self.__dict__.items()) return "%s(%s)" % (self.__class__.__name__, args) @@ -383,7 +383,7 @@ """ def __init__(self, code, message=None, response=None): self.code = code - message = message or httplib.responses.get(code, "Unknown") + message = message or http.client.responses.get(code, "Unknown") self.response = response Exception.__init__(self, "HTTP %d: %s" % (self.code, message)) @@ -402,15 +402,15 @@ follow_redirects=options.follow_redirects, validate_cert=options.validate_cert, ) - except HTTPError, e: + except HTTPError as e: if e.response is not None: response = e.response else: raise if options.print_headers: - print response.headers + print(response.headers) if options.print_body: - print response.body + print(response.body) client.close() if __name__ == "__main__": --- /builddir/buRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httputil.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/ioloop.py ild/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpserver.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpserver.py (refactored) @@ -23,11 +23,11 @@ `tornado.web.RequestHandler.request`. """ -import Cookie +import http.cookies import logging import socket import time -import urlparse +import urllib.parse from tornado.escape import utf8, native_str, parse_qs_bytes from tornado import httputil @@ -247,7 +247,7 @@ return self.request_callback(self._request) - except _BadRequestException, e: + except _BadRequestException as e: logging.info("Malformed HTTP request from %s: %s", self.address[0], e) self.stream.close() @@ -259,7 +259,7 @@ if self._request.method in ("POST", "PUT"): if content_type.startswith("application/x-www-form-urlencoded"): arguments = parse_qs_bytes(native_str(self._request.body)) - for name, values in arguments.iteritems(): + for name, values in arguments.items(): values = [v for v in values if v] if values: self._request.arguments.setdefault(name, []).extend( @@ -385,12 +385,12 @@ self._start_time = time.time() self._finish_time = None - scheme, netloc, path, query, fragment = urlparse.urlsplit(native_str(uri)) + scheme, netloc, path, query, fragment = urllib.parse.urlsplit(native_str(uri)) self.path = path self.query = query arguments = parse_qs_bytes(query) self.arguments = {} - for name, values in arguments.iteritems(): + for name, values in arguments.items(): values = [v for v in values if v] if values: self.arguments[name] = values @@ -402,7 +402,7 @@ def cookies(self): """A dictionary of Cookie.Morsel objects.""" if not hasattr(self, "_cookies"): - self._cookies = Cookie.SimpleCookie() + self._cookies = http.cookies.SimpleCookie() if "Cookie" in self.headers: try: self._cookies.load( @@ -467,7 +467,7 @@ socket.SOCK_STREAM, 0, socket.AI_NUMERICHOST) return bool(res) - except socket.gaierror, e: + except socket.gaierror as e: if e.args[0] == socket.EAI_NONAME: return False raise --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httputil.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httputil.py (refactored) @@ -16,7 +16,7 @@ """HTTP utility code shared by clients and servers.""" import logging -import urllib +import urllib.request, urllib.parse, urllib.error import re from tornado.util import b, ObjectDict @@ -80,7 +80,7 @@ If a header has multiple values, multiple pairs will be returned with the same name. """ - for name, list in self._as_list.iteritems(): + for name, list in self._as_list.items(): for value in list: yield (name, value) @@ -140,7 +140,7 @@ def update(self, *args, **kwargs): # dict.update bypasses our __setitem__ - for k, v in dict(*args, **kwargs).iteritems(): + for k, v in dict(*args, **kwargs).items(): self[k] = v _NORMALIZED_HEADER_RE = re.compile(r'^[A-Z0-9][a-z0-9]*(-[A-Z0-9][a-z0-9]*)*$') @@ -174,7 +174,7 @@ if not args: return url if url[-1] not in ('?', '&'): url += '&' if ('?' in url) else '?' - return url + urllib.urlencode(args) + return url + urllib.parse.urlencode(args) class HTTPFile(ObjectDict): @@ -256,7 +256,7 @@ """ parts = _parseparam(';' + line) - key = parts.next() + key = next(parts) pdict = {} for p in parts: i = p.find('=') --- /builddir/build/BUILD/python3-python-tornado-2.2.1-RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/iostream.py 7.ru6/tornado/ioloop.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/ioloop.py (refactored) @@ -25,7 +25,7 @@ `IOLoop.add_timeout` is a non-blocking alternative to `time.sleep`. """ -from __future__ import with_statement + import datetime import errno @@ -33,7 +33,7 @@ import os import logging import select -import thread +import _thread import threading import time import traceback @@ -167,7 +167,7 @@ """ self.remove_handler(self._waker.fileno()) if all_fds: - for fd in self._handlers.keys()[:]: + for fd in list(self._handlers.keys())[:]: try: os.close(fd) except Exception: @@ -237,7 +237,7 @@ if self._stopped: self._stopped = False return - self._thread_ident = thread.get_ident() + self._thread_ident = _thread.get_ident() self._running = True while True: poll_timeout = 3600.0 @@ -279,7 +279,7 @@ try: event_pairs = self._impl.poll(poll_timeout) - except Exception, e: + except Exception as e: # Depending on python version and IOLoop implementation, # different exception types may be thrown and there are # two ways EINTR might be signaled: @@ -305,7 +305,7 @@ fd, events = self._events.popitem() try: self._handlers[fd](fd, events) - except (OSError, IOError), e: + except (OSError, IOError) as e: if e.args[0] == errno.EPIPE: # Happens when the client closes the connection pass @@ -384,7 +384,7 @@ with self._callback_lock: list_empty = not self._callbacks self._callbacks.append(stack_context.wrap(callback)) - if list_empty and thread.get_ident() != self._thread_ident: + if list_empty and _thread.get_ident() != self._thread_ident: # If we're in the IOLoop's thread, we know it's not currently # polling. If we're not, and we added the first callback to an # empty list, we may need to wake it up (it may wake up on its @@ -419,7 +419,7 @@ __slots__ = ['deadline', 'callback'] def __init__(self, deadline, callback): - if isinstance(deadline, (int, long, float)): + if isinstance(deadline, (int, float)): self.deadline = deadline elif isinstance(deadline, datetime.timedelta): self.deadline = time.time() + _Timeout.timedelta_to_seconds(deadline) @@ -575,7 +575,7 @@ events[fd] = events.get(fd, 0) | IOLoop.WRITE if kevent.flags & select.KQ_EV_ERROR: events[fd] = events.get(fd, 0) | IOLoop.ERROR - return events.items() + return list(events.items()) class _Select(object): @@ -618,7 +618,7 @@ events[fd] = events.get(fd, 0) | IOLoop.WRITE for fd in errors: events[fd] = events.get(fd, 0) | IOLoop.ERROR - return events.items() + return list(events.items()) # Choose a poll implementation. Use epoll if it is available, fall back to --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/iostream.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/iostream.py (refactored) @@ -15,7 +15,7 @@ """A utility class to write to and read from a non-blocking socket.""" -from __future__ import with_statement + import collections import errno @@ -117,7 +117,7 @@ self._connecting = True try: self.socket.connect(address) - except socket.error, e: + except socket.error as e: # In non-blocking mode we expect connect() to raise an # exception with EINPROGRESS or EWOULDBLOCK. # @@ -169,7 +169,7 @@ ``callback`` will be empty. """ assert not self._readRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/locale.py _callback, "Already reading" - assert isinstance(num_bytes, (int, long)) + assert isinstance(num_bytes, int) self._read_bytes = num_bytes self._read_callback = stack_context.wrap(callback) self._streaming_callback = stack_context.wrap(streaming_callback) @@ -356,7 +356,7 @@ """ try: chunk = self.socket.recv(self.read_chunk_size) - except socket.error, e: + except socket.error as e: if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN): return None else: @@ -375,7 +375,7 @@ """ try: chunk = self._read_from_socket() - except socket.error, e: + except socket.error as e: # ssl.SSLError is a subclass of socket.error logging.warning("Read error on %d: %s", self.socket.fileno(), e) @@ -451,7 +451,7 @@ len(self._read_buffer[1]))) _merge_prefix(self._read_buffer, new_len) m = self._read_regex.search(self._read_buffer[0]) - _merge_prefix(self._read_buffer, sys.maxint) + _merge_prefix(self._read_buffer, sys.maxsize) m = self._read_regex.search(self._read_buffer[0]) if m: callback = self._read_callback @@ -508,7 +508,7 @@ self._write_buffer_frozen = False _merge_prefix(self._write_buffer, num_bytes) self._write_buffer.popleft() - except socket.error, e: + except socket.error as e: if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN): self._write_buffer_frozen = True break @@ -612,7 +612,7 @@ self._handshake_reading = False self._handshake_writing = False self.socket.do_handshake() - except ssl.SSLError, err: + except ssl.SSLError as err: if err.args[0] == ssl.SSL_ERROR_WANT_READ: self._handshake_reading = True return @@ -626,7 +626,7 @@ logging.warning("SSL Error on %d: %s", self.socket.fileno(), err) return self.close() raise - except socket.error, err: + except socket.error as err: if err.args[0] == errno.ECONNABORTED: return self.close() else: @@ -668,14 +668,14 @@ # called when there is nothing to read, so we have to use # read() instead. chunk = self.socket.read(self.read_chunk_size) - except ssl.SSLError, e: + except ssl.SSLError as e: # SSLError is a subclass of socket.error, so this except # block must come first. if e.args[0] == ssl.SSL_ERROR_WANT_READ: return None else: raise - except socket.error, e: + except socket.error as e: if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN): return None else: --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/locale.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/locale.py (refactored) @@ -74,11 +74,11 @@ global _default_locale global _supported_locales _default_locale = code - _supported_locales = frozenset(_translations.keys() + [_default_locale]) + _supported_locales = frozenset(list(_translations.keys()) + [_default_locale]) def load_translations(directory): - u"""Loads translations from CSV files in a directory. + """Loads translations from CSV files in a directory. Translations are strings with optional Python-style named placeholders (e.g., "My name is %(name)s") and their associated translations. @@ -130,7 +130,7 @@ continue _translations[locale].setdefault(plural, {})[english] = translation f.close() - _supported_locales = frozenset(_translations.keys() + [_default_locale]) + _supported_locales = frozenset(list(_translations.keys()) + [_default_locale]) logging.info("Supported locales: %s", sorted(_supported_locales)) def load_gettext_translations(directory, domain): @@ -163,10 +163,10 @@ os.stat(os.path.join(directory, lang, "LC_MESSAGES", domain+".mo")) _translations[lang] = gettext.translation(domain, directory, languages=[lang]) - except Exception, e: + except Exception as e: logging.error("Cannot load translation for '%s': %s", lang, str(e)) continue - _supported_locales = frozenset(_translations.keys() + [_default_locale]) + _supported_locales = frozenset(list(_translations.keys()) + [_default_locale]) _use_gettext = True logging.info("Supported locales: %s", sorted(_supported_locales)) @@ -221,7 +221,7 @@ def __init__(self, code, translations): self.code = code - self.name = LOCALE_NAMES.get(code, {}).get("name", u"Unknown") + self.name = LOCALE_NAMES.get(code, {}).get("name", "Unknown") self.rtl = False for prefix in ["fa", "ar", "he"]: if self.code.startswith(prefix): @@ -263,7 +263,7 @@ """ if self.code.startswith("ru"): relative = False - if type(date) in (int, long, float): + if type(date) in (int, int, float): date = datetime.datetime.utcfromtimestamp(date) now = datetime.datetime.utcnow() if date > now: @@ -321,7 +321,7 @@ str_time = "%d:%02d" % (local_date.hour, local_date.minute) elif self.code == "zh_CN": str_time = "%s%d:%02d" % ( - (u'\u4e0a\u5348', u'\u4e0b\u5348')[local_date.hour >= 12], + ('\u4e0a\u5348', '\u4e0b\u5348')[local_date.hour >= 12], local_date.hour % 12 or 12, local_date.minute) else: str_time = "%d:%02d %s" % ( @@ -365,7 +365,7 @@ _ = self.translate if len(parts) == 0: return "" if len(parts) == 1: return parts[0] - comma = u' \u0648 ' if self.code.startswith("fa") else u", " + comma = ' \u0648 ' if self.code.startswith("fa") else ", " return _("%(commas)s and %(last)s") % { "commas": comma.join(parts[:-1]), "last": parts[len(parts) - 1], @@ -406,66 +406,66 @@ return self.translations.ugettext(message) LOCALE_NAMES = { - "af_ZA": {"name_en": u"Afrikaans", "name": u"Afrikaans"}, - "am_ET": {"name_en": u"Amharic", "name": u'\u12a0\u121b\u122d\u129b'}, - "ar_AR": {"name_en": u"Arabic", "name": u"\u0627\u0644\u0639\u0631\u0628\u064a\u0629"}, - "bg_BG": {"name_en": u"Bulgarian", "name": u"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"}, - "bn_IN": {"name_en": u"Bengali", "name": u"\u09ac\u09be\u0982\u09b2\u09be"}, - "bs_BA": {"name_en": u"Bosnian", "name": u"Bosanski"}, - "ca_ES": {"name_en": u"Catalan", "name": u"Catal\xe0"}, - "cs_CZ": {"name_en": u"Czech", "name": u"\u010ce\u0161tina"}, - "cy_GB": {"name_en": u"Welsh", "name": u"Cymraeg"}, - "da_DK": {"name_en": u"Danish", "name": u"Dansk"}, - "de_DE": {"name_en": u"German", "name": u"Deutsch"}, - "el_GR": {"name_en": u"Greek", "name": u"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"}, - "en_GB": {"name_en": u"English (UK)", "name": u"English (UK)"}, - "en_US": {"name_en": u"English (US)", "name": u"English (US)"}, - "es_ES": {"name_en": u"Spanish (Spain)", "name": u"Espa\xf1ol (Espa\xf1a)"}, - "es_LA": {"name_en": u"Spanish", "name": u"Espa\xf1ol"}, - "et_EE": {"name_en": u"Estonian", "name": u"Eesti"}, - "eu_ES": {"name_en": u"Basque", "name": u"Euskara"}, - "fa_IR": {"name_en": u"Persian", "name": u"\u0641\u0627\u0631\u0633\u06cc"}, - "fi_FI": {"name_en": u"Finnish", "name": u"Suomi"}, - "fr_CA": {"name_en": u"French (Canada)", "name": u"Fran\xe7ais (Canada)"}, - "fr_FR": {"name_en": u"French", "name": u"Fran\xe7ais"}, - "ga_IE": {"name_en": u"Irish", "name": u"Gaeilge"}, - "gl_ES": {"name_en": u"Galician", "name": u"Galego"}, - "he_IL": {"name_en": u"Hebrew", "name": u"\u05e2\u05d1\u05e8\u05d9\u05ea"}, - "hi_IN": {"name_en": u"Hindi", "name": u"\u0939\u093f\u0928\u094d\u0926\u0940"}, - "hr_HR": {"name_en": u"Croatian", "name": u"Hrvatski"}, - "hu_HU": {"name_en": u"Hungarian", "name": u"Magyar"}, - "id_ID": {"name_en": u"Indonesian", "name": u"Bahasa Indonesia"}, - "is_IS": {"name_en": u"Icelandic", "name": u"\xcdslenska"}, - "it_IT": {"name_en": u"Italian", "name": u"Italiano"}, - "ja_JP": {"name_en": u"Japanese", "name": u"\u65e5\u672c\u8a9e"}, - "ko_KR": {"name_en": u"Korean", "name": u"\ud55c\uad6d\uc5b4"}, - "lt_LT": {"name_en": u"Lithuanian", "name": u"Lietuvi\u0173"}, - "lv_LV": {"name_en": u"Latvian", "name": u"Latvie\u0161u"}, - "mk_MK": {"name_en": u"Macedonian", "name": u"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438"}, - "ml_IN": {"name_en": u"Malayalam", "name": u"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02"}, - "ms_MY": {"name_en": u"Malay", "name": u"Bahasa Melayu"}, - "nb_NO": {"name_en": u"Norwegian (bokmal)", "name": u"Norsk (bokm\xe5l)"}, - "nl_NL": {"name_en": u"Dutch", "name": u"Nederlands"}, - "nn_NO": {"name_en": u"Norwegian (nynorsk)", "name": u"Norsk (nynorsk)"}, - "pa_IN": {"name_en": u"Punjabi", "name": u"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40"}, - "pl_PL": {"name_en": u"Polish", "name": u"Polski"}, - "pt_BR": {"name_en": u"Portuguese (Brazil)", "name": u"Portugu\xeas (Brasil)"}, - "pt_PT": {"name_en": u"Portuguese (Portugal)", "name": u"Portugu\xeas (Portugal)"}, - "ro_RO": {"name_en": u"Romanian", "name": u"Rom\xe2n\u0103"}, - "ru_RU": {"name_en": u"Russian", "name": u"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"}, - "sk_SK": {"name_en": u"Slovak", "name": u"Sloven\u010dina"}, - "sl_SI": {"name_en": u"Slovenian", "name": u"Sloven\u0161\u010dina"}, - "sq_AL": {"name_en": u"Albanian", "name": u"Shqip"}, - "sr_RS": {"name_en": u"Serbian", "name": u"\u0421\u0440\u043f\u0441\u043a\u0438"}, - "sv_SE": {"name_en": u"Swedish", "name": u"Svenska"}, - "sw_KE": {"name_en": u"Swahili", "name": u"Kiswahili"}, - "ta_IN": {"name_en": u"Tamil", "name": u"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd"}, - "te_IN": {"name_en": u"Telugu", "name": u"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"}, - "th_TH": {"name_en": u"Thai", "name": u"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22"}, - "tl_PH": {"name_en": u"Filipino", "name": u"Filipino"}, - "tr_TR": {"name_en": u"Turkish", "name": u"T\xfcrk\xe7e"}, - "uk_UA": {"name_en": u"Ukraini ", "name": u"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"}, - "vi_VN": {"name_en": u"Vietnamese", "name": u"Ti\u1ebfng Vi\u1ec7t"}, - "zh_CN": {"name_en": u"Chinese (Simplified)", "name": u"\u4e2d\u6587(\u7b80\u4f53)"}, - "zh_TW": {"name_en": u"Chinese (Traditional)", "name": u"\u4e2d\u6587(\u7e41\u9ad4)"}, + "af_ZA": {"name_en": "Afrikaans", "name": "Afrikaans"}, + "am_ET": {"name_en": "Amharic", "name": '\u12a0\u121b\u122d\u129b'}, + "ar_AR": {"name_en": "Arabic", "name": "\u0627\u0644\u0639\u0631\u0628\u064a\u0629"}, + "bg_BG": {"name_en": "Bulgarian", "name": "\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"}, + "bn_IN": {"name_en": "Bengali", "name": "\u09ac\u09be\u0982\u09b2\u09be"}, + "bs_BA": {"name_en": "Bosnian", "name": "Bosanski"}, + "ca_ES": {"name_en": "Catalan", "name": "Catal\xe0"}, + "cs_CZ": {"name_en": "Czech", "name": "\u010ce\u0161tina"}, + "cy_GB": {"name_en": "Welsh", "name": "Cymraeg"}, + "da_DK": {"name_en": "Danish", "name": "Dansk"}, + "de_DE": {"name_en": "German", "name": "Deutsch"}, + "el_GR": {"name_en": "Greek", "name": "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"}, + "en_GB": {"name_en": "English (UK)", "name": "English (UK)"}, + "en_US": {"name_en": "English (US)", "name": "English (US)"}, + "es_ES": {"name_en": "Spanish (Spain)", "name": "Espa\xf1ol (Espa\xf1a)"}, + "es_LA": {"name_en": "Spanish", "name": "Espa\xf1ol"}, + RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/netutil.py "et_EE": {"name_en": "Estonian", "name": "Eesti"}, + "eu_ES": {"name_en": "Basque", "name": "Euskara"}, + "fa_IR": {"name_en": "Persian", "name": "\u0641\u0627\u0631\u0633\u06cc"}, + "fi_FI": {"name_en": "Finnish", "name": "Suomi"}, + "fr_CA": {"name_en": "French (Canada)", "name": "Fran\xe7ais (Canada)"}, + "fr_FR": {"name_en": "French", "name": "Fran\xe7ais"}, + "ga_IE": {"name_en": "Irish", "name": "Gaeilge"}, + "gl_ES": {"name_en": "Galician", "name": "Galego"}, + "he_IL": {"name_en": "Hebrew", "name": "\u05e2\u05d1\u05e8\u05d9\u05ea"}, + "hi_IN": {"name_en": "Hindi", "name": "\u0939\u093f\u0928\u094d\u0926\u0940"}, + "hr_HR": {"name_en": "Croatian", "name": "Hrvatski"}, + "hu_HU": {"name_en": "Hungarian", "name": "Magyar"}, + "id_ID": {"name_en": "Indonesian", "name": "Bahasa Indonesia"}, + "is_IS": {"name_en": "Icelandic", "name": "\xcdslenska"}, + "it_IT": {"name_en": "Italian", "name": "Italiano"}, + "ja_JP": {"name_en": "Japanese", "name": "\u65e5\u672c\u8a9e"}, + "ko_KR": {"name_en": "Korean", "name": "\ud55c\uad6d\uc5b4"}, + "lt_LT": {"name_en": "Lithuanian", "name": "Lietuvi\u0173"}, + "lv_LV": {"name_en": "Latvian", "name": "Latvie\u0161u"}, + "mk_MK": {"name_en": "Macedonian", "name": "\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438"}, + "ml_IN": {"name_en": "Malayalam", "name": "\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02"}, + "ms_MY": {"name_en": "Malay", "name": "Bahasa Melayu"}, + "nb_NO": {"name_en": "Norwegian (bokmal)", "name": "Norsk (bokm\xe5l)"}, + "nl_NL": {"name_en": "Dutch", "name": "Nederlands"}, + "nn_NO": {"name_en": "Norwegian (nynorsk)", "name": "Norsk (nynorsk)"}, + "pa_IN": {"name_en": "Punjabi", "name": "\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40"}, + "pl_PL": {"name_en": "Polish", "name": "Polski"}, + "pt_BR": {"name_en": "Portuguese (Brazil)", "name": "Portugu\xeas (Brasil)"}, + "pt_PT": {"name_en": "Portuguese (Portugal)", "name": "Portugu\xeas (Portugal)"}, + "ro_RO": {"name_en": "Romanian", "name": "Rom\xe2n\u0103"}, + "ru_RU": {"name_en": "Russian", "name": "\u0420\u0443\u0441\u0441\u043a\u0438\u0439"}, + "sk_SK": {"name_en": "Slovak", "name": "Sloven\u010dina"}, + "sl_SI": {"name_en": "Slovenian", "name": "Sloven\u0161\u010dina"}, + "sq_AL": {"name_en": "Albanian", "name": "Shqip"}, + "sr_RS": {"name_en": "Serbian", "name": "\u0421\u0440\u043f\u0441\u043a\u0438"}, + "sv_SE": {"name_en": "Swedish", "name": "Svenska"}, + "sw_KE": {"name_en": "Swahili", "name": "Kiswahili"}, + "ta_IN": {"name_en": "Tamil", "name": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd"}, + "te_IN": {"name_en": "Telugu", "name": "\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"}, + "th_TH": {"name_en": "Thai", "name": "\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22"}, + "tl_PH": {"name_en": "Filipino", "name": "Filipino"}, + "tr_TR": {"name_en": "Turkish", "name": "T\xfcrk\xe7e"}, + "uk_UA": {"name_en": "Ukraini ", "name": "\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"}, + "vi_VN": {"name_en": "Vietnamese", "name": "Ti\u1ebfng Vi\u1ec7t"}, + "zh_CN": {"name_en": "Chinese (Simplified)", "name": "\u4e2d\u6587(\u7b80\u4f53)"}, + "zh_TW": {"name_en": "Chinese (Traditional)", "name": "\u4e2d\u6587(\u7e41\u9ad4)"}, } --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/netutil.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/netutil.py (refactored) @@ -180,7 +180,7 @@ Requests currently in progress may still continue after the server is stopped. """ - for fd, sock in self._sockets.iteritems(): + for fd, sock in self._sockets.items(): self.io_loop.remove_handler(fd) sock.close() @@ -196,12 +196,12 @@ server_side=True, do_handshake_on_connect=False, **self.ssl_options) - except ssl.SSLError, err: + except ssl.SSLError as RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/options.py err: if err.args[0] == ssl.SSL_ERROR_EOF: return connection.close() else: raise - except socket.error, err: + except socket.error as err: if err.args[0] == errno.ECONNABORTED: return connection.close() else: @@ -267,7 +267,7 @@ return sockets if hasattr(socket, 'AF_UNIX'): - def bind_unix_socket(file, mode=0600, backlog=128): + def bind_unix_socket(file, mode=0o600, backlog=128): """Creates a listening unix socket. If a socket with the given name already exists, it will be deleted. @@ -283,7 +283,7 @@ sock.setblocking(0) try: st = os.stat(file) - except OSError, err: + except OSError as err: if err.errno != errno.ENOENT: raise else: @@ -311,7 +311,7 @@ while True: try: connection, address = sock.accept() - except socket.error, e: + except socket.error as e: if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN): return raise --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/options.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/options.py (refactored) @@ -115,7 +115,7 @@ """ if args is None: args = sys.argv remaining = [] - for i in xrange(1, len(args)): + for i in range(1, len(args)): # All things after the last option are command line arguments if not args[i].startswith("-"): remaining = args[i:] @@ -151,7 +151,7 @@ def parse_config_file(path): """Parses and loads the Python config file at the given path.""" config = {} - execfile(path, config, config) + exec(compile(open(path).read(), path, 'exec'), config, config) for name in config: if name in options: options[name].set(config[name]) @@ -159,22 +159,22 @@ def print_help(file=sys.stdout): """Prints all the command line options to stdout.""" - print >> file, "Usage: %s [OPTIONS]" % sys.argv[0] - print >> file, "" - print >> file, "Options:" + print("Usage: %s [OPTIONS]" % sys.argv[0], file=file) + print("", file=file) + print("Options:", file=file) by_group = {} - for option in options.itervalues(): + for option in options.values(): by_group.setdefault(option.group_name, []).append(option) for filename, o in sorted(by_group.items()): - if filename: print >> file, filename + if filename: print(filename, file=file) o.sort(key=lambda option: option.name) for option in o: prefix = option.name if option.metavar: prefix += "=" + option.metavar - print >> file, " --%-30s %s" % (prefix, option.help or "") - print >> file + print(" --%-30s %s" % (prefix, option.help or ""), file=file) + print(file=file) class _Options(dict): @@ -220,12 +220,12 @@ if self._value is None: self._value = [] for part in value.split(","): - if self.type in (int, long): + if self.type in (int, int): # allow ranges of the form X:Y (inclusive at both ends) lo, _, hi = part.partition(":") lo = _parse(lo) hi = _parse(hi) if hi else lo - self._value.extend(range(lo, hi+1)) + self._value.extend(list(range(lo, hi+1))) else: self._value.append(_parse(part)) else: @@ -363,23 +363,23 @@ fg_color = (curses.tigetstr("setaf") or curses.tigetstr("setf") or "") if (3, 0) < sys.version_info < (3, 2, 3): - fg_color = unicode(fg_color, "ascii") + fg_color = str(fg_color, "ascii") self._colors = { - RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/process.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/simple_httpclient.py logging.DEBUG: unicode(curses.tparm(fg_color, 4), # Blue + logging.DEBUG: str(curses.tparm(fg_color, 4), # Blue "ascii"), - logging.INFO: unicode(curses.tparm(fg_color, 2), # Green + logging.INFO: str(curses.tparm(fg_color, 2), # Green "ascii"), - logging.WARNING: unicode(curses.tparm(fg_color, 3), # Yellow + logging.WARNING: str(curses.tparm(fg_color, 3), # Yellow "ascii"), - logging.ERROR: unicode(curses.tparm(fg_color, 1), # Red + logging.ERROR: str(curses.tparm(fg_color, 1), # Red "ascii"), } - self._normal = unicode(curses.tigetstr("sgr0"), "ascii") + self._normal = str(curses.tigetstr("sgr0"), "ascii") def format(self, record): try: record.message = record.getMessage() - except Exception, e: + except Exception as e: record.message = "Bad message (%r): %r" % (e, record.__dict__) record.asctime = time.strftime( "%y%m%d %H:%M:%S", self.converter(record.created)) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/process.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/process.py (refactored) @@ -52,7 +52,7 @@ # random.seed (at least as of python 2.6). If os.urandom is not # available, we mix in the pid in addition to a timestamp. try: - seed = long(hexlify(os.urandom(16)), 16) + seed = int(hexlify(os.urandom(16)), 16) except NotImplementedError: seed = int(time.time() * 1000) ^ os.getpid() random.seed(seed) @@ -112,7 +112,7 @@ while children: try: pid, status = os.wait() - except OSError, e: + except OSError as e: if e.errno == errno.EINTR: continue raise --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/simple_httpclient.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/simple_httpclient.py (refactored) @@ -1,4 +1,4 @@ -from __future__ import with_statement + from tornado.escape import utf8, _unicode, native_str from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPClient, main @@ -19,13 +19,13 @@ import socket import sys import time -import urlparse +import urllib.parse import zlib try: from io import BytesIO # python 3 except ImportError: - from cStringIO import StringIO as BytesIO # python 2 + from io import StringIO as BytesIO # python 2 try: import ssl # python 2.6+ @@ -138,7 +138,7 @@ # Timeout handle returned by IOLoop.add_timeout self._timeout = None with stack_context.StackContext(self.cleanup): - parsed = urlparse.urlsplit(_unicode(self.request.url)) + parsed = urllib.parse.urlsplit(_unicode(self.request.url)) if ssl is None and parsed.scheme == "https": raise ValueError("HTTPS requires either python2.6+ or " "curl_httpclient") @@ -308,7 +308,7 @@ def cleanup(self): try: yield - except Exception, e: + except Exception as e: logging.warning("uncaught exception", exc_info=True) self._run_callback(HTTPResponse(self.request, 599, error=e, request_time=time.time() - self.start_time, @@ -382,7 +382,7 @@ self.request.max_redirects > 0 and self.code in (301, 302, 303, 307)): new_request = copy.copy(self.request) - new_request.url = urlparse.urljoin(self.request.url, + new_request.url = urllib.parse.urljoin(self.request.url, self.headers["Location"]) new_request.max_redirects -= 1 del new_request.headers["RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/stack_context.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/template.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/testing.py Host"] --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/stack_context.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/stack_context.py (refactored) @@ -65,7 +65,7 @@ block that references your `StackContext`. ''' -from __future__ import with_statement + import contextlib import functools @@ -186,7 +186,7 @@ # NullContext to clear the state and then recreate from contexts. elif (len(_state.contexts) > len(contexts) or any(a[1] is not b[1] - for a, b in itertools.izip(_state.contexts, contexts))): + for a, b in zip(_state.contexts, contexts))): # contexts have been removed or changed, so start over new_contexts = ([NullContext()] + [cls(arg) for (cls,arg) in contexts]) @@ -239,5 +239,5 @@ # Don't rely on sys.exc_info() still containing # the right information. Another exception may # have been raised and caught by an exit method - raise exc[0], exc[1], exc[2] - + raise exc[0](exc[1]).with_traceback(exc[2]) + --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/template.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/template.py (refactored) @@ -171,9 +171,9 @@ Same as the python ``while`` statement. """ -from __future__ import with_statement - -import cStringIO + + +import io import datetime import linecache import logging @@ -234,7 +234,7 @@ "linkify": escape.linkify, "datetime": datetime, "_utf8": escape.utf8, # for internal use - "_string_types": (unicode, bytes_type), + "_string_types": (str, bytes_type), # __name__ and __loader__ allow the traceback mechanism to find # the generated source code. "__name__": self.name.replace('.', '_'), @@ -242,7 +242,7 @@ } namespace.update(self.namespace) namespace.update(kwargs) - exec self.compiled in namespace + exec(self.compiled, namespace) execute = namespace["_execute"] # Clear the traceback module's cache of source data now that # we've generated a new template (mainly for this module's @@ -256,7 +256,7 @@ raise def _generate_python(self, loader, compress_whitespace): - buffer = cStringIO.StringIO() + buffer = io.StringIO() try: # named_blocks maps from names to _NamedBlock objects named_blocks = {} @@ -607,7 +607,7 @@ ancestors = ["%s:%d" % (tmpl.name, lineno) for (tmpl, lineno) in self.include_stack] line_comment += ' (via %s)' % ', '.join(reversed(ancestors)) - print >> self.file, " "*indent + line + line_comment + print(" "*indent + line + line_comment, file=self.file) class _TemplateReader(object): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/testing.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/testing.py (refactored) @@ -17,9 +17,9 @@ information. """ -from __future__ import with_statement - -from cStringIO import StringIO + + +from io import StringIO try: from tornado.httpclient import AsyncHTTPClient from tornado.httpserver import HTTPServer @@ -186,9 +186,9 @@ # 2to3 isn't smart enough to convert three-argument raise # statements correctly in some cases. if isinstance(self.__failure[1], self.__failure[0]): - raise self.__failure[1], None, self.__failure[2] + raise self.__failure[1](None).with_traceback(self.__failure[2]) else: - raise self.__failure[0], self.__failure[1], self.__failure[2] + raise self.__failure[0](self.__failure[1]).with_traceback(self.__failure[2]) result = self.__stop_args self.__stop_args = None return result @@ -353,7 +353,7 @RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/util.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/web.py @ signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__' and len(argv) == 1: - print >> sys.stderr, "No tests specified" + print("No tests specified", file=sys.stderr) sys.exit(1) try: # In order to be able to run tests by their fully-qualified name @@ -366,7 +366,7 @@ unittest.main(module=None, argv=argv) else: unittest.main(defaultTest="all", argv=argv) - except SystemExit, e: + except SystemExit as e: if e.code == 0: logging.info('PASS') else: --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/util.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/util.py (refactored) @@ -33,7 +33,7 @@ # to convert our string literals. b() should only be applied to literal # latin1 strings. Once we drop support for 2.5, we can remove this function # and just use byte literals. -if str is unicode: +if str is str: def b(s): return s.encode('latin1') bytes_type = bytes --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/web.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/web.py (refactored) @@ -48,9 +48,9 @@ back to the main thread before finishing the request. """ -from __future__ import with_statement - -import Cookie + + +import http.cookies import base64 import binascii import calendar @@ -60,7 +60,7 @@ import gzip import hashlib import hmac -import httplib +import http.client import itertools import logging import mimetypes @@ -73,8 +73,8 @@ import tornado import traceback import types -import urllib -import urlparse +import urllib.request, urllib.parse, urllib.error +import urllib.parse import uuid from tornado import escape @@ -87,7 +87,7 @@ try: from io import BytesIO # python 3 except ImportError: - from cStringIO import StringIO as BytesIO # python 2 + from io import StringIO as BytesIO # python 2 class RequestHandler(object): """Subclass this class and define get() or post() to make a handler. @@ -109,14 +109,14 @@ self._auto_finish = True self._transforms = None # will be set in _execute self.ui = ObjectDict((n, self._ui_method(m)) for n, m in - application.ui_methods.iteritems()) + application.ui_methods.items()) # UIModules are available as both `modules` and `_modules` in the # template namespace. Historically only `modules` was available # but could be clobbered by user additions to the namespace. # The template {% module %} directive looks in `_modules` to avoid # possible conflicts. self.ui["_modules"] = ObjectDict((n, self._ui_module(n, m)) for n, m in - application.ui_modules.iteritems()) + application.ui_modules.items()) self.ui["modules"] = self.ui["_modules"] self.clear() # Check since connection is not available in WSGI @@ -234,7 +234,7 @@ def set_status(self, status_code): """Sets the status code for our response.""" - assert status_code in httplib.responses + assert status_code in http.client.responses self._status_code = status_code def get_status(self): @@ -261,9 +261,9 @@ def _convert_header_value(self, value): if isinstance(value, bytes_type): pass - elif isinstance(value, unicode): + elif isinstance(value, str): value = value.encode('utf-8') - elif isinstance(value, (int, long)): + elif isinstance(value, int): # return immediately since we know the converted value will be safe return str(value) elif isinstance(value, datetime.datetime): @@ -308,7 +308,7 @@ values = [] for v in self.request.arguments.get(name, []): v = self.decode_argument(v, name=name) - if isinstance(v, unicode): + if isinstance(v, str): # Get rid of any weird control chars (unless decoding gave # us bytes, in which case leave it alone) v = re.sub(r"[\x00-\x08\x0e-\x1f]", " ", v) @@ -359,7 +359,7 @@ raise ValueError("Invalid cookie %r: %r" % (name, value)) if not hasattr(self, "_new_cookies"): self._new_cookies = [] - new_cookie = Cookie.SimpleCookie() + new_cookie = http.cookies.SimpleCookie() self._new_cookies.append(new_cookie) new_cookie[name] = value if domain: @@ -373,7 +373,7 @@ timestamp, localtime=False, usegmt=True) if path: new_cookie[name]["path"] = path - for k, v in kwargs.iteritems(): + for k, v in kwargs.items(): if k == 'max_age': k = 'max-age' new_cookie[name][k] = v @@ -385,7 +385,7 @@ def clear_all_cookies(self): """Deletes all the cookies the user sent with this request.""" - for name in self.request.cookies.iterkeys(): + for name in self.request.cookies.keys(): self.clear_cookie(name) def set_secure_cookie(self, name, value, expires_days=30, **kwargs): @@ -439,7 +439,7 @@ self.set_status(status) # Remove whitespace url = re.sub(b(r"[\x00-\x20]+"), "", utf8(url)) - self.set_header("Location", urlparse.urljoin(utf8(self.request.uri), + self.set_header("Location", urllib.parse.urljoin(utf8(self.request.uri), url)) self.finish() @@ -479,12 +479,12 @@ css_files = [] html_heads = [] html_bodies = [] - for module in getattr(self, "_active_modules", {}).itervalues(): + for module in getattr(self, "_active_modules", {}).values(): embed_part = module.embedded_javascript() if embed_part: js_embed.append(utf8(embed_part)) file_part = module.javascript_files() if file_part: - if isinstance(file_part, (unicode, bytes_type)): + if isinstance(file_part, (str, bytes_type)): js_files.append(file_part) else: js_files.extend(file_part) @@ -492,7 +492,7 @@ if embed_part: css_embed.append(utf8(embed_part)) file_part = module.css_files() if file_part: - if isinstance(file_part, (unicode, bytes_type)): + if isinstance(file_part, (str, bytes_type)): css_files.append(file_part) else: css_files.extend(file_part) @@ -719,7 +719,7 @@ kwargs['exception'] = exc_info[1] try: # Put the traceback into sys.exc_info() - raise exc_info[0], exc_info[1], exc_info[2] + raise exc_info[0](exc_info[1]).with_traceback(exc_info[2]) except Exception: self.finish(self.get_error_html(status_code, **kwargs)) else: @@ -735,7 +735,7 @@ self.finish("%(code)d: %(message)s" "%(code)d: %(message)s" % { "code": status_code, - "message": httplib.responses[status_code], + "message": http.client.responses[status_code], }) @property @@ -783,7 +783,7 @@ score = 1.0 locales.append((parts[0], score)) if locales: - locales.sort(key=lambda (l, s): s, reverse=True) + locales.sort(key=lambda l_s: l_s[1], reverse=True) codes = [l[0] for l in locales] return locale.get(*codes) return locale.get(default) @@ -928,7 +928,7 @@ def wrapper(*args, **kwargs): try: return callback(*args, **kwargs) - except Exception, e: + except Exception as e: if self._headers_written: logging.error("Exception after headers written", exc_info=True) @@ -963,7 +963,7 @@ # the exception value instead of the full triple, # so re-raise the exception to ensure that it's in # sys.exc_info() - raise type, value, traceback + raise type(value).with_traceback(traceback) except Exception: self._handle_request_exception(value) return True @@ -983,21 +983,21 @@ if not self._finished: args = [self.decode_argument(arg) for arg in args] kwargs = dict((k, self.decode_argument(v, name=k)) - for (k,v) in kwargs.iteritems()) + for (k,v) in kwargs.items()) getattr(self, self.request.method.lower())(*args, **kwargs) if self._auto_finish and not self._finished: self.finish() - except Exception, e: + except Exception as e: self._handle_request_exception(e) def _generate_headers(self): lines = [utf8(self.request.version + " " + str(self._status_code) + - " " + httplib.responses[self._status_code])] + " " + http.client.responses[self._status_code])] lines.extend([(utf8(n) + b(": ") + utf8(v)) for n, v in - itertools.chain(self._headers.iteritems(), self._list_headers)]) + itertools.chain(iter(self._headers.items()), self._list_headers)]) for cookie_dict in getattr(self, "_new_cookies", []): - for cookie in cookie_dict.values(): + for cookie in list(cookie_dict.values()): lines.append(utf8("Set-Cookie: " + cookie.OutputString(None))) return b("\r\n").join(lines) + b("\r\n\r\n") @@ -1020,7 +1020,7 @@ format = "%d %s: " + e.log_message args = [e.status_code, self._request_summary()] + list(e.args) logging.warning(format, *args) - if e.status_code not in httplib.responses: + if e.status_code not in http.client.responses: logging.error("Bad HTTP status code: %d", e.status_code) self.send_error(500, exc_info=sys.exc_info()) else: @@ -1293,7 +1293,7 @@ elif isinstance(methods, list): for m in methods: self._load_ui_methods(m) else: - for name, fn in methods.iteritems(): + for name, fn in methods.items(): if not name.startswith("_") and hasattr(fn, "__call__") \ and name[0].lower() == name[0]: self.ui_methods[name] = fn @@ -1306,7 +1306,7 @@ for m in modules: self._load_ui_modules(m) else: assert isinstance(modules, dict) - for name, cls in modules.iteritems(): + for name, cls in modules.items(): try: if issubclass(cls, UIModule): self.ui_modules[name] = cls @@ -1343,7 +1343,7 @@ if spec.regex.groupindex: kwargs = dict( (k, unquote(v)) - for (k, v) in match.groupdict().iteritems()) + for (k, v) in match.groupdict().items()) else: args = [unquote(s) for s in match.groups()] break @@ -1354,7 +1354,7 @@ # request so you don't need to restart to see changes if self.settings.get("debug"): with RequestHandler._template_loader_lock: - for loader in RequestHandler._template_loaders.values(): + for loader in list(RequestHandler._template_loaders.values()): loader.reset() StaticFileHandler.reset() @@ -1402,7 +1402,7 @@ def _RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/websocket.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/wsgi.py _str__(self): message = "HTTP %d: %s" % ( - self.status_code, httplib.responses[self.status_code]) + self.status_code, http.client.responses[self.status_code]) if self.log_message: return message + " (" + (self.log_message % self.args) + ")" else: @@ -1726,12 +1726,12 @@ if self.request.method in ("GET", "HEAD"): url = self.get_login_url() if "?" not in url: - if urlparse.urlsplit(url).scheme: + if urllib.parse.urlsplit(url).scheme: # if login url is absolute, make next absolute too next_url = self.request.full_url() else: next_url = self.request.uri - url += "?" + urllib.urlencode(dict(next=next_url)) + url += "?" + urllib.parse.urlencode(dict(next=next_url)) self.redirect(url) return raise HTTPError(403) @@ -1836,7 +1836,7 @@ def javascript_files(self): result = [] for f in self._get_resources("javascript_files"): - if isinstance(f, (unicode, bytes_type)): + if isinstance(f, (str, bytes_type)): result.append(f) else: result.extend(f) @@ -1848,7 +1848,7 @@ def css_files(self): result = [] for f in self._get_resources("css_files"): - if isinstance(f, (unicode, bytes_type)): + if isinstance(f, (str, bytes_type)): result.append(f) else: result.extend(f) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/websocket.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/websocket.py (refactored) @@ -103,7 +103,7 @@ # Connection header should be upgrade. Some proxy servers/load balancers # might mess with it. headers = self.request.headers - connection = map(lambda s: s.strip().lower(), headers.get("Connection", "").split(",")) + connection = [s.strip().lower() for s in headers.get("Connection", "").split(",")] if 'upgrade' not in connection: self.stream.write(tornado.escape.utf8( "HTTP/1.1 400 Bad Request\r\n\r\n" @@ -358,7 +358,7 @@ """ fields = ("Origin", "Host", "Sec-Websocket-Key1", "Sec-Websocket-Key2") - if not all(map(lambda f: self.request.headers.get(f), fields)): + if not all([self.request.headers.get(f) for f in fields]): raise ValueError("Missing/Invalid WebSocket headers") def _calculate_part(self, key): @@ -411,7 +411,7 @@ if binary: raise ValueError( "Binary messages not supported by this version of websockets") - if isinstance(message, unicode): + if isinstance(message, str): message = message.encode("utf-8") assert isinstance(message, bytes_type) self.stream.write(b("\x00") + message + b("\xff")) @@ -464,7 +464,7 @@ raised """ fields = ("Host", "Sec-Websocket-Key", "Sec-Websocket-Version") - if not all(map(lambda f: self.request.headers.get(f), fields)): + if not all([self.request.headers.get(f) for f in fields]): raise ValueError("Missing/Invalid WebSocket headers") def _challenge_response(self): @@ -565,7 +565,7 @@ def _on_frame_data(self, data): unmasked = array.array("B", data) - for i in xrange(len(data)): + for i in range(len(data)): unmasked[i] = unmasked[i] ^ self._frame_mask[i % 4] if self._frame_opcode_is_control: --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/wsgi.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/wsgi.py (refactored) @@ -28,14 +28,14 @@ and Tornado handlers in a single server. """ -import Cookie +import http.cookies import cgi -imRefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/interface.py RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/posix.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/twisted.py port httplib +import http.client import logging import sys import time import tornado -import urllib +import urllib.request, urllib.parse, urllib.error from tornado import escape from tornado import httputil @@ -46,7 +46,7 @@ try: from io import BytesIO # python 3 except ImportError: - from cStringIO import StringIO as BytesIO # python 2 + from io import StringIO as BytesIO # python 2 class WSGIApplication(web.Application): """A WSGI equivalent of `tornado.web.Application`. @@ -90,10 +90,10 @@ handler = web.Application.__call__(self, HTTPRequest(environ)) assert handler._finished status = str(handler._status_code) + " " + \ - httplib.responses[handler._status_code] - headers = handler._headers.items() + http.client.responses[handler._status_code] + headers = list(handler._headers.items()) for cookie_dict in getattr(handler, "_new_cookies", []): - for cookie in cookie_dict.values(): + for cookie in list(cookie_dict.values()): headers.append(("Set-Cookie", cookie.OutputString(None))) start_response(status, [(native_str(k), native_str(v)) for (k,v) in headers]) @@ -105,15 +105,15 @@ def __init__(self, environ): """Parses the given WSGI environ to construct the request.""" self.method = environ["REQUEST_METHOD"] - self.path = urllib.quote(environ.get("SCRIPT_NAME", "")) - self.path += urllib.quote(environ.get("PATH_INFO", "")) + self.path = urllib.parse.quote(environ.get("SCRIPT_NAME", "")) + self.path += urllib.parse.quote(environ.get("PATH_INFO", "")) self.uri = self.path self.arguments = {} self.query = environ.get("QUERY_STRING", "") if self.query: self.uri += "?" + self.query arguments = cgi.parse_qs(self.query) - for name, values in arguments.iteritems(): + for name, values in arguments.items(): values = [v for v in values if v] if values: self.arguments[name] = values self.version = "HTTP/1.1" @@ -141,7 +141,7 @@ self.files = {} content_type = self.headers.get("Content-Type", "") if content_type.startswith("application/x-www-form-urlencoded"): - for name, values in cgi.parse_qs(self.body).iteritems(): + for name, values in cgi.parse_qs(self.body).items(): self.arguments.setdefault(name, []).extend(values) elif content_type.startswith("multipart/form-data"): if 'boundary=' in content_type: @@ -163,7 +163,7 @@ def cookies(self): """A dictionary of Cookie.Morsel objects.""" if not hasattr(self, "_cookies"): - self._cookies = Cookie.SimpleCookie() + self._cookies = http.cookies.SimpleCookie() if "Cookie" in self.headers: try: self._cookies.load( @@ -260,7 +260,7 @@ environ = { "REQUEST_METHOD": request.method, "SCRIPT_NAME": "", - "PATH_INFO": urllib.unquote(request.path), + "PATH_INFO": urllib.parse.unquote(request.path), "QUERY_STRING": request.query, "REMOTE_ADDR": request.remote_ip, "SERVER_NAME": host, @@ -278,7 +278,7 @@ environ["CONTENT_TYPE"] = request.headers.pop("Content-Type") if "Content-Length" in request.headers: environ["CONTENT_LENGTH"] = request.headers.pop("Content-Length") - for key, value in request.headers.iteritems(): + for key, value in request.headers.items(): environ["HTTP_" + key.replace("-", "_").upper()] = value return environ --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/twisted.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/twisted.py (refactored) @@ -44,7 +44,7 @@ This module has been tested with Twisted versions 11.0.0 aRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/windows.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/auth_test.py RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/curl_httpclient_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/escape_test.py nd 11.1.0. """ -from __future__ import with_statement, absolute_import + import functools import logging @@ -62,6 +62,7 @@ import tornado.ioloop from tornado.stack_context import NullContext from tornado.ioloop import IOLoop +import collections class TornadoDelayedCall(object): @@ -156,7 +157,7 @@ # IReactorThreads def callFromThread(self, f, *args, **kw): """See `twisted.internet.interfaces.IReactorThreads.callFromThread`""" - assert callable(f), "%s is not callable" % f + assert isinstance(f, collections.Callable), "%s is not callable" % f p = functools.partial(f, *args, **kw) self._io_loop.add_callback(p) @@ -271,10 +272,10 @@ return self._removeAll(self._readers, self._writers) def getReaders(self): - return self._readers.keys() + return list(list(self._readers.keys())) def getWriters(self): - return self._writers.keys() + return list(list(self._writers.keys())) # The following functions are mainly used in twisted-style test cases; # it is expected that most users of the TornadoReactor will call --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/windows.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/windows.py (refactored) @@ -53,7 +53,7 @@ try: self.writer.connect(connect_address) break # success - except socket.error, detail: + except socket.error as detail: if detail[0] != errno.WSAEADDRINUSE: # "Address already in use" is the only error # I've seen on two WinXP Pro SP2 boxes, under --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/auth_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/auth_test.py (refactored) @@ -68,7 +68,7 @@ 'http://www.example.com/api/asdf', dict(key='uiop', secret='5678'), parameters=dict(foo='bar')) - import urllib; urllib.urlencode(params) + import urllib.request, urllib.parse, urllib.error; urllib.parse.urlencode(params) self.write(params) class OAuth1ServerRequestTokenHandler(RequestHandler): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/escape_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/escape_test.py (refactored) @@ -9,115 +9,115 @@ # (input, linkify_kwargs, expected_output) ("hello http://world.com/!", {}, - u'hello http://world.com/!'), + 'hello http://world.com/!'), ("hello http://world.com/with?param=true&stuff=yes", {}, - u'hello http://world.com/with?param=true&stuff=yes'), + 'hello http://world.com/with?param=true&stuff=yes'), # an opened paren followed by many chars killed Gruber's regex ("http://url.com/w(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", {}, - u'http://url.com/w(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), + 'http://url.com/w(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'), # as did too many dots at the end ("http://url.com/withmany.......................................", {}, - u'http://url.com/withmany.......................................'), + 'http://url.com/withmany.......................................'), ("http://url.com/withmany((((((((((((((((((((((((((((((((((a)", {}, - u'http://url.com/withmany((((((((((((((((((((((((((((((((((a)'), + 'http://url.com/withmany((((((((((((((((((((((((((((((((((a)'), # some examples from http://daringfireball.net/2009/11/liberal_regex_for_matching_urls # plus a fex extras (such as multiple parentheses). ("http://foo.com/blah_blah", {}, - u'http://foo.com/blah_blah'), + 'http://foo.com/blah_blah'), ("http://foo.com/blah_blah/", {}, - u'http://foo.com/blah_blah/'), + 'http://foo.com/blah_blah/'), ("(Something like http://foo.com/blah_blah)", {}, - u'(Something like http://foo.com/blah_blah)'), + '(Something like http://foo.com/blah_blah)'), ("http://foo.com/blah_blah_(wikipedia)", {}, - u'http://foo.com/blah_blah_(wikipedia)'), + 'http://foo.com/blah_blah_(wikipedia)'), ("http://foo.com/blah_(blah)_(wikipedia)_blah", {}, - u'http://foo.com/blah_(blah)_(wikipedia)_blah'), + 'http://foo.com/blah_(blah)_(wikipedia)_blah'), ("(Something like http://foo.com/blah_blah_(wikipedia))", {}, - u'(Something like http://foo.com/blah_blah_(wikipedia))'), + '(Something like http://foo.com/blah_blah_(wikipedia))'), ("http://foo.com/blah_blah.", {}, - u'http://foo.com/blah_blah.'), + 'http://foo.com/blah_blah.'), ("http://foo.com/blah_blah/.", {}, - u'http://foo.com/blah_blah/.'), + 'http://foo.com/blah_blah/.'), ("", {}, - u'<http://foo.com/blah_blah>'), + '<http://foo.com/blah_blah>'), ("", {}, - u'<http://foo.com/blah_blah/>'), + '<http://foo.com/blah_blah/>'), ("http://foo.com/blah_blah,", {}, - u'http://foo.com/blah_blah,'), + 'http://foo.com/blah_blah,'), ("http://www.example.com/wpstyle/?p=364.", {}, - u'http://www.example.com/wpstyle/?p=364.'), + 'http://www.example.com/wpstyle/?p=364.'), ("rdar://1234", {"permitted_protocols": ["http", "rdar"]}, - u'rdar://1234'), + 'rdar://1234'), ("rdar:/1234", {"permitted_protocols": ["rdar"]}, - u'rdar:/1234'), + 'rdar:/1234'), ("http://userid:password@example.com:8080", {}, - u'http://userid:password@example.com:8080'), + 'http://userid:password@example.com:8080'), ("http://userid@example.com", {}, - u'http://userid@example.com'), + 'http://userid@example.com'), ("http://userid@example.com:8080", {}, - u'http://userid@example.com:8080'), + 'http://userid@example.com:8080'), ("http://userid:password@example.com", {}, - u'http://userid:password@example.com'), + 'http://userid:password@example.com'), ("message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e", {"permitted_protocols": ["http", "message"]}, - u'message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e'), + 'message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e'), - (u"http://\u27a1.ws/\u4a39", {}, - u'http://\u27a1.ws/\u4a39'), + ("http://\u27a1.ws/\u4a39", {}, + 'http://\u27a1.ws/\u4a39'), ("http://example.com", {}, - u'<tag>http://example.com</tag>'), + '<tag>http://example.com</tag>'), ("Just a www.example.com link.", {}, - u'Just a www.example.com link.'), + 'Just a www.example.com link.'), ("Just a www.example.com link.", {"require_protocol": True}, - u'Just a www.example.com link.'), + 'Just a www.example.com link.'), ("A http://reallylong.com/link/that/exceedsthelenglimit.html", {"require_protocol": True, "shorten": True}, - u'A http://reallylong.com/link...'), + 'A http://reallylong.com/link...'), ("A http://reallylongdomainnamethatwillbetoolong.com/hi!", {"shorten": True}, - u'A http://reallylongdomainnametha...!'), + 'A http://reallylongdomainnametha...!'), ("A file:///passwords.txt and http://web.com link", {}, - u'A file:///passwords.txt and http://web.com link'), + 'A file:///passwords.txt and http://web.com link'), ("A file:///passwords.txt and http://web.com link", {"permitted_protocols": ["file"]}, - u'A file:///passwords.txt and http://web.com link'), + 'A file:///passwords.txt and http://web.com link'), ("www.external-link.com", {"extra_params": 'rel="nofollow" class="external"'}, - u'www.external-link.com'), + 'www.external-link.com'), ] @@ -130,7 +130,7 @@ def test_xhtml_escape(self): tests = [ ("", "<foo>"), - (u"", u"<foo>"), + ("", "<foo>"), (b(""), b("<foo>")), ("<>&\"", "<>&""), @@ -143,20 +143,20 @@ def test_url_escape(self): tests = [ # byte strings are passed through as-is - (u'\u00e9'.encode('utf8'), '%C3%A9'), - (u'\u00e9'.encode('latin1'), '%E9'), + ('\u00e9'.encode('utf8'), '%C3%A9'), + ('\u00e9'.encode('latin1'), '%E9'), # unicode strings become utf8 - (u'\u00e9', '%C3%A9'), + ('\u00e9', '%C3%A9'), ] for unescaped, escaped in tests: self.assertEqual(url_escape(unescaped), escaped) def test_url_unescape(self): tests = [ - ('%C3%A9', u'\u00e9', 'utf8'), - ('%C3%A9', u'\u00c3\u00a9', 'latin1'), - ('%C3%A9', utf8(u'\u00e9'), None), + ('%C3%A9', '\u00e9', 'utf8'), + RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/gen_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpclient_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpserver_test.py ('%C3%A9', '\u00c3\u00a9', 'latin1'), + ('%C3%A9', utf8('\u00e9'), None), ] for escaped, unescaped, encoding in tests: # input strings to url_unescape should only contain ascii @@ -169,20 +169,20 @@ # On python2 the escape methods should generally return the same # type as their argument self.assertEqual(type(xhtml_escape("foo")), str) - self.assertEqual(type(xhtml_escape(u"foo")), unicode) + self.assertEqual(type(xhtml_escape("foo")), str) def test_json_decode(self): # json_decode accepts both bytes and unicode, but strings it returns # are always unicode. - self.assertEqual(json_decode(b('"foo"')), u"foo") - self.assertEqual(json_decode(u'"foo"'), u"foo") + self.assertEqual(json_decode(b('"foo"')), "foo") + self.assertEqual(json_decode('"foo"'), "foo") # Non-ascii bytes are interpreted as utf8 - self.assertEqual(json_decode(utf8(u'"\u00e9"')), u"\u00e9") + self.assertEqual(json_decode(utf8('"\u00e9"')), "\u00e9") def test_json_encode(self): # json deals with strings, not bytes, but our encoding function should # accept bytes as well as long as they are utf8. - self.assertEqual(json_decode(json_encode(u"\u00e9")), u"\u00e9") - self.assertEqual(json_decode(json_encode(utf8(u"\u00e9"))), u"\u00e9") + self.assertEqual(json_decode(json_encode("\u00e9")), "\u00e9") + self.assertEqual(json_decode(json_encode(utf8("\u00e9"))), "\u00e9") self.assertRaises(UnicodeDecodeError, json_encode, b("\xe9")) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpclient_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpclient_test.py (refactored) @@ -1,5 +1,5 @@ -from __future__ import with_statement + import base64 import binascii @@ -159,7 +159,7 @@ response.body) def test_body_encoding(self): - unicode_body = u"\xe9" + unicode_body = "\xe9" byte_body = binascii.a2b_hex(b("e9")) # unicode string in body gets converted to utf8 @@ -179,7 +179,7 @@ # break anything response = self.fetch("/echopost", method="POST", body=byte_body, headers={"Content-Type": "application/blah"}, - user_agent=u"foo") + user_agent="foo") self.assertEqual(response.headers["Content-Length"], "1") self.assertEqual(response.body, byte_body) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpserver_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpserver_test.py (refactored) @@ -194,19 +194,19 @@ b("\r\n").join([ b("Content-Disposition: form-data; name=argument"), b(""), - u"\u00e1".encode("utf-8"), + "\u00e1".encode("utf-8"), b("--1234567890"), - u'Content-Disposition: form-data; name="files"; filename="\u00f3"'.encode("utf8"), + 'Content-Disposition: form-data; name="files"; filename="\u00f3"'.encode("utf8"), b(""), - u"\u00fa".encode("utf-8"), + "\u00fa".encode("utf-8"), b("--1234567890--"), b(""), ])) data = json_decode(response.body) - self.assertEqual(u"\u00e9", data["header"]) - self.assertEqual(u"\u00e1", data["argument"]) - self.assertEqual(u"\u00f3", data["filename"]) - self.assertEqual(u"\u00fa", data["filebody"]) + self.assertEqual("\u00e9", data["header"]) + self.assertEqual("\u00e1", data["argument"]) + self.assertEqual("\u00f3", data["filename"]) + self.assertEqual("\u00fa", data["filebody"]) def test_100_continue(self): RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httputil_test.py RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/import_test.py RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/iostream_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/process_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/run_pyversion_tests.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/simple_httpclient_test.py # Run through a 100-continue interaction by hand: @@ -254,15 +254,15 @@ for field, expected_type in fields: self.check_type(field, getattr(self.request, field), expected_type) - self.check_type('header_key', self.request.headers.keys()[0], str) - self.check_type('header_value', self.request.headers.values()[0], str) - - self.check_type('cookie_key', self.request.cookies.keys()[0], str) - self.check_type('cookie_value', self.request.cookies.values()[0].value, str) + self.check_type('header_key', list(self.request.headers.keys())[0], str) + self.check_type('header_value', list(self.request.headers.values())[0], str) + + self.check_type('cookie_key', list(self.request.cookies.keys())[0], str) + self.check_type('cookie_value', list(self.request.cookies.values())[0].value, str) # secure cookies - self.check_type('arg_key', self.request.arguments.keys()[0], str) - self.check_type('arg_value', self.request.arguments.values()[0][0], bytes_type) + self.check_type('arg_key', list(self.request.arguments.keys())[0], str) + self.check_type('arg_value', list(self.request.arguments.values())[0][0], bytes_type) def post(self): self.check_type('body', self.request.body, bytes_type) @@ -286,7 +286,7 @@ def test_query_string_encoding(self): response = self.fetch("/echo?foo=%C3%A9") data = json_decode(response.body) - self.assertEqual(data, {u"foo": [u"\u00e9"]}) + self.assertEqual(data, {"foo": ["\u00e9"]}) def test_types(self): headers = {"Cookie": "foo=bar"} --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/process_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/process_test.py (refactored) @@ -52,7 +52,7 @@ signal.alarm(5) # master process try: id = fork_processes(3, max_restarts=3) - except SystemExit, e: + except SystemExit as e: # if we exit cleanly from fork_processes, all the child processes # finished with status 0 self.assertEqual(e.code, 0) @@ -81,7 +81,7 @@ def fetch(url, fail_ok=False): try: return client.fetch(get_url(url)) - except HTTPError, e: + except HTTPError as e: if not (fail_ok and e.code == 599): raise --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/run_pyversion_tests.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/run_pyversion_tests.py (refactored) @@ -20,16 +20,16 @@ def main(): for interpreter in INTERPRETERS: - print "=================== %s =======================" % interpreter + print("=================== %s =======================" % interpreter) if not exists_on_path(interpreter): - print "Interpreter not found, skipping..." + print("Interpreter not found, skipping...") continue args = [interpreter, "-m", "tornado.test.runtests"] + sys.argv[1:] ret = subprocess.call(args) if ret != 0: - print "Tests on %s failed with exit code %d" % (interpreter, ret) + print("Tests on %s failed with exit code %d" % (interpreter, ret)) sys.exit(ret) - print "All tests passed" + print("All tests passed") if __name__ == "__main__": main() --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/simple_httpclient_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/simple_httpclient_test.py (refactored) @@ -1,4 +1,4 @@ -from __future__ import with_statement + import collections import gzip @@ -184,7 +184,7 @@ return try: self.http_server.listen(self.get_http_port(), address='::1') - except socket.gaierror, e: + except socketRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/stack_context_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/template_test.py RefactoringTool: No changes to /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/testing_test.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/twisted_test.py .gaierror as e: if e.args[0] == socket.EAI_ADDRFAMILY: # python supports ipv6, but it's not configured on the network # interface, so skip this test. --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/stack_context_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/stack_context_test.py (refactored) @@ -1,4 +1,4 @@ -from __future__ import with_statement + from tornado.stack_context import StackContext, wrap from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, LogTrapTestCase --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/template_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/template_test.py (refactored) @@ -1,4 +1,4 @@ -from __future__ import with_statement + import traceback @@ -68,21 +68,21 @@ b("expr {{jquery expr}}")) def test_unicode_template(self): - template = Template(utf8(u"\u00e9")) - self.assertEqual(template.generate(), utf8(u"\u00e9")) + template = Template(utf8("\u00e9")) + self.assertEqual(template.generate(), utf8("\u00e9")) def test_unicode_literal_expression(self): # Unicode literals should be usable in templates. Note that this # test simulates unicode characters appearing directly in the # template file (with utf8 encoding), i.e. \u escapes would not # be used in the template file itself. - if str is unicode: + if str is str: # python 3 needs a different version of this test since # 2to3 doesn't run on template internals - template = Template(utf8(u'{{ "\u00e9" }}')) + template = Template(utf8('{{ "\u00e9" }}')) else: - template = Template(utf8(u'{{ u"\u00e9" }}')) - self.assertEqual(template.generate(), utf8(u"\u00e9")) + template = Template(utf8('{{ u"\u00e9" }}')) + self.assertEqual(template.generate(), utf8("\u00e9")) def test_custom_namespace(self): loader = DictLoader({"test.html": "{{ inc(5) }}"}, namespace={"inc": lambda x: x+1}) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/twisted_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/twisted_test.py (refactored) @@ -18,7 +18,7 @@ """ import os -import thread +import _thread import threading import unittest @@ -119,20 +119,20 @@ class ReactorCallFromThreadTest(ReactorTestCase): def setUp(self): super(ReactorCallFromThreadTest, self).setUp() - self._mainThread = thread.get_ident() + self._mainThread = _thread.get_ident() def tearDown(self): self._thread.join() super(ReactorCallFromThreadTest, self).tearDown() def _newThreadRun(self): - self.assertNotEqual(self._mainThread, thread.get_ident()) + self.assertNotEqual(self._mainThread, _thread.get_ident()) if hasattr(self._thread, 'ident'): # new in python 2.6 - self.assertEqual(self._thread.ident, thread.get_ident()) + self.assertEqual(self._thread.ident, _thread.get_ident()) self._reactor.callFromThread(self._fnCalledFromThread) def _fnCalledFromThread(self): - self.assertEqual(self._mainThread, thread.get_ident()) + self.assertEqual(self._mainThread, _thread.get_ident()) self._reactor.stop() def _whenRunningCallback(self): @@ -146,10 +146,10 @@ class ReactorCallInThread(ReactorTestCase): def setUp(self): super(ReactorCallInThread, self).setUp() - self._mainThread = thread.get_ident() + self._mainThread = _thread.get_ident() def _fnCalledInThread(self, *args, **kwargs): - self.assertNotEqual(thread.get_ident(), self._mainThread) + self.assertNotEqual(_thread.get_ident(), self._mainThread) self._reactor.callFromThread(lambda: self._reactor.stop()) def _whenRunningCallback(self): @@ -RefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/web_test.py 436,7 +436,7 @@ ], 'twisted.internet.test.test_unix.UNIXPortTestsBuilder': [], } - for test_name, blacklist in twisted_tests.iteritems(): + for test_name, blacklist in twisted_tests.items(): try: test_class = import_object(test_name) except (ImportError, AttributeError): --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/web_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/web_test.py (refactored) @@ -63,7 +63,7 @@ # Try setting cookies with different argument types # to ensure that everything gets encoded correctly self.set_cookie("str", "asdf") - self.set_cookie("unicode", u"qwer") + self.set_cookie("unicode", "qwer") self.set_cookie("bytes", b("zxcv")) class GetCookieHandler(RequestHandler): @@ -74,8 +74,8 @@ def get(self): # unicode domain and path arguments shouldn't break things # either (see bug #285) - self.set_cookie("unicode_args", "blah", domain=u"foo.com", - path=u"/foo") + self.set_cookie("unicode_args", "blah", domain="foo.com", + path="/foo") class SetCookieSpecialCharHandler(RequestHandler): def get(self): @@ -213,8 +213,8 @@ for value in self.request.arguments[key]: assert type(value) == bytes_type, repr(value) for value in self.get_arguments(key): - assert type(value) == unicode, repr(value) - assert type(path) == unicode, repr(path) + assert type(value) == str, repr(value) + assert type(path) == str, repr(path) self.write(dict(path=path, args=recursive_unicode(self.request.arguments))) @@ -232,8 +232,8 @@ def test_path_encoding(self): # Path components and query arguments should be decoded the same way self.assertEqual(json_decode(self.fetch('/%C3%A9?arg=%C3%A9').body), - {u"path":u"\u00e9", - u"args": {u"arg": [u"\u00e9"]}}) + {"path":"\u00e9", + "args": {"arg": ["\u00e9"]}}) class TypeCheckHandler(RequestHandler): def prepare(self): @@ -243,9 +243,9 @@ # get_argument is an exception from the general rule of using # type str for non-body data mainly for historical reasons. - self.check_type('argument', self.get_argument('foo'), unicode) - self.check_type('cookie_key', self.cookies.keys()[0], str) - self.check_type('cookie_value', self.cookies.values()[0].value, str) + self.check_type('argument', self.get_argument('foo'), str) + self.check_type('cookie_key', list(self.cookies.keys())[0], str) + self.check_type('cookie_value', list(self.cookies.values())[0].value, str) self.check_type('xsrf_token', self.xsrf_token, bytes_type) self.check_type('xsrf_form_html', self.xsrf_form_html(), str) @@ -257,11 +257,11 @@ def get(self, path_component): # path_component uses type unicode instead of str for consistency # with get_argument() - self.check_type('path_component', path_component, unicode) + self.check_type('path_component', path_component, str) self.write(self.errors) def post(self, path_component): - self.check_type('path_component', path_component, unicode) + self.check_type('path_component', path_component, str) self.write(self.errors) def check_type(self, name, obj, expected_type): @@ -283,7 +283,7 @@ def describe(s): if type(s) == bytes_type: return ["bytes", native_str(binascii.b2a_hex(s))] - elif type(s) == unicode: + elif type(s) == str: return ["unicode", s] raise Exception("unknown type") sRefactoringTool: Refactored /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/wsgi_test.py RefactoringTool: Files that were modified: RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/setup.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/blog.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/appengine/markdown.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/auth/authdemo.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/benchmark.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/chunk_benchmark.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/benchmark/template_benchmark.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/blog.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/blog/markdown.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/chat/chatdemo.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/facebook/facebook.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/demos/s3server/s3server.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/__init__.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/auth.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/autoreload.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/curl_httpclient.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/database.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/escape.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/gen.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpclient.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httpserver.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/httputil.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/ioloop.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/iostream.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/locale.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/netutil.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/options.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/process.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/simple_httpclient.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/stack_context.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/template.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/testing.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/util.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/web.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/websocket.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/wsgi.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/interface.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/posix.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/twisted.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/platform/windows.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/auth_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/curl_httpclient_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/escape_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/gen_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpclient_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httpserver_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/httputil_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/import_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/iostream_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/process_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/run_pyversion_tests.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/simple_httpclient_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/stack_context_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/template_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/testing_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/twisted_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/web_test.py RefactoringTool: /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/wsgi_test.py RefactoringTool: Warnings/messages while refactoring: RefactoringTool: ### In file /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/gen_test.py ### RefactoringTool: Line 169: could not convert: raise "did not get expected exception" RefactoringTool: Python 3 does not support string exceptions RefactoringTool: Line 180: could not convert: raise "did not get expected exception" elf.write({'path': describe(arg), @@ -340,7 +340,7 @@ try: self.set_header("X-Foo", "foo\r\nX-Bar: baz") raise Exception("Didn't get expected exception") - except ValueError, e: + except ValueError as e: assert "Unsafe header value" in str(e) self.finish(b("ok")) @@ -400,15 +400,15 @@ response = self.fetch(url) response.rethrow() data = json_decode(response.body) - self.assertEqual(data, {u'path': [u'unicode', u'\u00e9'], - u'query': [u'unicode', u'\u00e9'], + self.assertEqual(data, {'path': ['unicode', '\u00e9'], + 'query': ['unicode', '\u00e9'], }) response = self.fetch("/decode_arg/%C3%A9?foo=%C3%A9") response.rethrow() data = json_decode(response.body) - self.assertEqual(data, {u'path': [u'bytes', u'c3a9'], - u'query': [u'bytes', u'c3a9'], + self.assertEqual(data, {'path': ['bytes', 'c3a9'], + 'query': ['bytes', 'c3a9'], }) def test_uimodule_unescaped(self): @@ -443,9 +443,9 @@ def test_optional_path(self): self.assertEqual(self.fetch_json("/optional_path/foo"), - {u"path": u"foo"}) + {"path": "foo"}) self.assertEqual(self.fetch_json("/optional_path/"), - {u"path": None}) + {"path": None}) def test_flow_control(self): self.assertEqual(self.fetch("/flow_control").body, b("123")) --- /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/wsgi_test.py (original) +++ /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6/tornado/test/wsgi_test.py (refactored) @@ -44,7 +44,7 @@ def test_path_quoting(self): response = self.fetch("/path/foo%20bar%C3%A9") - self.assertEqual(response.body, u"foo bar\u00e9".encode("utf-8")) + self.assertEqual(response.body, "foo bar\u00e9".encode("utf-8")) # This is kind of hacky, but run some of the HTTPServer tests through # WSGIContainer and WSGIApplication to make sure everything survives RefactoringTool: Python 3 does not support string exceptions RefactoringTool: Line 194: could not convert: raise "did not get expected exception" RefactoringTool: Python 3 does not support string exceptions + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.VOKbUP ~/build/BUILD/python3-python-tornado-2.2.1-7.ru6 ~/build/BUILD/tornado-2.2.1 + umask 022 + cd /builddir/build/BUILD + cd tornado-2.2.1 + LANG=C + export LANG + unset DISPLAY + pushd /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6 + python3 setup.py build running build running build_py creating build creating build/lib creating build/lib/tornado copying tornado/__init__.py -> build/lib/tornado copying tornado/auth.py -> build/lib/tornado copying tornado/autoreload.py -> build/lib/tornado copying tornado/curl_httpclient.py -> build/lib/tornado copying tornado/database.py -> build/lib/tornado copying tornado/escape.py -> build/lib/tornado copying tornado/gen.py -> build/lib/tornado copying tornado/httpclient.py -> build/lib/tornado copying tornado/httpserver.py -> build/lib/tornado copying tornado/httputil.py -> build/lib/tornado copying tornado/ioloop.py -> build/lib/tornado copying tornado/iostream.py -> build/lib/tornado copying tornado/locale.py -> build/lib/tornado copying tornado/netutil.py -> build/lib/tornado copying tornado/options.py -> build/lib/tornado copying tornado/process.py -> build/lib/tornado copying tornado/simple_httpclient.py -> build/lib/tornado copying tornado/stack_context.py -> build/lib/tornado copying tornado/template.py -> build/lib/tornado copying tornado/testing.py -> build/lib/tornado copying tornado/util.py -> build/lib/tornado copying tornado/web.py -> build/lib/tornado copying tornado/websocket.py -> build/lib/tornado copying tornado/wsgi.py -> build/lib/tornado creating build/lib/tornado/test copying tornado/test/__init__.py -> build/lib/tornado/test copying tornado/test/auth_test.py -> build/lib/tornado/test copying tornado/test/curl_httpclient_test.py -> build/lib/tornado/test copying tornado/test/escape_test.py -> build/lib/tornado/test copying tornado/test/gen_test.py -> build/lib/tornado/test copying tornado/test/httpclient_test.py -> build/lib/tornado/test copying tornado/test/httpserver_test.py -> build/lib/tornado/test copying tornado/test/httputil_test.py -> build/lib/tornado/test copying tornado/test/import_test.py -> build/lib/tornado/test copying tornado/test/ioloop_test.py -> build/lib/tornado/test copying tornado/test/iostream_test.py -> build/lib/tornado/test copying tornado/test/process_test.py -> build/lib/tornado/test copying tornado/test/run_pyversion_tests.py -> build/lib/tornado/test copying tornado/test/runtests.py -> build/lib/tornado/test copying tornado/test/simple_httpclient_test.py -> build/lib/tornado/test copying tornado/test/stack_context_test.py -> build/lib/tornado/test copying tornado/test/template_test.py -> build/lib/tornado/test copying tornado/test/testing_test.py -> build/lib/tornado/test copying tornado/test/twisted_test.py -> build/lib/tornado/test copying tornado/test/web_test.py -> build/lib/tornado/test copying tornado/test/wsgi_test.py -> build/lib/tornado/test creating build/lib/tornado/platform copying tornado/platform/__init__.py -> build/lib/tornado/platform copying tornado/platform/auto.py -> build/lib/tornado/platform copying tornado/platform/interface.py -> build/lib/tornado/platform copying tornado/platform/posix.py -> build/lib/tornado/platform copying tornado/platform/twisted.py -> build/lib/tornado/platform copying tornado/platform/windows.py -> build/lib/tornado/platform copying tornado/ca-certificates.crt -> build/lib/tornado copying tornado/test/README -> build/lib/tornado/test copying tornado/test/test.crt -> build/lib/tornado/test copying tornado/test/test.key -> build/lib/tornado/test creating build/lib/tornado/test/static copying tornado/test/static/robots.txt -> build/lib/tornado/test/static Fixing build/lib/tornado/__init__.py build/lib/tornado/auth.py build/lib/tornado/autoreload.py build/lib/tornado/curl_httpclient.py build/lib/tornado/database.py build/lib/tornado/escape.py build/lib/tornado/gen.py build/lib/tornado/httpclient.py build/lib/tornado/httpserver.py build/lib/tornado/httputil.py build/lib/tornado/ioloop.py build/lib/tornado/iostream.py build/lib/tornado/locale.py build/lib/tornado/netutil.py build/lib/tornado/options.py build/lib/tornado/process.py build/lib/tornado/simple_httpclient.py build/lib/tornado/stack_context.py build/lib/tornado/template.py build/lib/tornado/testing.py build/lib/tornado/util.py build/lib/tornado/web.py build/lib/tornado/websocket.py build/lib/tornado/wsgi.py build/lib/tornado/test/__init__.py build/lib/tornado/test/auth_test.py build/lib/tornado/test/curl_httpclient_test.py build/lib/tornado/test/escape_test.py build/lib/tornado/test/gen_test.py build/lib/tornado/test/httpclient_test.py build/lib/tornado/test/httpserver_test.py build/lib/tornado/test/httputil_test.py build/lib/tornado/test/import_test.py build/lib/tornado/test/ioloop_test.py build/lib/tornado/test/iostream_test.py build/lib/tornado/test/process_test.py build/lib/tornado/test/run_pyversion_tests.py build/lib/tornado/test/runtests.py build/lib/tornado/test/simple_httpclient_test.py build/lib/tornado/test/stack_context_test.py build/lib/tornado/test/template_test.py build/lib/tornado/test/testing_test.py build/lib/tornado/test/twisted_test.py build/lib/tornado/test/web_test.py build/lib/tornado/test/wsgi_test.py build/lib/tornado/platform/__init__.py build/lib/tornado/platform/auto.py build/lib/tornado/platform/interface.py build/lib/tornado/platform/posix.py build/lib/tornado/platform/twisted.py build/lib/tornado/platform/windows.py Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma Can't parse build/lib/tornado/autoreload.py: ParseError: bad input: type=22, value='=', context=('', (199, 26)) Can't parse build/lib/tornado/options.py: ParseError: bad input: type=22, value='=', context=('', (162, 51)) Can't parse build/lib/tornado/template.py: ParseError: bad input: type=22, value='=', context=('', (610, 55)) Can't parse build/lib/tornado/testing.py: ParseError: bad input: type=22, value='=', context=('', (356, 40)) Fixing build/lib/tornado/__init__.py build/lib/tornado/auth.py build/lib/tornado/autoreload.py build/lib/tornado/curl_httpclient.py build/lib/tornado/database.py build/lib/tornado/escape.py build/lib/tornado/gen.py build/lib/tornado/httpclient.py build/lib/tornado/httpserver.py build/lib/tornado/httputil.py build/lib/tornado/ioloop.py build/lib/tornado/iostream.py build/lib/tornado/locale.py build/lib/tornado/netutil.py build/lib/tornado/options.py build/lib/tornado/process.py build/lib/tornado/simple_httpclient.py build/lib/tornado/stack_context.py build/lib/tornado/template.py build/lib/tornado/testing.py build/lib/tornado/util.py build/lib/tornado/web.py build/lib/tornado/websocket.py build/lib/tornado/wsgi.py build/lib/tornado/test/__init__.py build/lib/tornado/test/auth_test.py build/lib/tornado/test/curl_httpclient_test.py build/lib/tornado/test/escape_test.py build/lib/tornado/test/gen_test.py build/lib/tornado/test/httpclient_test.py build/lib/tornado/test/httpserver_test.py build/lib/tornado/test/httputil_test.py build/lib/tornado/test/import_test.py build/lib/tornado/test/ioloop_test.py build/lib/tornado/test/iostream_test.py build/lib/tornado/test/process_test.py build/lib/tornado/test/run_pyversion_tests.py build/lib/tornado/test/runtests.py build/lib/tornado/test/simple_httpclient_test.py build/lib/tornado/test/stack_context_test.py build/lib/tornado/test/template_test.py build/lib/tornado/test/testing_test.py build/lib/tornado/test/twisted_test.py build/lib/tornado/test/web_test.py build/lib/tornado/test/wsgi_test.py build/lib/tornado/platform/__init__.py build/lib/tornado/platform/auto.py build/lib/tornado/platform/interface.py build/lib/tornado/platform/posix.py build/lib/tornado/platform/twisted.py build/lib/tornado/platform/windows.py Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma ~/build/BUILD/tornado-2.2.1 + popd + python setup.py build running build running build_py creating build creating build/lib creating build/lib/tornado copying tornado/__init__.py -> build/lib/tornado copying tornado/auth.py -> build/lib/tornado copying tornado/autoreload.py -> build/lib/tornado copying tornado/curl_httpclient.py -> build/lib/tornado copying tornado/database.py -> build/lib/tornado copying tornado/escape.py -> build/lib/tornado copying tornado/gen.py -> build/lib/tornado copying tornado/httpclient.py -> build/lib/tornado copying tornado/httpserver.py -> build/lib/tornado copying tornado/httputil.py -> build/lib/tornado copying tornado/ioloop.py -> build/lib/tornado copying tornado/iostream.py -> build/lib/tornado copying tornado/locale.py -> build/lib/tornado copying tornado/netutil.py -> build/lib/tornado copying tornado/options.py -> build/lib/tornado copying tornado/process.py -> build/lib/tornado copying tornado/simple_httpclient.py -> build/lib/tornado copying tornado/stack_context.py -> build/lib/tornado copying tornado/template.py -> build/lib/tornado copying tornado/testing.py -> build/lib/tornado copying tornado/util.py -> build/lib/tornado copying tornado/web.py -> build/lib/tornado copying tornado/websocket.py -> build/lib/tornado copying tornado/wsgi.py -> build/lib/tornado creating build/lib/tornado/test copying tornado/test/__init__.py -> build/lib/tornado/test copying tornado/test/auth_test.py -> build/lib/tornado/test copying tornado/test/curl_httpclient_test.py -> build/lib/tornado/test copying tornado/test/escape_test.py -> build/lib/tornado/test copying tornado/test/gen_test.py -> build/lib/tornado/test copying tornado/test/httpclient_test.py -> build/lib/tornado/test copying tornado/test/httpserver_test.py -> build/lib/tornado/test copying tornado/test/httputil_test.py -> build/lib/tornado/test copying tornado/test/import_test.py -> build/lib/tornado/test copying tornado/test/ioloop_test.py -> build/lib/tornado/test copying tornado/test/iostream_test.py -> build/lib/tornado/test copying tornado/test/process_test.py -> build/lib/tornado/test copying tornado/test/run_pyversion_tests.py -> build/lib/tornado/test copying tornado/test/runtests.py -> build/lib/tornado/test copying tornado/test/simple_httpclient_test.py -> build/lib/tornado/test copying tornado/test/stack_context_test.py -> build/lib/tornado/test copying tornado/test/template_test.py -> build/lib/tornado/test copying tornado/test/testing_test.py -> build/lib/tornado/test copying tornado/test/twisted_test.py -> build/lib/tornado/test copying tornado/test/web_test.py -> build/lib/tornado/test copying tornado/test/wsgi_test.py -> build/lib/tornado/test creating build/lib/tornado/platform copying tornado/platform/__init__.py -> build/lib/tornado/platform copying tornado/platform/auto.py -> build/lib/tornado/platform copying tornado/platform/interface.py -> build/lib/tornado/platform copying tornado/platform/posix.py -> build/lib/tornado/platform copying tornado/platform/twisted.py -> build/lib/tornado/platform copying tornado/platform/windows.py -> build/lib/tornado/platform copying tornado/ca-certificates.crt -> build/lib/tornado copying tornado/test/README -> build/lib/tornado/test copying tornado/test/test.crt -> build/lib/tornado/test copying tornado/test/test.key -> build/lib/tornado/test creating build/lib/tornado/test/static copying tornado/test/static/robots.txt -> build/lib/tornado/test/static + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.nFwXMv + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch ++ dirname /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch + cd tornado-2.2.1 + LANG=C + export LANG + unset DISPLAY + pushd /builddir/build/BUILD/python3-python-tornado-2.2.1-7.ru6 ~/build/BUILD/python3-python-tornado-2.2.1-7.ru6 ~/build/BUILD/tornado-2.2.1 + PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado + python3 setup.py install --root=/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch running install running build running build_py running install_lib creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3 creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/__init__.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/auth.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/autoreload.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/curl_httpclient.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/database.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/escape.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/gen.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/httpclient.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/httpserver.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/httputil.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/ioloop.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/iostream.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/locale.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/netutil.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/options.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/process.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/simple_httpclient.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/stack_context.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/template.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/testing.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/util.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/web.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/websocket.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado copying build/lib/tornado/wsgi.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/__init__.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/auth_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/curl_httpclient_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/escape_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/gen_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/httpclient_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/httpserver_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/httputil_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/import_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/ioloop_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/iostream_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/process_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/run_pyversion_tests.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/runtests.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/simple_httpclient_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/stack_context_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/template_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/testing_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/twisted_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/web_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/wsgi_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/README -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/test.crt -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test copying build/lib/tornado/test/test.key -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/static copying build/lib/tornado/test/static/robots.txt -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/static creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/platform/__init__.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/platform/auto.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/platform/interface.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/platform/posix.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/platform/twisted.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/platform/windows.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform copying build/lib/tornado/ca-certificates.crt -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/__init__.py to __init__.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/auth.py to auth.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/autoreload.py to autoreload.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/curl_httpclient.py to curl_httpclient.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/database.py to database.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/escape.py to escape.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/gen.py to gen.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/httpclient.py to httpclient.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/httpserver.py to httpserver.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/httputil.py to httputil.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/ioloop.py to ioloop.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/iostream.py to iostream.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/locale.py to locale.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/netutil.py to netutil.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/options.py to options.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/process.py to process.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/simple_httpclient.py to simple_httpclient.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/stack_context.py to stack_context.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/template.py to template.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/testing.py to testing.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/util.py to util.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/web.py to web.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/websocket.py to websocket.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/wsgi.py to wsgi.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/__init__.py to __init__.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/auth_test.py to auth_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/curl_httpclient_test.py to curl_httpclient_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/escape_test.py to escape_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/gen_test.py to gen_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/httpclient_test.py to httpclient_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/httpserver_test.py to httpserver_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/httputil_test.py to httputil_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/import_test.py to import_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/ioloop_test.py to ioloop_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/iostream_test.py to iostream_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/process_test.py to process_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/run_pyversion_tests.py to run_pyversion_tests.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/runtests.py to runtests.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/simple_httpclient_test.py to simple_httpclient_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/stack_context_test.py to stack_context_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/template_test.py to template_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/testing_test.py to testing_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/twisted_test.py to twisted_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/web_test.py to web_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/test/wsgi_test.py to wsgi_test.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform/__init__.py to __init__.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform/auto.py to auto.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform/interface.py to interface.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform/posix.py to posix.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform/twisted.py to twisted.cpython-33.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado/platform/windows.py to windows.cpython-33.pyc running install_egg_info running egg_info writing top-level names to tornado.egg-info/top_level.txt writing dependency_links to tornado.egg-info/dependency_links.txt writing tornado.egg-info/PKG-INFO reading manifest file 'tornado.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '_auto2to3*' found anywhere in distribution writing manifest file 'tornado.egg-info/SOURCES.txt' Copying tornado.egg-info to /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado-2.2.1-py3.3.egg-info running install_scripts ~/build/BUILD/tornado-2.2.1 + popd + PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3/site-packages/tornado:/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado + python setup.py install --root=/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch running install running build running build_py running install_lib creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6 creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/__init__.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/auth.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/autoreload.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/curl_httpclient.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/database.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/escape.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/gen.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/httpclient.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/httpserver.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/httputil.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/ioloop.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/iostream.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/locale.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/netutil.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/options.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/process.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/simple_httpclient.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/stack_context.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/template.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/testing.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/util.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/web.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/websocket.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado copying build/lib/tornado/wsgi.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/__init__.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/auth_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/curl_httpclient_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/escape_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/gen_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/httpclient_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/httpserver_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/httputil_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/import_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/ioloop_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/iostream_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/process_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/run_pyversion_tests.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/runtests.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/simple_httpclient_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/stack_context_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/template_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/testing_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/twisted_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/web_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/wsgi_test.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/README -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/test.crt -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test copying build/lib/tornado/test/test.key -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/static copying build/lib/tornado/test/static/robots.txt -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/static creating /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/platform/__init__.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/platform/auto.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/platform/interface.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/platform/posix.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/platform/twisted.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/platform/windows.py -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform copying build/lib/tornado/ca-certificates.crt -> /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/__init__.py to __init__.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/auth.py to auth.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/autoreload.py to autoreload.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/curl_httpclient.py to curl_httpclient.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/database.py to database.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/escape.py to escape.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/gen.py to gen.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/httpclient.py to httpclient.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/httpserver.py to httpserver.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/httputil.py to httputil.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/ioloop.py to ioloop.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/iostream.py to iostream.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/locale.py to locale.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/netutil.py to netutil.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/options.py to options.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/process.py to process.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/simple_httpclient.py to simple_httpclient.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/stack_context.py to stack_context.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/template.py to template.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/testing.py to testing.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/util.py to util.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/web.py to web.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/websocket.py to websocket.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/wsgi.py to wsgi.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/__init__.py to __init__.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/auth_test.py to auth_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/curl_httpclient_test.py to curl_httpclient_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/escape_test.py to escape_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/gen_test.py to gen_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/httpclient_test.py to httpclient_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/httpserver_test.py to httpserver_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/httputil_test.py to httputil_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/import_test.py to import_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/ioloop_test.py to ioloop_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/iostream_test.py to iostream_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/process_test.py to process_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/run_pyversion_tests.py to run_pyversion_tests.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/runtests.py to runtests.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/simple_httpclient_test.py to simple_httpclient_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/stack_context_test.py to stack_context_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/template_test.py to template_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/testing_test.py to testing_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/twisted_test.py to twisted_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/web_test.py to web_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/test/wsgi_test.py to wsgi_test.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform/__init__.py to __init__.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform/auto.py to auto.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform/interface.py to interface.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform/posix.py to posix.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform/twisted.py to twisted.pyc byte-compiling /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado/platform/windows.py to windows.pyc running install_egg_info Writing /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6/site-packages/tornado-2.2.1-py2.6.egg-info + unset DISPLAY + /usr/lib/rpm/find-debuginfo.sh --strict-build-id /builddir/build/BUILD/tornado-2.2.1 find: `debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python Bytecompiling .py files below /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python3.3 using /usr/bin/python3.3 Bytecompiling .py files below /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/lib/python2.6 using /usr/bin/python2.6 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/lib/rpm/redhat/brp-java-repack-jars Processing files: python-tornado-2.2.1-7.ru6.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.fbKnRl + umask 022 + cd /builddir/build/BUILD + cd tornado-2.2.1 + DOCDIR=/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-2.2.1 + export DOCDIR + rm -rf /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-2.2.1 + /bin/mkdir -p /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-2.2.1 + cp -pr README PKG-INFO /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-2.2.1 + exit 0 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 2.6 Processing files: python-tornado-doc-2.2.1-7.ru6.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.K3jPfm + umask 022 + cd /builddir/build/BUILD + cd tornado-2.2.1 + DOCDIR=/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-doc-2.2.1 + export DOCDIR + rm -rf /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-doc-2.2.1 + /bin/mkdir -p /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-doc-2.2.1 + cp -pr demos /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python-tornado-doc-2.2.1 + exit 0 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/env Processing files: python3-tornado-2.2.1-7.ru6.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.aW7D7m + umask 022 + cd /builddir/build/BUILD + cd tornado-2.2.1 + DOCDIR=/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-2.2.1 + export DOCDIR + rm -rf /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-2.2.1 + /bin/mkdir -p /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-2.2.1 + cp -pr README PKG-INFO /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-2.2.1 + exit 0 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 3.3 Processing files: python3-tornado-doc-2.2.1-7.ru6.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.kdMM3y + umask 022 + cd /builddir/build/BUILD + cd tornado-2.2.1 + DOCDIR=/builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-doc-2.2.1 + export DOCDIR + rm -rf /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-doc-2.2.1 + /bin/mkdir -p /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-doc-2.2.1 + cp -pr demos /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch/usr/share/doc/python3-tornado-doc-2.2.1 + exit 0 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/env Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch warning: Could not canonicalize hostname: opus3 Wrote: /builddir/build/RPMS/python-tornado-2.2.1-7.ru6.noarch.rpm Wrote: /builddir/build/RPMS/python-tornado-doc-2.2.1-7.ru6.noarch.rpm Wrote: /builddir/build/RPMS/python3-tornado-2.2.1-7.ru6.noarch.rpm Wrote: /builddir/build/RPMS/python3-tornado-doc-2.2.1-7.ru6.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.3nIOdG + umask 022 + cd /builddir/build/BUILD + cd tornado-2.2.1 + /bin/rm -rf /builddir/build/BUILDROOT/python-tornado-2.2.1-7.ru6.noarch + exit 0 error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) error: Macro % has illegal name (%define) Child return code was: 0