Here is an example of the problem I am running into. I am using the Python Win32 extensions to access an Outlook mailbox and retrieve messages.
Below is a script that should write "hello world" to a text file. I need to grab some messages from an Outlook mailbox and I noticed something weird. After I attach to the mailbox once, I can no longer print anything to a file. Here is a trimmed down version showing the problem:
#!/usr/bin/env python
from win32com.client import Dispatch
fh = open('foo.txt', 'w')
fh.write('hello ')
fh.close()
session = Dispatch('MAPI.session')
session.Logon('','',0,1,0,0,'exchange.foo.com\nprodreport');
session.Logoff()
fh = open('foo.txt', 'a')
fh.write('world')
fh.close()
If I don't attach to the mailbox and comment out the following lines, it obviously works fine:
session = Dispatch('MAPI.session')
session.Logon('','',0,1,0,0,'exchange.foo.com\ncorey');
session.Logoff()
Why is opening a session to a mailbox in the middle of my script blocking further file output? any ideas? (other operations are not blocked, just this file i/o asfaik)