semantic error in mailmanctl line 255 (Mailman 2.1.2)

Hello,
this was originally: Mandrake 9.1 / ImportError
As a result of a suggestion from Luca Olivetti (Mandrake list member) I think now that you are maybe wrong with that line 255 in maimanctl.
The original line is
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s')
But this is a semantic error we think. The first parameter is arg0 no arg1, so you should be using something like
os.execl(mm_cfg.PYTHON, '' , exe, rswitch, '-s')
Here is the diff for a patch: 255c255 < os.execl(mm_cfg.PYTHON, '' , exe, rswitch, '-s')
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s')
This bug breaks several python installations. It don't work for my Mandrake system for example.
It is possible to correct this in future releases? What do you think?
- oliver
-- Oliver Egginger <Oliver.Egginger@dvz.fh-giessen.de> Fachochschule Giessen-Friedberg

On Wednesday, May 14, 2003, at 08:14 AM, Oliver Egginger wrote:
I'd like to understand better what exactly breaks on Mandrake.
Certainly, I've never had a problem on various Redhati. AFAIK, that
argument is mostly for process listings, e.g. ps and doesn't have any
semantic value.
It is possible to correct this in future releases? What do you think?
As you can tell by the comment just preceding these lines, I've thought about different values for argv0 and settled on 'qrunner' because it looks the best to me when I do a ps listing. On my RH9 system, if I use the empty string, then it eats arg1. So I'd consider using mm_cfg.PYTHON, but then the command line gets pretty long. 'qrunner' just looks the best so I'm disinclined to change that unless it fixes a real bug.
-Barry

os.execl(mm_cfg.PYTHON, mm_cfg.PYTHON , exe, rswitch, '-s') os.execl(mm_cfg.PYTHON, 'python' , exe, rswitch, '-s') or os.execl(exe , exe, rswitch, '-s')
should work. The corresponding C systemcalls gets normally used this way.
Furthermore the first suggestion os.execl(mm_cfg.PYTHON, '' , exe, rswitch, '-s') should work too but in the meantime I would prefer one of the three versions above.
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s')
crashs on my system with: Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix>
Then it breaks with the error message: ImportError: No module named getopt File "/home/mailman/bin/qrunner", line 72, in ? import getopt ImportError: No module named getopt
The messages gets repreatet several times then it breaks completely.
The suggested modification solve this problem. The Qrunners starts up and everything seems to work normal.
The only eye-catching thing is that I receive some error messages in the verbose mode during the qrunners starting up. I think this is another problem but maybe it gives you a hint. Here is one of them:
# clear __builtin__._ Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear __builtin__._
Nevertheless Mailman seems to work normal.
- oliver

--On Thursday, May 15, 2003 10:29 AM +0200 Oliver Egginger <Oliver.Egginger@dvz.fh-giessen.de> wrote:
ARGV[0] can be absolutely any null terminated string your heart desires. Many pieces of software do "interesting" things based on what ARGV[0] is set to (such as shells, which are "login" shells if ARGV[0][0] is '-').
Anything that assumes ARGV[0] actually exists in the filesystem is deluded.
-- Carson

Am Don, 2003-05-15 um 14.42 schrieb Carson Gaspar:
As far as I am concerned but it is the common practice to set ARGV[0] to the program name. Last but not least every shell calls other programs this way and python gets started from shell a million times every day all over the world.
It depends on the current program, in this case python 2.2.2, how ARGV[0]is treated. In this case it will not work if you break the common practice described above.
Maybe this is only true for a few (maybe broken) Mandrake python installations.
But are you completely sure that ARGV[0] is of no relevance for every python interpreter?
I'am far away of being a python specialist.
- oliver

On Thu, 15 May 2003, Oliver Egginger wrote:
This bug breaks several python installations. It don't work for my Mandrake system for example.
Could you post the chunk of the execl manpage from Mandrake describing execl?
Not quite sure if the file name or the full path is called for by the manpage snippet below... Swapping in "exe" would leave the string "qrunner" there but add the rest of the path to qrunner as well... ...which might be beneficial for people running more than one installation on a box (independent of whether or not that is possible or a good idea :-)...
"The const char *arg and subsequent ellipses in the execl(), execlp(), and execle() functions can be thought of as arg0, arg1, ..., argn. Together they describe a list of one or more pointers to null-terminated strings that represent the argument list available to the executed program. The first argument, by convention, should point to the file name associated with the file being executed."
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s')
crashs on my system with:
Just out of curiosity, are either qrunner or python in your path?
Dale Newfield <Dale@Newfield.org>

Could you post the chunk of the execl manpage from Mandrake describing execl?
The execl isn't the problem. It works according to the rules.
Just out of curiosity, are either qrunner or python in your path?
At the moment I am relatively sure, that the python 2.2.2 binary on my Mandrake 9.1 system exspects itself on ARGV[0]. If ARGV[0] yields a different value than 'python', 'python2.2', '/usr/bin/python' or '/usr/bin/python2.2' the described import errors occurs.
My python binary expects a executable python binary on ARGV[0] or it don't run with imports.
I don't know why.
- oliver

On Thu, 2003-05-15 at 10:30, Oliver Egginger wrote:
Ok, I know what's going on, and it's not Mandrake specific, although the interaction between the default Python installation on the system, and your $PATH is probably causing you to see the bug where most people might not.
I'd forgotten that the Python interpreter uses argv[0] to calculate the path to its libraries. I don't have time to tease out all the subtle interactions between $PATH, argv[0], your Python installations, --prefix, and --exec-prefix, but see Python's getpath.c mega-comment for details.
Suffice to say, the full absolute path to Python (i.e. mm_cfg.PYTHON) should be passed to argv[0] in the os.execl() call for everything to work correctly. Alternatively, I could set $PYTHONHOME, but I think that's a bit more fragile.
I'll commit the fix. -Barry

On Thu, 2003-05-15 at 04:29, Oliver Egginger wrote:
What does the following give you:
% python Python 2.2.2 (#1, Apr 28 2003, 12:01:50) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
? -Barry

What does the following give you:
~$ python Python 2.2.2 (#2, Feb 5 2003, 10:40:08) [GCC 3.2.1 (Mandrake Linux 9.1 3.2.1-5mdk)] on linux-i386 Type "help", "copyright", "credits" or "license" for more information.
Much the same thing. Compared with your output, I would say.
Could these error messages somehow or other have serious consequences?
- oliver
Am Fre, 2003-05-16 um 17.11 schrieb Barry Warsaw:

On Mon, 2003-05-19 at 03:24, Oliver Egginger wrote:
What does
unicode('foo', 'ascii')
give you?
If you get the same SystemError, then there's something screwy with your Python installation. If not, then double check that when you applied the mailmanctl patch, you are really using it. This means, stop the original mailmanctl, re-run configure (or config.status), re-install and then re-start mailmanctl.
-Barry

u'foo'
I did it. No change. Also Mailman doesn't start up on my system without the patch, so I have to use it.
Independent from this error messages during the start and stop phase mailman seems to work well. There are no irregularities.
But further particulars:
when I comment out the line 126 in mailmanctl the error messages go away. Here is the line LogStdErr('error', 'mailmanctl', manual_reprime=0)
I execute this function call with python -v on command line via:
and receive:
<Mailman.Logging.MultiLogger.MultiLogger instance at 0x80fe374>
without error messages. So it seems to work.
But when I terminate the python session by typing CTRL-D (end of input) I receive the same error messages as I get from mailmanctl during the start and stop phase. I have trailed them at the end of this message.
Also it seems as if the error messages came from Mailman.Logging.Utils import LogStdErr. Maybe by destroying the objects which gets created by LogStdErr('error', 'mailmanctl', manual_reprime=0). The function seems to work, none the less the shutdown of the corresponding objects seems to fail. But I'am no python expert.
Here are the error messages from: python -v
**** and then I typing CTRL-D and got this:
# clear __builtin__._ Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear __builtin__._
# clear sys.path Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.path
# clear sys.argv Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.argv
# clear sys.ps1 Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.ps1
# clear sys.ps2 Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.ps2
# clear sys.exitfunc Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exitfunc
# clear sys.exc_type Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exc_type
# clear sys.exc_value Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exc_value
# clear sys.exc_traceback Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exc_traceback
# clear sys.last_type Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.last_type
# clear sys.last_value Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.last_value
# clear sys.last_traceback Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.last_traceback
# restore sys.stdin Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # restore sys.stdin
# restore sys.stdout Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # restore sys.stdout
# restore sys.stderr Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # restore sys.stderr
# cleanup __main__ # cleanup[1] __future__ # cleanup[1] site # cleanup[1] Mailman # cleanup[1] paths # cleanup[1] strop # cleanup[1] _codecs # cleanup[1] korean # cleanup[1] string # cleanup[1] japanese # cleanup[1] readline # cleanup[1] korean.aliases # cleanup[1] Mailman.Version # cleanup[1] signal # cleanup[1] posix # cleanup[1] japanese.aliases # cleanup[1] encodings # cleanup[1] Mailman.Defaults # cleanup[1] Mailman.Logging # cleanup[1] Mailman.Logging.Utils # cleanup[1] Mailman.Logging.Logger # cleanup[1] encodings.latin_1 # cleanup[1] codecs # cleanup[1] traceback # cleanup[1] linecache # cleanup[1] encodings.aliases # cleanup[1] exceptions # cleanup[1] Mailman.mm_cfg # cleanup[1] Mailman.Logging.MultiLogger # cleanup[1] Mailman.Logging.StampedLogger # cleanup[1] struct # cleanup[1] types # cleanup[1] time # cleanup[2] copy_reg # cleanup[2] os.path # cleanup[2] stat # cleanup[2] UserDict # cleanup[2] posixpath # cleanup[2] os # cleanup sys # cleanup __builtin__ # cleanup ints: 5 unfreed ints in 1 out of 5 blocks # cleanup floats
- oliver

Hello again,
meanwhile I set up a debian "woody" with MM 2.1.2, but I receive the same error messaes like under Mandrake 9.1.
I installed both systems strict from the provides packets of this distributions (except that I used MM 2.1.2).
Please oblige me and start the qrunner in the verbose mode, for example by typing python -v mailmanctl start in the mailman/bin directory.
I'am sure you will get the same error messages. (See the quoted message below.)
And do the following:
%python -v
*** Then typing CTRL-D (for and of input) ***
This will result in the same error messages.
This means, when I comment out the line 126 in mailmanctl, namely LogStdErr('error', 'mailmanctl', manual_reprime=0), the error messages will go away.
Are these error messages normal? Will they only appear under Mandrake 9.1 and debian woody? Can they cause any harm? Can I comment out line 126? Which linux distribution I should use for Mailman 2.1.2?
- oliver
Am Die, 2003-05-20 um 10.23 schrieb Oliver Egginger:

On Wed, 2003-05-28 at 13:27, Oliver Egginger wrote:
meanwhile I set up a debian "woody" with MM 2.1.2, but I receive the same error messaes like under Mandrake 9.1.
BTW, I use RH9 and 7.3, but I really don't think it makes any difference. What /might/ make a difference is using the distro's Python or installing Python from source. Python 2.2.3 was just released; maybe a from-source installation will solve the problem.
I think you can actually ignore these messages. They probably won't hurt anything.
-Barry

Barry Warsaw wrote:
Python 2.2.3 was just released; maybe a from-source installation will solve the problem.
Yes! After installing python 2.2.3 from source and let mailman run under this python version the error messages are gone. That solve my case.
These error messages occurred under Mandrake 9.1 and Debian Woody, with the standard python 2.2.2 packages of this distributions. Maybe a python 2.2.2 problem as you have supposed.
Thank you!
- oliver

On Tue, 2003-06-03 at 11:14, Oliver Egginger wrote:
It seems we've had no end of trouble with packaged Python distros, especially with folks not installing all the related Python packages. A from-source install of Python usually clears things up because then you /know/ you're getting everything you need.
It would be helpful if people running various Linux distros do a little research to figure out which Python packages are required for Mailman to run. I'd be happy to add such information to README.LINUX.
-Barry

But it runs! Only during the shutdown and the startup I see these error messages: SystemError: codec module not properly initialized several times (using verbose mode).
Meanwhile I have translated, linked and installed python 2.2.2 from the original source tar ball, and I see the same error messages. (I only tested under ML 9.1 yet.)
When I go back to python 2.2.3 (installed from source) the error messages disappear.
So I think (in this case), it's likely rather a mailman/python (2.2.2) issue than a Mailman/Linux distro topic.
Maybe this is specific to my system, cause the configure scripts will produce different results on different systems. But maybe other people see those error messages with Mailman 2.1.2 and python 2.2.2 too.
Also the messages are maybe harmless. But I will use in any case python 2.2.3 for this task.
Regards Oliver
Am Die, 2003-06-03 um 17.49 schrieb Barry Warsaw:

On Tue, 2003-06-03 at 13:52, Oliver Egginger wrote:
So I think (in this case), it's likely rather a mailman/python (2.2.2) issue than a Mailman/Linux distro topic.
Good thing Python 2.2.3 is out now, then! :)
I definitely haven't seen the problem on any RH9 or RH7.3 system with Python 2.2.2 built from scratch.
the-gremlins-have-found-another-playmate-for-now-ly y'rs, -Barry

Oliver,
FWIW, I'm running a source-installed Mailman 2.1.2 and source-installed Python 2.2.2 on a maintained Red Hat 7.1 system, and I haven't seen a single message in my Mailman error log.
Regards, Wes
Wes Perdue IT Manager, Greenfield Networks
At 07:52 PM 6/3/2003 +0200, Oliver Egginger wrote:

On Tue, 2003-05-20 at 04:23, Oliver Egginger wrote:
To be honest, I'm at a loss. It seems to me like a Python problem, but it's definitely not something I see or can reproduce. The only thing I can recommend is to try to upgrade to Python 2.2.3 and see if that helps at all. Other than that...?
-Barry

On Wednesday, May 14, 2003, at 08:14 AM, Oliver Egginger wrote:
I'd like to understand better what exactly breaks on Mandrake.
Certainly, I've never had a problem on various Redhati. AFAIK, that
argument is mostly for process listings, e.g. ps and doesn't have any
semantic value.
It is possible to correct this in future releases? What do you think?
As you can tell by the comment just preceding these lines, I've thought about different values for argv0 and settled on 'qrunner' because it looks the best to me when I do a ps listing. On my RH9 system, if I use the empty string, then it eats arg1. So I'd consider using mm_cfg.PYTHON, but then the command line gets pretty long. 'qrunner' just looks the best so I'm disinclined to change that unless it fixes a real bug.
-Barry

os.execl(mm_cfg.PYTHON, mm_cfg.PYTHON , exe, rswitch, '-s') os.execl(mm_cfg.PYTHON, 'python' , exe, rswitch, '-s') or os.execl(exe , exe, rswitch, '-s')
should work. The corresponding C systemcalls gets normally used this way.
Furthermore the first suggestion os.execl(mm_cfg.PYTHON, '' , exe, rswitch, '-s') should work too but in the meantime I would prefer one of the three versions above.
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s')
crashs on my system with: Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix>
Then it breaks with the error message: ImportError: No module named getopt File "/home/mailman/bin/qrunner", line 72, in ? import getopt ImportError: No module named getopt
The messages gets repreatet several times then it breaks completely.
The suggested modification solve this problem. The Qrunners starts up and everything seems to work normal.
The only eye-catching thing is that I receive some error messages in the verbose mode during the qrunners starting up. I think this is another problem but maybe it gives you a hint. Here is one of them:
# clear __builtin__._ Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear __builtin__._
Nevertheless Mailman seems to work normal.
- oliver

--On Thursday, May 15, 2003 10:29 AM +0200 Oliver Egginger <Oliver.Egginger@dvz.fh-giessen.de> wrote:
ARGV[0] can be absolutely any null terminated string your heart desires. Many pieces of software do "interesting" things based on what ARGV[0] is set to (such as shells, which are "login" shells if ARGV[0][0] is '-').
Anything that assumes ARGV[0] actually exists in the filesystem is deluded.
-- Carson

Am Don, 2003-05-15 um 14.42 schrieb Carson Gaspar:
As far as I am concerned but it is the common practice to set ARGV[0] to the program name. Last but not least every shell calls other programs this way and python gets started from shell a million times every day all over the world.
It depends on the current program, in this case python 2.2.2, how ARGV[0]is treated. In this case it will not work if you break the common practice described above.
Maybe this is only true for a few (maybe broken) Mandrake python installations.
But are you completely sure that ARGV[0] is of no relevance for every python interpreter?
I'am far away of being a python specialist.
- oliver

On Thu, 15 May 2003, Oliver Egginger wrote:
This bug breaks several python installations. It don't work for my Mandrake system for example.
Could you post the chunk of the execl manpage from Mandrake describing execl?
Not quite sure if the file name or the full path is called for by the manpage snippet below... Swapping in "exe" would leave the string "qrunner" there but add the rest of the path to qrunner as well... ...which might be beneficial for people running more than one installation on a box (independent of whether or not that is possible or a good idea :-)...
"The const char *arg and subsequent ellipses in the execl(), execlp(), and execle() functions can be thought of as arg0, arg1, ..., argn. Together they describe a list of one or more pointers to null-terminated strings that represent the argument list available to the executed program. The first argument, by convention, should point to the file name associated with the file being executed."
os.execl(mm_cfg.PYTHON, 'qrunner', exe, rswitch, '-s')
crashs on my system with:
Just out of curiosity, are either qrunner or python in your path?
Dale Newfield <Dale@Newfield.org>

Could you post the chunk of the execl manpage from Mandrake describing execl?
The execl isn't the problem. It works according to the rules.
Just out of curiosity, are either qrunner or python in your path?
At the moment I am relatively sure, that the python 2.2.2 binary on my Mandrake 9.1 system exspects itself on ARGV[0]. If ARGV[0] yields a different value than 'python', 'python2.2', '/usr/bin/python' or '/usr/bin/python2.2' the described import errors occurs.
My python binary expects a executable python binary on ARGV[0] or it don't run with imports.
I don't know why.
- oliver

On Thu, 2003-05-15 at 10:30, Oliver Egginger wrote:
Ok, I know what's going on, and it's not Mandrake specific, although the interaction between the default Python installation on the system, and your $PATH is probably causing you to see the bug where most people might not.
I'd forgotten that the Python interpreter uses argv[0] to calculate the path to its libraries. I don't have time to tease out all the subtle interactions between $PATH, argv[0], your Python installations, --prefix, and --exec-prefix, but see Python's getpath.c mega-comment for details.
Suffice to say, the full absolute path to Python (i.e. mm_cfg.PYTHON) should be passed to argv[0] in the os.execl() call for everything to work correctly. Alternatively, I could set $PYTHONHOME, but I think that's a bit more fragile.
I'll commit the fix. -Barry

On Thu, 2003-05-15 at 04:29, Oliver Egginger wrote:
What does the following give you:
% python Python 2.2.2 (#1, Apr 28 2003, 12:01:50) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
? -Barry

What does the following give you:
~$ python Python 2.2.2 (#2, Feb 5 2003, 10:40:08) [GCC 3.2.1 (Mandrake Linux 9.1 3.2.1-5mdk)] on linux-i386 Type "help", "copyright", "credits" or "license" for more information.
Much the same thing. Compared with your output, I would say.
Could these error messages somehow or other have serious consequences?
- oliver
Am Fre, 2003-05-16 um 17.11 schrieb Barry Warsaw:

On Mon, 2003-05-19 at 03:24, Oliver Egginger wrote:
What does
unicode('foo', 'ascii')
give you?
If you get the same SystemError, then there's something screwy with your Python installation. If not, then double check that when you applied the mailmanctl patch, you are really using it. This means, stop the original mailmanctl, re-run configure (or config.status), re-install and then re-start mailmanctl.
-Barry

u'foo'
I did it. No change. Also Mailman doesn't start up on my system without the patch, so I have to use it.
Independent from this error messages during the start and stop phase mailman seems to work well. There are no irregularities.
But further particulars:
when I comment out the line 126 in mailmanctl the error messages go away. Here is the line LogStdErr('error', 'mailmanctl', manual_reprime=0)
I execute this function call with python -v on command line via:
and receive:
<Mailman.Logging.MultiLogger.MultiLogger instance at 0x80fe374>
without error messages. So it seems to work.
But when I terminate the python session by typing CTRL-D (end of input) I receive the same error messages as I get from mailmanctl during the start and stop phase. I have trailed them at the end of this message.
Also it seems as if the error messages came from Mailman.Logging.Utils import LogStdErr. Maybe by destroying the objects which gets created by LogStdErr('error', 'mailmanctl', manual_reprime=0). The function seems to work, none the less the shutdown of the corresponding objects seems to fail. But I'am no python expert.
Here are the error messages from: python -v
**** and then I typing CTRL-D and got this:
# clear __builtin__._ Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear __builtin__._
# clear sys.path Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.path
# clear sys.argv Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.argv
# clear sys.ps1 Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.ps1
# clear sys.ps2 Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.ps2
# clear sys.exitfunc Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exitfunc
# clear sys.exc_type Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exc_type
# clear sys.exc_value Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exc_value
# clear sys.exc_traceback Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.exc_traceback
# clear sys.last_type Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.last_type
# clear sys.last_value Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.last_value
# clear sys.last_traceback Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # clear sys.last_traceback
# restore sys.stdin Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # restore sys.stdin
# restore sys.stdout Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # restore sys.stdout
# restore sys.stderr Logging error: <StampedLogger to '/home/mailman/logs/error'> Traceback (most recent call last): File "/home/mailman/Mailman/Logging/MultiLogger.py", line 43, in write logger.write(msg) File "/home/mailman/Mailman/Logging/StampedLogger.py", line 73, in write Logger.write(self, "%s %s" % (prefix, msg)) File "/home/mailman/Mailman/Logging/Logger.py", line 88, in write msg = unicode(msg, self.__encoding) SystemError: codec module not properly initialized Original log message: # restore sys.stderr
# cleanup __main__ # cleanup[1] __future__ # cleanup[1] site # cleanup[1] Mailman # cleanup[1] paths # cleanup[1] strop # cleanup[1] _codecs # cleanup[1] korean # cleanup[1] string # cleanup[1] japanese # cleanup[1] readline # cleanup[1] korean.aliases # cleanup[1] Mailman.Version # cleanup[1] signal # cleanup[1] posix # cleanup[1] japanese.aliases # cleanup[1] encodings # cleanup[1] Mailman.Defaults # cleanup[1] Mailman.Logging # cleanup[1] Mailman.Logging.Utils # cleanup[1] Mailman.Logging.Logger # cleanup[1] encodings.latin_1 # cleanup[1] codecs # cleanup[1] traceback # cleanup[1] linecache # cleanup[1] encodings.aliases # cleanup[1] exceptions # cleanup[1] Mailman.mm_cfg # cleanup[1] Mailman.Logging.MultiLogger # cleanup[1] Mailman.Logging.StampedLogger # cleanup[1] struct # cleanup[1] types # cleanup[1] time # cleanup[2] copy_reg # cleanup[2] os.path # cleanup[2] stat # cleanup[2] UserDict # cleanup[2] posixpath # cleanup[2] os # cleanup sys # cleanup __builtin__ # cleanup ints: 5 unfreed ints in 1 out of 5 blocks # cleanup floats
- oliver

Hello again,
meanwhile I set up a debian "woody" with MM 2.1.2, but I receive the same error messaes like under Mandrake 9.1.
I installed both systems strict from the provides packets of this distributions (except that I used MM 2.1.2).
Please oblige me and start the qrunner in the verbose mode, for example by typing python -v mailmanctl start in the mailman/bin directory.
I'am sure you will get the same error messages. (See the quoted message below.)
And do the following:
%python -v
*** Then typing CTRL-D (for and of input) ***
This will result in the same error messages.
This means, when I comment out the line 126 in mailmanctl, namely LogStdErr('error', 'mailmanctl', manual_reprime=0), the error messages will go away.
Are these error messages normal? Will they only appear under Mandrake 9.1 and debian woody? Can they cause any harm? Can I comment out line 126? Which linux distribution I should use for Mailman 2.1.2?
- oliver
Am Die, 2003-05-20 um 10.23 schrieb Oliver Egginger:

On Wed, 2003-05-28 at 13:27, Oliver Egginger wrote:
meanwhile I set up a debian "woody" with MM 2.1.2, but I receive the same error messaes like under Mandrake 9.1.
BTW, I use RH9 and 7.3, but I really don't think it makes any difference. What /might/ make a difference is using the distro's Python or installing Python from source. Python 2.2.3 was just released; maybe a from-source installation will solve the problem.
I think you can actually ignore these messages. They probably won't hurt anything.
-Barry

Barry Warsaw wrote:
Python 2.2.3 was just released; maybe a from-source installation will solve the problem.
Yes! After installing python 2.2.3 from source and let mailman run under this python version the error messages are gone. That solve my case.
These error messages occurred under Mandrake 9.1 and Debian Woody, with the standard python 2.2.2 packages of this distributions. Maybe a python 2.2.2 problem as you have supposed.
Thank you!
- oliver

On Tue, 2003-06-03 at 11:14, Oliver Egginger wrote:
It seems we've had no end of trouble with packaged Python distros, especially with folks not installing all the related Python packages. A from-source install of Python usually clears things up because then you /know/ you're getting everything you need.
It would be helpful if people running various Linux distros do a little research to figure out which Python packages are required for Mailman to run. I'd be happy to add such information to README.LINUX.
-Barry

But it runs! Only during the shutdown and the startup I see these error messages: SystemError: codec module not properly initialized several times (using verbose mode).
Meanwhile I have translated, linked and installed python 2.2.2 from the original source tar ball, and I see the same error messages. (I only tested under ML 9.1 yet.)
When I go back to python 2.2.3 (installed from source) the error messages disappear.
So I think (in this case), it's likely rather a mailman/python (2.2.2) issue than a Mailman/Linux distro topic.
Maybe this is specific to my system, cause the configure scripts will produce different results on different systems. But maybe other people see those error messages with Mailman 2.1.2 and python 2.2.2 too.
Also the messages are maybe harmless. But I will use in any case python 2.2.3 for this task.
Regards Oliver
Am Die, 2003-06-03 um 17.49 schrieb Barry Warsaw:

On Tue, 2003-06-03 at 13:52, Oliver Egginger wrote:
So I think (in this case), it's likely rather a mailman/python (2.2.2) issue than a Mailman/Linux distro topic.
Good thing Python 2.2.3 is out now, then! :)
I definitely haven't seen the problem on any RH9 or RH7.3 system with Python 2.2.2 built from scratch.
the-gremlins-have-found-another-playmate-for-now-ly y'rs, -Barry

Oliver,
FWIW, I'm running a source-installed Mailman 2.1.2 and source-installed Python 2.2.2 on a maintained Red Hat 7.1 system, and I haven't seen a single message in my Mailman error log.
Regards, Wes
Wes Perdue IT Manager, Greenfield Networks
At 07:52 PM 6/3/2003 +0200, Oliver Egginger wrote:

On Tue, 2003-05-20 at 04:23, Oliver Egginger wrote:
To be honest, I'm at a loss. It seems to me like a Python problem, but it's definitely not something I see or can reproduce. The only thing I can recommend is to try to upgrade to Python 2.2.3 and see if that helps at all. Other than that...?
-Barry
participants (6)
-
Barry Warsaw
-
Carson Gaspar
-
Dale Newfield
-
Dan Mick
-
Oliver Egginger
-
Wesley T. Perdue