FreeBSD Bugzilla – Attachment 229649 Details for
Bug 259979
irc/py-limnoria: 2019.09.08 doesn't run with Python 3.10
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Upgrading to limnoria-2021.10.09
patch.diff (text/plain), 10.51 KB, created by
Simeon Simeonov
on 2021-11-21 23:09:31 UTC
(
hide
)
Description:
Upgrading to limnoria-2021.10.09
Filename:
MIME Type:
Creator:
Simeon Simeonov
Created:
2021-11-21 23:09:31 UTC
Size:
10.51 KB
patch
obsolete
>===> Generating /home/sgs/.porttools configuration file >Diff mode was set to GIT, but /home/sgs/py-limnoria is not a git working copy. >Trying /usr/ports ... found >Warning: current directory name differs from Makefile header: > py-limnoria != >===> Generating patch >===> Viewing diff with more >diff -ruN /usr/ports/irc/py-limnoria/Makefile ./Makefile >--- /usr/ports/irc/py-limnoria/Makefile 2021-11-21 09:05:19.063282000 +0100 >+++ ./Makefile 2021-11-20 20:38:02.245620000 +0100 >@@ -1,7 +1,7 @@ > # Created by: Kubilay Kocak <koobs@FreeBSD.org> > > PORTNAME= limnoria >-PORTVERSION= 2019.09.08 >+PORTVERSION= 2021.10.09 > CATEGORIES= irc python > PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} > >@@ -24,7 +24,7 @@ > > GH_ACCOUNT= ProgVal > GH_PROJECT= Limnoria >-GH_TAGNAME= master-2019-09-08 >+GH_TAGNAME= master-2021-10-09 > > OPTIONS_DEFINE= ECDSA PROXY > OPTIONS_DEFAULT= ECDSA ENCODING RSS TIME >diff -ruN /usr/ports/irc/py-limnoria/distinfo ./distinfo >--- /usr/ports/irc/py-limnoria/distinfo 2021-11-21 09:05:22.343018000 +0100 >+++ ./distinfo 2021-11-20 20:44:12.389701000 +0100 >@@ -1,3 +1,3 @@ > TIMESTAMP = 1569902980 >-SHA256 (ProgVal-Limnoria-2019.09.08-master-2019-09-08_GH0.tar.gz) = e7b8dec6befa6381d6f1ce75c240e132a0c020bbef15bb0e7b943a01d6790875 >-SIZE (ProgVal-Limnoria-2019.09.08-master-2019-09-08_GH0.tar.gz) = 966922 >+SHA256 (ProgVal-Limnoria-2021.10.09-master-2021-10-09_GH0.tar.gz) = 0ab5bb477b0a944069faf44636dad6688e4c8f61315bd94eebef4cc0b541338c >+SIZE (ProgVal-Limnoria-2021.10.09-master-2021-10-09_GH0.tar.gz) = 1093966 >diff -ruN /usr/ports/irc/py-limnoria/files/patch-plugins_Web_plugin.py ./files/patch-plugins_Web_plugin.py >--- /usr/ports/irc/py-limnoria/files/patch-plugins_Web_plugin.py 2021-11-21 09:06:09.296803000 +0100 >+++ ./files/patch-plugins_Web_plugin.py 1970-01-01 01:00:00.000000000 +0100 >@@ -1,179 +0,0 @@ >-# https://github.com/ProgVal/Limnoria/pull/1371 >-# https://github.com/ProgVal/Limnoria/issues/1362 >-# https://github.com/ProgVal/Limnoria/issues/1359 >- >-From 7cf91ad703ab324e38c37fa2976626505f1d569a Mon Sep 17 00:00:00 2001 >-From: Rodrigo <rodrigo.freebsd@minasambiente.com.br> >-Date: Fri, 27 Sep 2019 01:48:36 -0300 >-Subject: [PATCH 1/3] make clear in logs about charade dep|make behave the same >- way in py3 or py2 without errors in any case (e.g. without charade installed) >- >---- >- plugins/Web/plugin.py | 44 +++++++++++++++++-------------------------- >- 1 file changed, 17 insertions(+), 27 deletions(-) >- >-diff --git plugins/Web/plugin.py plugins/Web/plugin.py >-index 1ac362714..0bdb68a4a 100644 >---- plugins/Web/plugin.py >-+++ plugins/Web/plugin.py >-@@ -150,37 +150,27 @@ def getTitle(self, irc, url, raiseErrors): >- size = conf.supybot.protocols.http.peekSize() >- timeout = self.registryValue('timeout') >- (target, text) = utils.web.getUrlTargetAndContent(url, size=size, >-- timeout=timeout) >-- try: >-- text = text.decode(utils.web.getEncoding(text) or 'utf8', >-- 'replace') >-- except UnicodeDecodeError: >-- pass >-- if minisix.PY3 and isinstance(text, bytes): >-- if raiseErrors: >-- irc.error(_('Could not guess the page\'s encoding. (Try ' >-- 'installing python-charade.)'), Raise=True) >-- else: >-- return None >-+ timeout=timeout) >-+ encoding = utils.web.getEncoding(text) >-+ if encoding is None: # Condition if charade not installed >-+ self.log.info('Web plugin TitleSnarfer: Could not guess the page\'s' >-+ ' encoding. (Try installing python-charade.)') >-+ encoding = 'utf-8' # Assume UTF-8 and replace unknown chars to the UTF-8 codec for U+FFFD in the next hop >- try: >-+ text = text.decode(utils.web.getEncoding(text) or 'utf-8', 'replace') >- parser = Title() >- parser.feed(text) >-- except UnicodeDecodeError: >-- # Workaround for Python 2 >-- # https://github.com/ProgVal/Limnoria/issues/1359 >-- parser = Title() >-- parser.feed(text.encode('utf8')) >-- parser.close() >-- title = utils.str.normalizeWhitespace(''.join(parser.data).strip()) >-- if title: >-- return (target, title) >-- elif raiseErrors: >-- if len(text) < size: >-- irc.error(_('That URL appears to have no HTML title.'), >-- Raise=True) >-+ parser.close() >-+ title = utils.str.normalizeWhitespace(''.join(parser.data).strip()) >-+ if title: >-+ return (target, title) >- else: >-- irc.error(format(_('That URL appears to have no HTML title ' >-- 'within the first %S.'), size), Raise=True) >-+ if len(text) < size: >-+ self.log.info('Web plugin TitleSnarfer: ' >-+ 'That URL appears to have no HTML title.') >-+ except raiseErrors: # Can use raiseErrors here ? >-+ irc.error(_('Web plugin TitleSnarfer encoding errors'), >-+ Raise=True) >- >- @fetch_sandbox >- def titleSnarfer(self, irc, msg, match): >- >-From 16247c5caf59f307b3d6910e31832fe30d0d583a Mon Sep 17 00:00:00 2001 >-From: Rodrigo <rodrigo.freebsd@minasambiente.com.br> >-Date: Fri, 27 Sep 2019 20:12:00 -0300 >-Subject: [PATCH 2/3] more python2 compatibility >- >---- >- plugins/Web/plugin.py | 18 +++++++++++------- >- 1 file changed, 11 insertions(+), 7 deletions(-) >- >-diff --git plugins/Web/plugin.py plugins/Web/plugin.py >-index 0bdb68a4a..85c129de3 100644 >---- plugins/Web/plugin.py >-+++ plugins/Web/plugin.py >-@@ -150,16 +150,20 @@ def getTitle(self, irc, url, raiseErrors): >- size = conf.supybot.protocols.http.peekSize() >- timeout = self.registryValue('timeout') >- (target, text) = utils.web.getUrlTargetAndContent(url, size=size, >-- timeout=timeout) >-+ timeout=timeout) >- encoding = utils.web.getEncoding(text) >-- if encoding is None: # Condition if charade not installed >-+ if encoding is None: # Condition if charade not installed >- self.log.info('Web plugin TitleSnarfer: Could not guess the page\'s' >- ' encoding. (Try installing python-charade.)') >-- encoding = 'utf-8' # Assume UTF-8 and replace unknown chars to the UTF-8 codec for U+FFFD in the next hop >-+ encoding = 'utf-8' # Assume UTF-8 and replace unknown chars to the UTF-8 codec for U+FFFD in the next hop >- try: >-- text = text.decode(utils.web.getEncoding(text) or 'utf-8', 'replace') >-+ text = text.decode(utils.web.getEncoding(text) or 'utf-8','replace') >- parser = Title() >-- parser.feed(text) >-+ try: >-+ parser.feed(text) >-+ except: >-+ parser = Title() >-+ parser.feed(bytes(text)) # Explicitly pack to bytes in encoding errors for (more) python2 compatibility >- parser.close() >- title = utils.str.normalizeWhitespace(''.join(parser.data).strip()) >- if title: >-@@ -168,9 +172,9 @@ def getTitle(self, irc, url, raiseErrors): >- if len(text) < size: >- self.log.info('Web plugin TitleSnarfer: ' >- 'That URL appears to have no HTML title.') >-- except raiseErrors: # Can use raiseErrors here ? >-+ except: >- irc.error(_('Web plugin TitleSnarfer encoding errors'), >-- Raise=True) >-+ Raise=True) >- >- @fetch_sandbox >- def titleSnarfer(self, irc, msg, match): >- >-From 5cac4a3cbda26186a330709901da2633914de415 Mon Sep 17 00:00:00 2001 >-From: Rodrigo <rodrigo.freebsd@minasambiente.com.br> >-Date: Sat, 28 Sep 2019 23:40:44 -0300 >-Subject: [PATCH 3/3] Include '(target, text) = >- utils.web.getUrlTargetAndContent(url, size=size,timeout=timeout)' in >- try/catch block to avoid thread blocking | send http errors to log >- >---- >- plugins/Web/plugin.py | 23 +++++++++++------------ >- 1 file changed, 11 insertions(+), 12 deletions(-) >- >-diff --git plugins/Web/plugin.py plugins/Web/plugin.py >-index 85c129de3..e67944f29 100644 >---- plugins/Web/plugin.py >-+++ plugins/Web/plugin.py >-@@ -149,14 +149,13 @@ def noIgnore(self, irc, msg): >- def getTitle(self, irc, url, raiseErrors): >- size = conf.supybot.protocols.http.peekSize() >- timeout = self.registryValue('timeout') >-- (target, text) = utils.web.getUrlTargetAndContent(url, size=size, >-- timeout=timeout) >-- encoding = utils.web.getEncoding(text) >-- if encoding is None: # Condition if charade not installed >-- self.log.info('Web plugin TitleSnarfer: Could not guess the page\'s' >-- ' encoding. (Try installing python-charade.)') >-- encoding = 'utf-8' # Assume UTF-8 and replace unknown chars to the UTF-8 codec for U+FFFD in the next hop >- try: >-+ (target, text) = utils.web.getUrlTargetAndContent(url, size=size,timeout=timeout) >-+ encoding = utils.web.getEncoding(text) >-+ if encoding is None: # Condition if charade not installed >-+ self.log.info('Web plugin TitleSnarfer: Could not guess the page\'s' >-+ ' encoding. (Try installing python-charade.)') >-+ encoding = 'utf-8' # Assume UTF-8 and replace unknown chars to the UTF-8 codec for U+FFFD in the next hop >- text = text.decode(utils.web.getEncoding(text) or 'utf-8','replace') >- parser = Title() >- try: >-@@ -170,11 +169,11 @@ def getTitle(self, irc, url, raiseErrors): >- return (target, title) >- else: >- if len(text) < size: >-- self.log.info('Web plugin TitleSnarfer: ' >-- 'That URL appears to have no HTML title.') >-- except: >-- irc.error(_('Web plugin TitleSnarfer encoding errors'), >-- Raise=True) >-+ self.log.info('Web plugin TitleSnarfer: <' + url + '> appears to have no HTML title.') >-+ else: >-+ self.log.info('Web plugin TitleSnarfer: Could not retrieve title of <' + url + '>') >-+ except Exception as e: >-+ self.log.info('Web plugin TitleSnarfer: <' + str(e) + '> while trying to process <' + url +'>') >- >- @fetch_sandbox >- def titleSnarfer(self, irc, msg, match): >====> Cleaning up >===> Done
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 259979
:
229649
|
229651