473,378 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Error in the email module documentation ?

Hi all,

While reading the email module documentation, I found an error in a
small example given for the as_string() method of the Message class:
Here is the given code :

(URL : http://python.org/doc/current/lib/mo...l.Message.html)

from cStringIO import StringIO
from email.Generator import Generator
fp = StringIO()
g = Generator(mangle_from_=False, maxheaderlen=60)
g.flatten(msg)
text = fp.getvalue()
The Generator constructor should take the StingIO instance as first
argument, am I wrong ?

Although this is only a small mistake, I think it should always
be fixed.

If I've missed something or if this error have already been reported,
just forget my mail.

Cheers,

--
Adrien Di Mascio
LOGILAB, Paris (France).
http://www.logilab.com http://www.logilab.fr http://www.logilab.org
Jul 18 '05 #1
1 1695

"Adrien Di Mascio" <Ad*************@logilab.fr> wrote in message
news:ma**********************************@python.o rg...
Hi all,

While reading the email module documentation, I found an error in a
small example given for the as_string() method of the Message class:
Here is the given code :

(URL : http://python.org/doc/current/lib/mo...l.Message.html)
from cStringIO import StringIO
from email.Generator import Generator
fp = StringIO()
g = Generator(mangle_from_=False, maxheaderlen=60)
g.flatten(msg)
text = fp.getvalue()
The Generator constructor should take the StingIO instance as first
argument
Based on 12.2.3 Generating MIME documents:'''
class Generator( outfp[, mangle_from_[, maxheaderlen]])
The constructor for the Generator class takes a file-like object
called outfp for an argument. outfp must support the write() method
and be usable as the output file in a Python extended print statement.
''',
yes.
am I wrong ?
No
Although this is only a small mistake, I think it should always
be fixed.


Of course, Python docs strive for perfection. I did not find report
in Python/Doc bugs list so added to SourceForge as bug 817178
Email.message example missing arg

Terry J. Reedy
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: Qiao Yun | last post by:
I used vc++.net (visual studio .net ) to open a project which can work well in vc++6.0. I succeeded in compiling the project in vc++.net in release mode . But when I tried to compile the project...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.