Fwd: Uncaught runner exception

Am 12.03.2019 um 23:47 schrieb Mark Sapiro:
/usr/bin/python /usr/bin/python -V: Python 2.6.6
import string
lowercase Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'lowercase' is not defined
string <module 'string' from '/usr/lib64/python2.6/string.pyc'>

Lothar Schilling writes:
I think this should be 'string.lowercase'.
This is what I would expect. I'm not sure why Mark got something different (he may have previously done 'from string import *'). We apologize for the inaccuracy.
string <module 'string' from '/usr/lib64/python2.6/string.pyc'>
It occurred to me that that you're probably in a German locale, in which case umlauts and sharp S might be added to the string of lowercase letters, but that doesn't seem to be the case:
$ LC_ALL=de_DE python Python 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information.
I added 'len(string.lowercase)' to the experiment as a quick consistency check. I also tried the same environment setting on Linux with the same result, except that the module was loaded from /usr/lib/python2.7/string.pyc and Python's version was 2.7.16rc1. So the locale doesn't seem to be at issue.
Regards, Steve
-- Associate Professor Division of Policy and Planning Science http://turnbull.sk.tsukuba.ac.jp/ Faculty of Systems and Information Email: turnbull@sk.tsukuba.ac.jp University of Tsukuba Tel: 029-853-5175 Tennodai 1-1-1, Tsukuba 305-8573 JAPAN

On 3/14/19 8:14 AM, Stephen J. Turnbull wrote:
Yes, this was definitely an error on my part. I had initially done
from string import lowercase
but I wanted to see where 'string' came from so I did import string
so
I could get that and thel when I did 'lowercase' instead of
'string.lowercase', it worked.
I apologize for the confusion.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/14/19 2:39 AM, Lothar Schilling wrote:
What is the python command in the result of
ps -fwwA|grep ArchRunner
As noted in other replies, this should have been 'string.lowercase'.
Get the python command from the 'ps' result above. run that full path and then do
I am expecting (hoping actually because it's the only explanation I can see) that the result of 'string.lowercase' will be longer than 26 characters and will contain non-ascii. Then the result of 'string' will point to the string.py(c) that this comes from.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/15/19 4:27 AM, Lothar Schilling wrote:
This is interesting. Here you get <module 'string' from 'string.pyc'> and before (above) you got <module 'string' from '/usr/lib64/python2.6/string.pyc'>. I wonder why the difference. In the message at <https://mail.python.org/pipermail/mailman-users/2019-March/084243.html> I suggested this patch === modified file 'Mailman/Archiver/pipermail.py' --- Mailman/Archiver/pipermail.py 2018-05-03 21:23:47 +0000 +++ Mailman/Archiver/pipermail.py 2019-03-02 04:51:23 +0000 @@ -60,9 +60,12 @@ else: # Mixed case; assume that small parts of the last name will be # in lowercase, and check them against the list. - while i>0 and (L[i-1][0] in lowercase or - L[i-1].lower() in smallNameParts): - i = i - 1 + try: + while i>0 and (L[i-1][0] in lowercase or + L[i-1].lower() in smallNameParts): + i = i - 1 + except: + syslog('error', 'Exception in fixAuthor: %s', author) author = SPACE.join(L[-1:] + L[i:-1]) + ', ' + SPACE.join(L[:i]) return author I assume you still have that installed. In any case, if you add a second syslog line after the first syslog('error', 'lowercase value: %r', lowercase) What do you then get in Mailman's error log -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mit herzlichem Dank und freundlichen Grüßen! Lothar Schilling Förderverein Pro Asyl e.V. Postfach 160624 60069 Frankfurt Tel. 069 242314-40 Am 15.03.2019 um 17:25 schrieb Mark Sapiro:
Exception in fixAuthor: D▒rthe Hinz - Fl▒chtlingsrat Nds. Mar 18 08:33:51 2019 (23745) lowercase value: 'abcdefghijklmnopqrstuvwxyz\xb5\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' Mar 18 10:06:50 2019 (23745) Exception in fixAuthor: Philipp Millius (Fl▒chtlingsrat THR e.V.) Mar 18 10:06:50 2019 (23745) lowercase value: 'abcdefghijklmnopqrstuvwxyz\xb5\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'

On 3/18/19 2:29 AM, Lothar Schilling wrote:
which is iso-8859-1 encoding of 'abcdefghijklmnopqrstuvwxyzµßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ' and which is the problem.
I don't know why in testing string.lowercase does not return the above string, but in the Python that's running ArchRunner, and presumably the rest of mailman, string.lowercase has that value. This is what needs to be fixed. The first step is possibly to do
locate string.py
And then look at all the ones you find to see which defines lowercase that way and then figure out why the Python that runs Mailman uses that one rather that the ones you see in testing.
Also,
which -a python
may help find things.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Am 18.03.2019 um 17:06 schrieb Mark Sapiro:
There is just one
/usr/lib64/python2.6/string.py
yielding
lowercase = 'abcdefghijklmnopqrstuvwxyz'.
points to /usr/bin/python as it is supposed to.
may help find things.
As your fix makes for the mails being archived maybe we should leave it at that. Thank you very much anyway for your patient helping me.

On 3/20/19 5:31 AM, Lothar Schilling wrote:
You could try one more thing. Run Mailman's
bin/withlist -i ...
and see if that returns the extended lowercase and where it says lowercase comes from.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/21/19 9:20 AM, Lothar Schilling wrote:
I'm out of ideas. I have no clue as to where the extended string.lowercase is coming from and why only Mailman is seeing it, but to work around that, I suggest you change my suggested patch to === modified file 'Mailman/Archiver/pipermail.py' --- Mailman/Archiver/pipermail.py 2018-05-03 21:23:47 +0000 +++ Mailman/Archiver/pipermail.py 2019-03-02 04:51:23 +0000 @@ -60,9 +60,12 @@ else: # Mixed case; assume that small parts of the last name will be # in lowercase, and check them against the list. - while i>0 and (L[i-1][0] in lowercase or - L[i-1].lower() in smallNameParts): - i = i - 1 + try: + while i>0 and (L[i-1][0] in lowercase or + L[i-1].lower() in smallNameParts): + i = i - 1 + except UnicodeDecodeError: + pass author = SPACE.join(L[-1:] + L[i:-1]) + ', ' + SPACE.join(L[:i]) return author This will catch the exception and ignore it without the logging. Also, I have no idea why when you run bin/unshunt, the .pck files remain in qfiles/shunt without errors being reported to the terminal or logged in mailman's error log. Something is strange about that, but I don't know what could cause it. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Lothar Schilling writes:
I think this should be 'string.lowercase'.
This is what I would expect. I'm not sure why Mark got something different (he may have previously done 'from string import *'). We apologize for the inaccuracy.
string <module 'string' from '/usr/lib64/python2.6/string.pyc'>
It occurred to me that that you're probably in a German locale, in which case umlauts and sharp S might be added to the string of lowercase letters, but that doesn't seem to be the case:
$ LC_ALL=de_DE python Python 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information.
I added 'len(string.lowercase)' to the experiment as a quick consistency check. I also tried the same environment setting on Linux with the same result, except that the module was loaded from /usr/lib/python2.7/string.pyc and Python's version was 2.7.16rc1. So the locale doesn't seem to be at issue.
Regards, Steve
-- Associate Professor Division of Policy and Planning Science http://turnbull.sk.tsukuba.ac.jp/ Faculty of Systems and Information Email: turnbull@sk.tsukuba.ac.jp University of Tsukuba Tel: 029-853-5175 Tennodai 1-1-1, Tsukuba 305-8573 JAPAN

On 3/14/19 8:14 AM, Stephen J. Turnbull wrote:
Yes, this was definitely an error on my part. I had initially done
from string import lowercase
but I wanted to see where 'string' came from so I did import string
so
I could get that and thel when I did 'lowercase' instead of
'string.lowercase', it worked.
I apologize for the confusion.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/14/19 2:39 AM, Lothar Schilling wrote:
What is the python command in the result of
ps -fwwA|grep ArchRunner
As noted in other replies, this should have been 'string.lowercase'.
Get the python command from the 'ps' result above. run that full path and then do
I am expecting (hoping actually because it's the only explanation I can see) that the result of 'string.lowercase' will be longer than 26 characters and will contain non-ascii. Then the result of 'string' will point to the string.py(c) that this comes from.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/15/19 4:27 AM, Lothar Schilling wrote:
This is interesting. Here you get <module 'string' from 'string.pyc'> and before (above) you got <module 'string' from '/usr/lib64/python2.6/string.pyc'>. I wonder why the difference. In the message at <https://mail.python.org/pipermail/mailman-users/2019-March/084243.html> I suggested this patch === modified file 'Mailman/Archiver/pipermail.py' --- Mailman/Archiver/pipermail.py 2018-05-03 21:23:47 +0000 +++ Mailman/Archiver/pipermail.py 2019-03-02 04:51:23 +0000 @@ -60,9 +60,12 @@ else: # Mixed case; assume that small parts of the last name will be # in lowercase, and check them against the list. - while i>0 and (L[i-1][0] in lowercase or - L[i-1].lower() in smallNameParts): - i = i - 1 + try: + while i>0 and (L[i-1][0] in lowercase or + L[i-1].lower() in smallNameParts): + i = i - 1 + except: + syslog('error', 'Exception in fixAuthor: %s', author) author = SPACE.join(L[-1:] + L[i:-1]) + ', ' + SPACE.join(L[:i]) return author I assume you still have that installed. In any case, if you add a second syslog line after the first syslog('error', 'lowercase value: %r', lowercase) What do you then get in Mailman's error log -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mit herzlichem Dank und freundlichen Grüßen! Lothar Schilling Förderverein Pro Asyl e.V. Postfach 160624 60069 Frankfurt Tel. 069 242314-40 Am 15.03.2019 um 17:25 schrieb Mark Sapiro:
Exception in fixAuthor: D▒rthe Hinz - Fl▒chtlingsrat Nds. Mar 18 08:33:51 2019 (23745) lowercase value: 'abcdefghijklmnopqrstuvwxyz\xb5\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' Mar 18 10:06:50 2019 (23745) Exception in fixAuthor: Philipp Millius (Fl▒chtlingsrat THR e.V.) Mar 18 10:06:50 2019 (23745) lowercase value: 'abcdefghijklmnopqrstuvwxyz\xb5\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'

On 3/18/19 2:29 AM, Lothar Schilling wrote:
which is iso-8859-1 encoding of 'abcdefghijklmnopqrstuvwxyzµßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ' and which is the problem.
I don't know why in testing string.lowercase does not return the above string, but in the Python that's running ArchRunner, and presumably the rest of mailman, string.lowercase has that value. This is what needs to be fixed. The first step is possibly to do
locate string.py
And then look at all the ones you find to see which defines lowercase that way and then figure out why the Python that runs Mailman uses that one rather that the ones you see in testing.
Also,
which -a python
may help find things.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Am 18.03.2019 um 17:06 schrieb Mark Sapiro:
There is just one
/usr/lib64/python2.6/string.py
yielding
lowercase = 'abcdefghijklmnopqrstuvwxyz'.
points to /usr/bin/python as it is supposed to.
may help find things.
As your fix makes for the mails being archived maybe we should leave it at that. Thank you very much anyway for your patient helping me.

On 3/20/19 5:31 AM, Lothar Schilling wrote:
You could try one more thing. Run Mailman's
bin/withlist -i ...
and see if that returns the extended lowercase and where it says lowercase comes from.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/21/19 9:20 AM, Lothar Schilling wrote:
I'm out of ideas. I have no clue as to where the extended string.lowercase is coming from and why only Mailman is seeing it, but to work around that, I suggest you change my suggested patch to === modified file 'Mailman/Archiver/pipermail.py' --- Mailman/Archiver/pipermail.py 2018-05-03 21:23:47 +0000 +++ Mailman/Archiver/pipermail.py 2019-03-02 04:51:23 +0000 @@ -60,9 +60,12 @@ else: # Mixed case; assume that small parts of the last name will be # in lowercase, and check them against the list. - while i>0 and (L[i-1][0] in lowercase or - L[i-1].lower() in smallNameParts): - i = i - 1 + try: + while i>0 and (L[i-1][0] in lowercase or + L[i-1].lower() in smallNameParts): + i = i - 1 + except UnicodeDecodeError: + pass author = SPACE.join(L[-1:] + L[i:-1]) + ', ' + SPACE.join(L[:i]) return author This will catch the exception and ignore it without the logging. Also, I have no idea why when you run bin/unshunt, the .pck files remain in qfiles/shunt without errors being reported to the terminal or logged in mailman's error log. Something is strange about that, but I don't know what could cause it. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Lothar Schilling
-
Mark Sapiro
-
Stephen J. Turnbull