473,403 Members | 2,071 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,403 software developers and data experts.

mailbox module in Python 2.3.4

I've written a script that uses the mailbox module. It works on my local machine with python 2.5. On loading it onto my web hosting provider's server it doesn't work. They are running Python 2.3.4. Is this likely to be the reason?

I've tried loading the 2.5 version of mailbox.py onto the web server - now I get some different errors.

When was mailbox introduced?

Is there a version that'll run on python 2.3.4?

If not, what changes would I have to make to get it to work - assuming that this is feasible?

Thanks - Rowan
Jul 25 '07 #1
3 1047
bartonc
6,596 Expert 4TB
Misc. Q.s Moderator, please move to the Python Forum . Thank you.
Jul 25 '07 #2
bartonc
6,596 Expert 4TB
I've written a script that uses the mailbox module. It works on my local machine with python 2.5. On loading it onto my web hosting provider's server it doesn't work. They are running Python 2.3.4. Is this likely to be the reason?

I've tried loading the 2.5 version of mailbox.py onto the web server - now I get some different errors.

When was mailbox introduced?

Is there a version that'll run on python 2.3.4?

If not, what changes would I have to make to get it to work - assuming that this is feasible?

Thanks - Rowan
It's highly feasible, but we'd need to see some code to point out where you have a compatibility issue.
Jul 25 '07 #3
bartonc
6,596 Expert 4TB
I replaced Python 2.3's mailbox.py with the version for Python 2.5, but the following error:


>>> import mailbox
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib64/python2.3/mailbox.py", line 928
return iter(sorted(int(entry) for entry in os.listdir(self._path)
^
SyntaxError: invalid syntax
And the reply :
Most modules in the Python standard library aren't written to be compatible with earlier versions of Python, so that bit of code is using a generator comprehension. To use the module with Python 2.3,
you'd have to rewrite that line to create and sort a list instead.
Jul 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Chuck Amadi | last post by:
Has anyone got a simple python script that will parse a linux mbox and create a large file to view . Cheers Chu
6
by: chuck amadi | last post by:
Hi , Im trying to parse a specific users mailbox (testwwws) and output the body of the messages to a file ,that file will then be loaded into a PostGresql DB at some point . I have read the...
16
by: Chuck Amadi | last post by:
Sorry to bovver you again (again) here's script. I still can't see why the get_payload() doesn't produce the plain text message body of an emails in the testwwws users mailbox. As you can see I...
0
by: David Stockwell | last post by:
Hi, After looking at http://docs.python.org/lib/module-mailbox.html I am a bit confused. The bottom of the page refers to some shortcut usage for getting a mail box import email import...
3
by: noah | last post by:
Is there a way to figure out what filename an email object points to in a qmail style Maildir directory? Hmmm... I don't think so, but I'm hoping I wrong. I instantiated a Maildir mailbox and...
2
by: Nirnimesh | last post by:
I want to extract emails from an mbox-type file which contains a number of individual emails. I tried the python mailbox and email modules individually, but I'm unable to combine them to get...
0
by: jesse.k.rosenthal | last post by:
Dear all, I'm trying to figure out if mailbox will let me get the flags of a Maildir message without running get_message on it, and reading the whole message. It seems like it should work by...
2
by: tinnews | last post by:
I am trying to write a utility to remove empty maildir mailboxes. It sounds like this should be very simple but it's proving really difficult. I'm doing this on a Fedora 7 system with python...
1
by: ra9ftm | last post by:
Hi all. I am trying to use mailbox module, mbox class like this: import mailbox m1 = mailbox.mbox('./ra9ftm2') But it gives the following: ra9ftm:/home/ra9ftm/pyemail# python mbox1.py...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.