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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top