AttributeError: Message instance has no attribute 'get_type'

I've installed 2.1.10b4 from scratch and I'm getting the following error:
Mar 16 01:26:11 2008 (2076) Uncaught runner exception: Message instance has no attribute 'get_type' Mar 16 01:26:11 2008 (2076) Traceback (most recent call last): File "/home/mailman/Mailman/Queue/Runner.py", line 114, in _oneloop self._onefile(msg, msgdata) File "/home/mailman/Mailman/Queue/Runner.py", line 185, in _onefile keepqueued = self._dispose(mlist, msg, msgdata) File "/home/mailman/Mailman/Queue/OutgoingRunner.py", line 74, in _dispose self._func(mlist, msg, msgdata) File "/home/mailman/Mailman/Handlers/SMTPDirect.py", line 159, in process deliveryfunc(mlist, msg, msgdata, envsender, refused, conn) File "/home/mailman/Mailman/Handlers/SMTPDirect.py", line 292, in verpdeliver Decorate.process(mlist, msgcopy, msgdata) File "/home/mailman/Mailman/Handlers/Decorate.py", line 133, in process elif msg.get_type() == 'multipart/mixed': AttributeError: Message instance has no attribute 'get_type'
Mar 16 01:26:11 2008 (2076) SHUNTING: 1205623299.1393819+488d99e2bbef7631f7c6da12b2bf6bc48b203157
Atm I commented out the line in Handlers/Decorate.py
# elif msg.get_type() == 'multipart/mixed':
and put instead
elif msgtype == 'multipart/mixed':
It seems it works this way, but I'm not sure if it doesn't break anything else.
Any advice with this?
Regards, Grigory

Grigory Mokhin wrote:
I've installed 2.1.10b4 from scratch and I'm getting the following error:
Mar 16 01:26:11 2008 (2076) Uncaught runner exception: Message instance has no attribute 'get_type' Mar 16 01:26:11 2008 (2076) Traceback (most recent call last): File "/home/mailman/Mailman/Queue/Runner.py", line 114, in _oneloop self._onefile(msg, msgdata) File "/home/mailman/Mailman/Queue/Runner.py", line 185, in _onefile keepqueued = self._dispose(mlist, msg, msgdata) File "/home/mailman/Mailman/Queue/OutgoingRunner.py", line 74, in _dispose self._func(mlist, msg, msgdata) File "/home/mailman/Mailman/Handlers/SMTPDirect.py", line 159, in process deliveryfunc(mlist, msg, msgdata, envsender, refused, conn) File "/home/mailman/Mailman/Handlers/SMTPDirect.py", line 292, in verpdeliver Decorate.process(mlist, msgcopy, msgdata) File "/home/mailman/Mailman/Handlers/Decorate.py", line 133, in process elif msg.get_type() == 'multipart/mixed': AttributeError: Message instance has no attribute 'get_type'
Mar 16 01:26:11 2008 (2076) SHUNTING: 1205623299.1393819+488d99e2bbef7631f7c6da12b2bf6bc48b203157
Atm I commented out the line in Handlers/Decorate.py
# elif msg.get_type() == 'multipart/mixed':
and put instead
elif msgtype == 'multipart/mixed':
It seems it works this way, but I'm not sure if it doesn't break anything else.
That's not the correct workaround. If you want to work around it, you should change
elif msg.get_type() == 'multipart/mixed':
to elif msg.get_content_type() == 'multipart/mixed':
but you'd need to make those changes in several places.
The real issue is that there should be a pythonlib/ directory in your $prefix directory, and that in turn should have an email/ directory which is the email 2.5.8 package. This should all have been installed by 'configure','make install' process.
So, what do you have? What went wrong that you are using the email package from your Python installation instead of Mailman's?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On 3/16/08, Mark Sapiro <mark@msapiro.net> wrote:
That's not the correct workaround. If you want to work around it, you should change
elif msg.get_type() == 'multipart/mixed':
to elif msg.get_content_type() == 'multipart/mixed':
Earlier in Decorate.py there is a line: msgtype = msg.get_content_type(), seems pretty much the same thing.
The real issue is that there should be a pythonlib/ directory in your $prefix directory, and that in turn should have an email/ directory which is the email 2.5.8 package. This should all have been installed by 'configure','make install' process.
pythonlib/ directory is empty. I see email 2.5.8 gzipped package in the source misc/ directory, obviously it was not installed by make install.
So, what do you have? What went wrong that you are using the email package from your Python installation instead of Mailman's?
Nothing went wrong. It was installation from src that went fine without any warnings.
Configure was invoked as ./configure --prefix=/home/mailman --with-mail-gid=mailman --with-cgi-gid=apache --with-mailhost=xxx with-urlhost=xxx
Regards, Grigory

Grigory Mokhin wrote:
On 3/16/08, Mark Sapiro <mark@msapiro.net> wrote:
That's not the correct workaround. If you want to work around it, you should change
elif msg.get_type() == 'multipart/mixed':
to elif msg.get_content_type() == 'multipart/mixed':
Earlier in Decorate.py there is a line: msgtype = msg.get_content_type(), seems pretty much the same thing.
Yes. That's correct in this case, but there are at least 12 other uses of the message get_type() method in other Mailman modules, so unless you want to change them all, it's better to figure out why you don't have the proper pythonlib/
The real issue is that there should be a pythonlib/ directory in your $prefix directory, and that in turn should have an email/ directory which is the email 2.5.8 package. This should all have been installed by 'configure','make install' process.
pythonlib/ directory is empty. I see email 2.5.8 gzipped package in the source misc/ directory, obviously it was not installed by make install.
So, what do you have? What went wrong that you are using the email package from your Python installation instead of Mailman's?
Nothing went wrong. It was installation from src that went fine without any warnings.
Configure was invoked as ./configure --prefix=/home/mailman --with-mail-gid=mailman --with-cgi-gid=apache --with-mailhost=xxx with-urlhost=xxx
Is there a Makefile in the source misc/ directory? was it executed during make install? This Makefile should among other things install the email library and Japanese and Korean codecs in pythonlib.
You could try just running 'make install' in the source misc/ directory and see what happens.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Grigory Mokhin
-
Mark Sapiro