[Twisted-Python] Twisted Trial changes working directory

Gerrat Rickert grickert at coldstorage.com
Fri Jul 3 08:17:12 MDT 2009


I have a (Twisted) program that saves & uses a file in the current
working directory.
When running tests for the program, Trial changes the working directory,
causing this file to be written into the '_trial_temp' directory
instead.
...so the program works differently when run via Trial vs. in normal
use.

There are a number of solutions to this, but I'd just like to understand
the reasoning behind this surprising behaviour.
The docs say that this: "...allows them to write whatever data they like
to disk, and not worry about polluting the current working directory"
...couldn't they just do this without changing the working directory?

One of the things I love about python is that things just seem to work
like you expect - I'm rarely surprised by it's behaviour.
Twisted, OTOH, continually surprises me...and not like
getting-a-pony-on-your-10th-birthday type of surprise.

Don't get me wrong, I love Twisted...it makes writing
networked/asynchronous programs a breeze.  
...everything I write now (in Python), just seems to "need" Twisted.
I just find Twisted's idiosyncrasies frustrating sometimes.

Sorry for the rant,
	Gerrat





More information about the Twisted-Python mailing list