[Twisted-Python] Problem creating working .tap file

Brian Warner warner at lothar.com
Fri May 16 16:52:03 EDT 2003


> something strange shows up here. I try to create a TAP from a pb application.
> The tap is created nicely, but I get an error when starting it:
> 
> Failed to load application: <twisted.persisted.styles.Ephemeral instance at 
> 0x82450a4> is not safe for unpickling

This is a pretty common gotcha. The class name of your Echoer() object is
stored in the tap file, and used at startup time to import the necessary
code. However, in your program, the class name is really __main__.Echoer. You
need to to a 'from myfile import Echoer' in the block where you perform the
listenTCP.

More details in <http://twistedmatrix.com/documents/howto/faq#auto15>,
"twistd won't load my .tap file!". I've added a note about the Ephemeral
message to make it easier to search for.

cheers,
 -Brian




More information about the Twisted-Python mailing list