I've given up trying to solve a bug that popped up in my scripts a couple days ago. I run a bot for Wookieepedia, over at Wikia, and run three simple scripts on a daily basis. They are set up to run automatically through Windows Task Scheduler. Since they run automatically, they run in the background through pythonw.exe, i.e. without a console, and therefore I need a means of getting the output. My solution for the past two months has been to redirect sys.stdout and sys.stderr to the same StringIO() instance, then at the end call getvalue() on that and email it to myself.
This worked perfectly until a couple days ago. Suddenly, I stopped receiving anything sent through pywikibot.output() or its cousins, although I continued to receive my own output that was produced by print statements. After some experimenting in the interactive interpreter, I determined that somehow pywikibot.ui (the interface instance) is not storing the correct stdout and stderr, but I don't know what's causing this.
Nothing in my scripts changed around the time this started happening, and I had not updated pywikibot or python itself in quite a while. I did update pywikibot to the newest nightly version, but the bug persists. I'm asking here since this is directly connected to pywikibot. Any idea what could be going on?
(By the way, the answer is NOT "switch to core". I have tried to get core to run on my system and failed miserably after two hours of repeated attempts without even getting it to talk to the wiki. Compat worked perfectly on the first try. Until such time as core can be installed by a beginner, it is not for me.)
Jonathan Goble