[Python-bugs-list] [ python-Bugs-736407 ] Problem With email.MIMEText Package

SourceForge.net noreply at sourceforge.net
Wed Sep 3 06:15:47 EDT 2003


Bugs item #736407, was opened at 2003-05-12 05:41
Message generated for change (Comment added) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=736407&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: John Abel (judasiscariot)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Problem With email.MIMEText Package

Initial Comment:
Problem with email.MIMEText.  I created a MIMEText

message (following the example in the documentation). 

The problem occurs when as_string() is called.  This is

the traceback:



  File "/usr/local/lib/python2.3/email/Message.py",

line 113, in as_string

    g.flatten(self, unixfrom=unixfrom)

  File "/usr/local/lib/python2.3/email/Generator.py",

line 102, in flatten

    self._write(msg)

  File "/usr/local/lib/python2.3/email/Generator.py",

line 137, in _write

    self._write_headers(msg)

  File "/usr/local/lib/python2.3/email/Generator.py",

line 183, in _write_headers

    header_name=h, continuation_ws='\t').encode()

  File "/usr/local/lib/python2.3/email/Header.py", line

415, in encode

    return self._encode_chunks(newchunks, maxlinelen)

  File "/usr/local/lib/python2.3/email/Header.py", line

375, in _encode_chunks

    _max_append(chunks, s, maxlinelen, extra)

  File "/usr/local/lib/python2.3/email/quopriMIME.py",

line 84, in _max_append

    L.append(s.lstrip())

AttributeError: 'list' object has no attribute 'lstrip'



I'm using 2.3b1, on RH9.  The same piece of code works

with 2.2.2.



----------------------------------------------------------------------

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-09-03 08:15

Message:
Logged In: YES 
user_id=12800

Sorry, but you're going to have to work harder at trying to

boil down the buggy code.  When I run ServerMonitor.py, I

get an immediate traceback



Traceback (most recent call last):

  File "ServerMonitor.py", line 18, in ?

    import ThreadUtils, NetMon

ImportError: No module named ThreadUtils



Here's one thing you can try to do: catch the exception in

your code, then pickle the Message object up and post the

pickle.  I can at least reconstitute the pickle and look at

the structure.



Also, I'm guessing the problem is somewhere in ProcessMail()

in PostITControl.py.  Be sure that the mailBody argument is

a string and nothing else.

----------------------------------------------------------------------

Comment By: John Abel (judasiscariot)
Date: 2003-05-21 04:16

Message:
Logged In: YES 
user_id=221478

The Config.ini will need to modifying to suit your machine

settings.  Run the ServerMonitor.py, and then run

PostITControl.py.  PostITControl.py crashes when trying to

send a mail.

----------------------------------------------------------------------

Comment By: John Abel (judasiscariot)
Date: 2003-05-21 04:13

Message:
Logged In: YES 
user_id=221478

Sorry, been trying to narrow the code down.  If I have a

bare minimum script, it works, yet the original still fails.

 I'll upload the required files (3).

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-19 15:59

Message:
Logged In: YES 
user_id=12800

I'm moving this to Pending since wthout more information I

can't help. This starts the 14 day clock ticking.  After 2

weeks this bug report will be closed, unless someone follows

up with more information.

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-15 10:07

Message:
Logged In: YES 
user_id=12800

Sorry, the attached code sample is incomplete.  It is not

sufficient for me to reproduce the problem.



Please boil down your example to a self-contained -- but as

small as possible -- example.

----------------------------------------------------------------------

Comment By: John Abel (judasiscariot)
Date: 2003-05-15 05:32

Message:
Logged In: YES 
user_id=221478

Sorry, forgot the comment.  When running the script using

python2.2 (email 2.4.3), I don't receive any errors, mail

gets sent.  It only seems to happen with 2.3b.

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2003-05-13 11:45

Message:
Logged In: YES 
user_id=12800

Can you upload the exact code that you wrote that caused

this crash?  Please don't paste it.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=736407&group_id=5470



More information about the Python-bugs-list mailing list