Comments (3)
Thanks! I don't have any maildir folders to test the fix on. Can you tell me what the error is, so I can use the Python exception in the fix?
So if I replace
fp = open(mbox)
msg = email.message_from_file(fp)
fp.close()
with
try:
fp = open(mbox)
msg = email.message_from_file(fp)
fp.close()
except:
maildir = mailbox.Maildir(mbox, factory=None)
key, msg = maildir.popitem()
that should work, right?
But I'd really like to say except SomeSpecificException there, since email.message_from_file() might fail for other reasons (like specifying a file that isn't an mbox file).
Let me know if it works!
from scripts.
Yep. Use "except: IOError", and add an "import mailbox" line after the "except". Thanks!
from scripts.
This kind of fell by the wayside, but there have been some recent changes and some testing by someone who uses maildir, and it should work more solidly now.
from scripts.
Related Issues (14)
- termsize: without python HOT 4
- Awesome HOT 3
- be resilient to decoding issues? HOT 2
- conjunctions.py crash HOT 1
- Suggested add, to remove blank line before 'Reset...' text... HOT 4
- termsize: extra characters in urxvt HOT 1
- termsize curses version does not work for me HOT 4
- viewhtmlmail.py fails for certain characters HOT 1
- viewhtmlmail.py with Firefox HOT 9
- weborphans - will it work for website created by MkDocs? HOT 14
- termsize won't work with Python3 HOT 4
- python 3 and block=false HOT 1
- Can't install python-poppler-pyqt5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripts.