mailbox module difficulties

E

Eduardo Alvarez

Hello, everyone,

I'm in the process of learning how to use the mailbox module with python
3.2. I've noticed the following seemingly inconsistent behavior:

if I call a Maildir object directly, the module works perfectly. I can,
for example, call

mailbox.Maildir("~/Maildir").items()

and get the expected list of (key,Message) pairs.

however, if I do the following:

b = mailbox.Maildir("~/Maildir")
b.items()

I get an empty list.

I don't understand why this is so, specially since the last example in
the documentation shows a reference to a Maildir object being created.
Why does this happen?

yours,
 
C

Chris Angelico

if I call a Maildir object directly, the module works perfectly. I can,
for example, call

mailbox.Maildir("~/Maildir").items()

and get the expected list of (key,Message) pairs.

however, if I do the following:

b = mailbox.Maildir("~/Maildir")
b.items()

I get an empty list.

They ought to be equivalent. Can you post your whole code? Maybe
there's some other difference.

ChrisA
 
P

Peter Otten

Eduardo said:
however, if I do the following:

b = mailbox.Maildir("~/Maildir")
b.items()

I get an empty list.

I don't understand why this is so, specially since the last example in
the documentation shows a reference to a Maildir object being created.
Why does this happen?

Could this be

http://bugs.python.org/issue13254

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top