Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

More email module troubles...<sigh>

4 views
Skip to first unread message

Sheila King

unread,
Feb 10, 2002, 1:43:35 AM2/10/02
to
OK, I don't think I'm losing my mind...I'm reading the docs
for the email module over and over. I've looked at this raw
email message and it doesn't appear to me to not be correctly
formed.

I am able to successfully read the following email in from a
file and instantiate it as an email.Message instance. I can
walk() the parts. I can retrieve the types of the parts,
etc...(OK, well the email module only detects a single part,
which is true...), however, when I try this:

msg.as_string()

I get the following Traceback:

>>> msg.as_string()
Traceback (most recent call last):
File "<pyshell#84>", line 1, in ?
msg.as_string()
File "E:\PYTHON\PYTHON22\lib\email\Message.py", line 59, in as_string
g(self, unixfrom=unixfrom)
File "E:\PYTHON\PYTHON22\lib\email\Generator.py", line 83, in __call__
self._write(msg)
File "E:\PYTHON\PYTHON22\lib\email\Generator.py", line 104, in _write
self._dispatch(msg)
File "E:\PYTHON\PYTHON22\lib\email\Generator.py", line 134, in _dispatch
meth(msg)
File "E:\PYTHON\PYTHON22\lib\email\Generator.py", line 240, in _handle_multipart
for part in msg.get_payload():
File "E:\PYTHON\PYTHON22\lib\email\Message.py", line 151, in __getitem__
return self.get(name)
File "E:\PYTHON\PYTHON22\lib\email\Message.py", line 214, in get
name = name.lower()
AttributeError: 'int' object has no attribute 'lower'


Umm...I don't think I'm doing anything wrong?

Here is the raw message that I'm testing with, below this sig...

--
Sheila King
http://www.thinkspot.net/sheila/

"When introducing your puppy to an adult cat,
restrain the puppy, not the cat." -- Gwen Bailey,
_The Perfect Puppy: How to Raise a Well-behaved Dog_


From DirecTV4Free!!!!@yahoo.com Fri Feb 08 04:45:43 2002
Return-Path: <DirecTV4Free!!!!@yahoo.com>
Delivered-To: xthinksp...@thinkspot.net
Received: (qmail 3201 invoked from network); 8 Feb 2002 09:45:03 -0000
Received: from unknown (HELO mx.futurequest.net) (130.91.184.200)
by pt01.futurequest.net (63.151.147.170) with SMTP; 08 Feb 2002 09:45:03 -0000
From: "DirecTV 4 Free" <DirecTV4Free!!!!@yahoo.com>
Date: Fri, 08 Feb 2002 04:45:43
To: use...@thinkspot.net
Subject: DirecTV 4 Free!!!!
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_NextPart_MIMSCHNGDM"
Content-Transfer-Encoding: 7bit
Message-ID: PM20004:45:43 AM

This is an HTML email message. If you see this, your mail client does not support HTML messages.

------=_NextPart_MIMSCHNGDM
Content-Type: text/html;charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<title>Do you have a DirecTV system</title>
<style>
<!--
DIV.Section1 {
page: Section1
}
SPAN.GramE {

}
H2 {
FONT-WEIGHT: normal; FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman"; margin-left:0cm;
margin-right:0cm; margin-top:0cm; margin-bottom:0pt
}
-->
</style>
</head>

<body>

<p>&nbsp;&nbsp;&nbsp;&nbsp; Do you have a DirecTV system? Are you tired of
paying outrageous prices for what you have? Want more? Are you tired of sending
your card out to other people and waiting days, possibly paying fees, every time
DirecTV hits your card? Now you can re-set your own DIRECT TV Access Card
yourself. You can get all the DIRECT TV channels for free. That's over 300
channels, including all NFL, NHL, NBA, &amp; Sports, HBO, Pay-per-View, Movies &amp;
Events, XXX and Local Channels. You can do this by using our simple access card
activating device. It comes complete with the software you need, and simple
detailed instructions as well as full support. All you need is a home computer.</p>
<p>Not want to mess around with your card? We provide a service where you can
send your card to us and we load a PRIVATE Script on your card. The script we
have does not suffer the shutdowns from DirecTV like others may. The last time
our script was hit was in Oct. 2001, but if it does happen, we will fix it free
of charge. Not want to send your card? No problem, we can provide you with a
brand new card loaded with our software, you just put it in your receiver and
enjoy the shows.</p>
<p>Not have DirecTV? Paying outrageous amounts for your cable that you only get
a few channels on? Maybe not have cable available in your area or the &quot;other&quot;
satellite company isn't providing what you expect? We also have all of the
satellite equipment available in complete packages. DirecTV with TiVO, Ultimate
TV, etc. are also available.</p>
<p>Live in an area where high speed broadband internet access is not available?
We have cutting edge technology that can give you broadband internet access
while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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style="font-size: 18pt">
<a style="color: blue; text-decoration: underline; text-underline: single"
href="mailto:freesa...@yahoo.com?subject=I Would Like More Information">
CLICK HERE</a>.&nbsp; </span></p>
</blockquote>
</blockquote>
<p class="MsoNormal"><span style="font-size: 12pt">&nbsp;</span></p>
<p class="MsoNormal"><span style="font-size: 12pt">&nbsp;</span></p>
<p class="MsoNormal"><span style="font-size: 12pt">&nbsp;</span></p>
<h2>&nbsp;&nbsp;
<a href="mailto:freesa...@yahoo.com?subject=Remove From Your Mailing List Please">
Remove Me&nbsp; From Your Mailing List Please</a></h2>

</body>

</html>
------=_NextPart_MIMSCHNGDM--


Oleg Broytmann

unread,
Feb 10, 2002, 5:26:56 AM2/10/02
to
Hi!

On Sat, Feb 09, 2002 at 10:43:35PM -0800, Sheila King wrote:
> AttributeError: 'int' object has no attribute 'lower'

There is a bug in the email package. Barry said it was fixed in the CVS
(I think it is mimelib CVS, not Python CVS).

BTW, I am going to provide some other patches to the mimelib CVS, so
stay tuned.

Oleg.
--
Oleg Broytmann http://phd.pp.ru/ p...@phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.

0 new messages