From nobody Fri Mar 25 13:51:12 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7500C1A34C0D; Fri, 25 Mar 2022 13:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KQ3Qn5qswz3hKy; Fri, 25 Mar 2022 13:51:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7qxKlw1/BPP6JChAElbWD76ciwDCSkUtmzS3LUVddLQ=; b=N2meSmhxgCamNAXnvKILYTLMLAgMVVnKXbcP/TO5hRLnAjVOYeyzmc+aaTo38gWG8Q4flY nJizLenqhMkH62i09nq96cnAZLnJSfmWDv9nRiMhQGOdRo4NZCMhFDpdFQJWKG4gOgQ78b B8EyhROEo+c5o+UaD+eKzAHpcmESuZ0ymBt4/kwPza+NJ3veWBvQlGQC84f9EqEZKrEgAJ cUJEMyD5Wv2E5e4h1j/X/CUZJNQK+GxmxudLxdD/HbPMEwjSuFwrXMw3K++VPOe/IpPEc4 n0740mtRJcLCWRM7R72Jzcx2SFKbRWAPdsnET50sawuASboFdsFbOXoZwO0tCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF833599C; Fri, 25 Mar 2022 13:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22PDpCWs037969; Fri, 25 Mar 2022 13:51:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22PDpCd8037968; Fri, 25 Mar 2022 13:51:12 GMT (envelope-from git) Date: Fri, 25 Mar 2022 13:51:12 GMT Message-Id: <202203251351.22PDpCd8037968@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 93b856170efc - main - www/py-WebError: Fix build with setuptools 58.0.0+ List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93b856170efcd2c6f24d58b5f095be57c9186f5c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648216274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7qxKlw1/BPP6JChAElbWD76ciwDCSkUtmzS3LUVddLQ=; b=hi/6JLKzX5wO7+GjhVkCPoV4k/JtBTiZwd0rDwXTuga85anByoTSyhIP9uKDwaNGqGU1zL bUDxb53NW6uWDa+3i/Qfdc2sG84QaTuejHpMj36Bcbk3fP0BomOin7jMxGxBsUedfLkTgE 4lukrmKePzi93nKaXrubhFWFxrbNsYTjmr8M3x4yLdI2F6twdI86UKCztbghKOXM2xMvRD 6zG0AXaB2lzf2EzeQq+cFAAKrjib3SF2trGJfSNk1ylzA3OhWbKInDUnAd8yXLhslibNfM zBbbz0qPEV1/dBhXHtyHDVZCaGggEQQ9TP5V8yDiKgw2ftwoN+hlrOaV8MlPLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648216274; a=rsa-sha256; cv=none; b=qaToDMmA5gFlpC/HlINqqJxPx6Mukswne0/N57BaPLR8+iPPXSsS3PbJvM2h3jCoLQIBl5 Bw5RtdQ16ZVTw8WasiRGAOW92UqZ5Hlul43lWy/lT97sSj7J1fPjeVfONK4KqadLbcNTqJ i3IShpqmgnUV4aiaQXfWvT8vjeJI5c00NWYlmsvREevpdjKVyyXpAAb2ptfm7QzqmScwIW FnwL+PFIue9GAgNuTy7HFiRQS1MLs2aYH45nvoTAsSnrjVUMuq7tACacnWX5lvnLkZYrSC HzNkIqrs6oVkXi1dlkSGUcYU972MPF3GrB0QP4m/VYWAMBO9mKMRYOg2TGcDQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=93b856170efcd2c6f24d58b5f095be57c9186f5c commit 93b856170efcd2c6f24d58b5f095be57c9186f5c Author: Po-Chuan Hsieh AuthorDate: 2022-03-25 13:35:06 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-03-25 13:38:24 +0000 www/py-WebError: Fix build with setuptools 58.0.0+ With hat: python --- www/py-WebError/files/patch-2to3 | 319 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 319 insertions(+) diff --git a/www/py-WebError/files/patch-2to3 b/www/py-WebError/files/patch-2to3 new file mode 100644 index 000000000000..0ac9ce46f1d6 --- /dev/null +++ b/www/py-WebError/files/patch-2to3 @@ -0,0 +1,319 @@ +--- weberror/evalcontext.py.orig 2016-04-10 01:43:23 UTC ++++ weberror/evalcontext.py +@@ -1,4 +1,4 @@ +-from cStringIO import StringIO ++from io import StringIO + import traceback + import threading + import pdb +@@ -32,7 +32,7 @@ class EvalContext(object): + sys.stdout = out + try: + code = compile(s, '', "single", 0, 1) +- exec code in self.namespace, self.globs ++ exec(code, self.namespace, self.globs) + debugger.set_continue() + except KeyboardInterrupt: + raise +--- weberror/evalexception.py.orig 2016-04-10 01:43:23 UTC ++++ weberror/evalexception.py +@@ -22,18 +22,18 @@ to see the full debuggable traceback. Also, this URL + ``wsgi.errors``, so you can open it up in another browser window. + + """ +-import httplib ++import http.client + import sys + import os + import cgi + import traceback +-from cStringIO import StringIO ++from io import StringIO + import pprint + import itertools + import time + import re + import types +-import urllib ++import urllib.request, urllib.parse, urllib.error + + from pkg_resources import resource_filename + +@@ -43,7 +43,7 @@ from paste import request + from paste import urlparser + from paste.util import import_string + +-import evalcontext ++from . import evalcontext + from weberror import errormiddleware, formatter, collector + from weberror.util import security + from tempita import HTMLTemplate +@@ -124,7 +124,7 @@ def wsgiapp(): + form['environ'] = environ + try: + res = func(*args, **form.mixed()) +- except ValueError, ve: ++ except ValueError as ve: + status = '500 Server Error' + res = 'There was an error: %s' % \ + html_quote(ve) +@@ -150,7 +150,7 @@ def get_debug_info(func): + debugcount = req.params['debugcount'] + try: + debugcount = int(debugcount) +- except ValueError, e: ++ except ValueError as e: + return exc.HTTPBadRequest( + "Invalid value for debugcount (%r): %s" + % (debugcount, e)) +@@ -197,7 +197,7 @@ def get_debug_count(req): + elif 'weberror.evalexception.debug_count' in environ: + return environ['weberror.evalexception.debug_count'] + else: +- next = debug_counter.next() ++ next = next(debug_counter) + environ['weberror.evalexception.debug_count'] = next + environ['paste.evalexception.debug_count'] = next + return next +@@ -279,7 +279,7 @@ class EvalException(object): + libraries=self.libraries)[0] + host = req.GET['host'] + headers = req.headers +- conn = httplib.HTTPConnection(host) ++ conn = http.client.HTTPConnection(host) + headers = {'Content-Length':len(long_xml_er), + 'Content-Type':'application/xml'} + conn.request("POST", req.GET['path'], long_xml_er, headers=headers) +@@ -311,7 +311,7 @@ class EvalException(object): + """ + res = Response(content_type='text/x-json') + data = []; +- items = self.debug_infos.values() ++ items = list(self.debug_infos.values()) + items.sort(lambda a, b: cmp(a.created, b.created)) + data = [item.json() for item in items] + res.body = repr(data) +@@ -525,7 +525,7 @@ class DebugInfo(object): + if id(frame) == tbid: + return frame + else: +- raise ValueError, ( ++ raise ValueError( + "No frame by id %s found from %r" % (tbid, self.frames)) + + def wsgi_application(self, environ, start_response): +@@ -601,7 +601,7 @@ class EvalHTMLFormatter(formatter.HTMLFormatter): + + def make_table(items): + if hasattr(items, 'items'): +- items = items.items() ++ items = list(items.items()) + items.sort() + return table_template.substitute( + html_quote=html_quote, +@@ -641,7 +641,7 @@ def pprint_format(value, safe=False): + out = StringIO() + try: + pprint.pprint(value, out) +- except Exception, e: ++ except Exception as e: + if safe: + out.write('Error: %s' % e) + else: +@@ -781,12 +781,12 @@ def make_eval_exception(app, global_conf, xmlhttp_key= + xmlhttp_key = global_conf.get('xmlhttp_key', '_') + if reporters is None: + reporters = global_conf.get('error_reporters') +- if reporters and isinstance(reporters, basestring): ++ if reporters and isinstance(reporters, str): + reporter_strings = reporters.split() + reporters = [] + for reporter_string in reporter_strings: + reporter = import_string.eval_import(reporter_string) +- if isinstance(reporter, (type, types.ClassType)): ++ if isinstance(reporter, type): + reporter = reporter() + reporters.append(reporter) + return EvalException(app, xmlhttp_key=xmlhttp_key, reporters=reporters) +--- weberror/formatter.py.orig 2016-04-10 01:43:23 UTC ++++ weberror/formatter.py +@@ -63,7 +63,7 @@ class AbstractFormatter(object): + def format_collected_data(self, exc_data): + general_data = {} + if self.show_extra_data: +- for name, value_list in exc_data.extra_data.items(): ++ for name, value_list in list(exc_data.extra_data.items()): + if isinstance(name, tuple): + importance, title = name + else: +@@ -116,17 +116,17 @@ class AbstractFormatter(object): + if res: + lines.append(res) + etype = exc_data.exception_type +- if not isinstance(etype, basestring): ++ if not isinstance(etype, str): + etype = etype.__name__ + exc_info = self.format_exception_info( + etype, + exc_data.exception_value) + data_by_importance = {'important': [], 'normal': [], + 'supplemental': [], 'extra': []} +- for (importance, name), value in general_data.items(): ++ for (importance, name), value in list(general_data.items()): + data_by_importance[importance].append( + (name, value)) +- for value in data_by_importance.values(): ++ for value in list(data_by_importance.values()): + value.sort() + return self.format_combine(data_by_importance, lines, exc_info) + +@@ -269,12 +269,12 @@ class TextFormatter(AbstractFormatter): + return '%s: %s' % (title, s) + elif isinstance(value, dict): + lines = ['\n', title, '-'*len(title)] +- items = value.items() ++ items = list(value.items()) + items.sort() + for n, v in items: + try: + v = repr(v) +- except Exception, e: ++ except Exception as e: + v = 'Cannot display: %s' % e + v = truncate(v) + lines.append(' %s: %s' % (n, v)) +@@ -346,7 +346,7 @@ class HTMLFormatter(TextFormatter): + elif (isinstance(value, (list, tuple)) + and self.long_item_list(value)): + return '%s: [
\n    %s]
' % ( +- title, ',
    '.join(map(self.quote, map(repr, value)))) ++ title, ',
    '.join(map(self.quote, list(map(repr, value))))) + else: + return '%s: %s' % (title, self.quote(repr(value))) + +@@ -370,7 +370,7 @@ class HTMLFormatter(TextFormatter): + + def zebra_table(self, title, rows, table_class="variables"): + if isinstance(rows, dict): +- rows = rows.items() ++ rows = list(rows.items()) + rows.sort() + table = ['' % table_class, + '' +@@ -379,7 +379,7 @@ class HTMLFormatter(TextFormatter): + for name, value in rows: + try: + value = repr(value) +- except Exception, e: ++ except Exception as e: + value = 'Cannot print: %s' % e + odd = not odd + table.append( +@@ -423,7 +423,7 @@ def get_libraries(libs=None): + return {} + + def create_text_node(doc, elem, text): +- if not isinstance(text, basestring): ++ if not isinstance(text, str): + try: + text = escaping.removeIllegalChars(repr(text)) + except: +@@ -449,7 +449,7 @@ class XMLFormatter(AbstractFormatter): + libs = get_libraries(self.extra_kwargs.get('libraries')) + if libs: + libraries = newdoc.createElement('libraries') +- for k, v in libs.iteritems(): ++ for k, v in libs.items(): + lib = newdoc.createElement('library') + lib.attributes['version'] = v + lib.attributes['name'] = k +@@ -493,7 +493,7 @@ class XMLFormatter(AbstractFormatter): + # variables.appendChild(variable) + + etype = exc_data.exception_type +- if not isinstance(etype, basestring): ++ if not isinstance(etype, str): + etype = etype.__name__ + + top_element.appendChild(self.format_exception_info( +@@ -677,6 +677,6 @@ def make_pre_wrappable(html, wrap_limit=60, + return '\n'.join(lines) + + def convert_to_str(s): +- if isinstance(s, unicode): ++ if isinstance(s, str): + return s.encode('utf8') + return s +--- weberror/pdbcapture.py.orig 2016-04-10 01:43:23 UTC ++++ weberror/pdbcapture.py +@@ -50,7 +50,7 @@ class PdbCapture(object): + return self.media_app(environ, start_response) + resp = self.internal_request(req) + return resp(environ, start_response) +- id = self.counter.next() ++ id = next(self.counter) + state = dict(id=id, + event=threading.Event(), + base_url=req.application_url, +@@ -66,7 +66,7 @@ class PdbCapture(object): + resp = state['response'] + return resp(environ, start_response) + if 'exc_info' in state: +- raise state['exc_info'][0], state['exc_info'][1], state['exc_info'][2] ++ raise state['exc_info'][0](state['exc_info'][1]).with_traceback(state['exc_info'][2]) + self.states[id] = state + tmpl = self.get_template('pdbcapture_response.html') + body = tmpl.substitute(req=req, state=state, id=id) +--- weberror/util/security.py.orig 2016-04-10 01:43:23 UTC ++++ weberror/util/security.py +@@ -21,7 +21,7 @@ else: + expected_len = len(expected) + result = actual_len ^ expected_len + if expected_len > 0: +- for i in xrange(actual_len): ++ for i in range(actual_len): + result |= ord(actual[i]) ^ ord(expected[i % expected_len]) + return result == 0 + +@@ -43,7 +43,7 @@ def valid_csrf_token(secret, token): + try: + expiry_ts, hashed = token.split(',') + expiry_dt = datetime.utcfromtimestamp(int(expiry_ts)) +- except ValueError, e: ++ except ValueError as e: + return False + + if expiry_dt < datetime.utcnow(): +--- weberror/util/serial_number_generator.py.orig 2016-04-10 01:43:23 UTC ++++ weberror/util/serial_number_generator.py +@@ -19,7 +19,7 @@ base = len(good_characters) + + def lazy_result(return_type, dummy_initial=None): + """Decorator to allow for on-demand evaluation (limited scope of use!)""" +- if not issubclass(return_type, basestring): ++ if not issubclass(return_type, str): + raise NotImplementedError + + class _lazy_class(return_type): +@@ -54,7 +54,7 @@ def make_identifier(number): + """ + Encodes a number as an identifier. + """ +- if not isinstance(number, (int, long)): ++ if not isinstance(number, int): + raise ValueError( + "You can only make identifiers out of integers (not %r)" + % number) +@@ -90,10 +90,10 @@ def hash_identifier(s, length, pad=True, hasher=md5, p + # Accept sha/md5 modules as well as callables + hasher = hasher.new + if length > 26 and hasher is md5: +- raise ValueError, ( ++ raise ValueError( + "md5 cannot create hashes longer than 26 characters in " + "length (you gave %s)" % length) +- if isinstance(s, unicode): ++ if isinstance(s, str): + s = s.encode('utf-8') + h = hasher(str(s)) + bin_hash = h.digest()
%s