473,395 Members | 1,578 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,395 software developers and data experts.

Re: py2exe bug with email.MIMEText

Hi,

After some debugging, i found the solution is to :-

import email
import email.mime.text
import email.iterators
import email.generator
import email.utils

Marcus.
Marcus.CM wrote:
There is a bug with py2exe when (at least under windows) when
importing email

# example testmime.py
import email
msg = email.MIMEText.MIMEText("dsafdafdasfA")
print "ok"

1. Save the text above and setup as testmime.py
2. Run it and u can see "ok"
3. Create setup.py and run : python setup.py py2exe
4. Run the testmime.exe and u will get error "Import error : No module
name text"

# Example setup.py
from distutils.core import setup
import py2exe
setup(console=['testmime.py'])

Anyone knows the fix for this?

--
http://mail.python.org/mailman/listinfo/python-list

Aug 1 '08 #1
0 910

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

Similar topics

1
by: Mark Hahn | last post by:
I'm using the MIMEText module as part of sending email with no problem until I put it through py2exe. Then I get this error: LookupError: unknown encoding: ascii .... on this line ... File...
3
by: Alberto Vera | last post by:
Hello: Could you tell me How I can send an email using WIN2000? What do I need? Thanks
1
by: Irmen de Jong | last post by:
Hi I'm trying to create e-mail content using the email.MIMEText module. It basically works, until I tried to send mail in non-ascii format. What I did, to test both iso-8859-15 and UTF-8...
7
by: Lad | last post by:
Can anyone give an example how to send email with non-ascii characters( both in subject and body). I would like to use windows-1250 code page Thank you L.B.
9
by: Ernesto | last post by:
Is there a special module for mail ? I'd like to send an email from a python script. Thanks !
20
by: Chris Withers | last post by:
Hi All, The following piece of code is giving me issues: from email.Charset import Charset,QP from email.MIMEText import MIMEText charset = Charset('utf-8') charset.body_encoding = QP msg =...
3
by: Erik Johnson | last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an attached HTML file. I have scripts that send basic emails via the smtplib module that don't have any attachements and that...
2
by: Torsten Bronger | last post by:
Hallöchen! I thought that with the following code snippet, I could generate a MIME email stub: #!/usr/bin/env python # -*- coding: utf-8 -*- from email.MIMEText import MIMEText from...
0
by: Marcus.CM | last post by:
There is a bug with py2exe when (at least under windows) when importing email # example testmime.py import email msg = email.MIMEText.MIMEText("dsafdafdasfA") print "ok" 1. Save the text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.