[Twisted-Python] Incompatible changes to twistd 16.3.2 to 16.4.0
![](https://secure.gravatar.com/avatar/c4daed4d9cc7df1188e9521b5d3a784d.jpg?s=120&d=mm&r=g)
Dear all, I am experiencing an issue with my twistd plugin. It is in a project_plugin.py file in the twisted/plugins directory of my project. Calling "twistd --help" works fine up to twistd version 16.3.2 but in 16.4.0 the plugin is not recognized anymore. This is how it looks like: from zope.interface import implementer from twisted.application.service import IServiceMaker from twisted.application import internet from twisted.plugin import IPlugin from twisted.python import usage from myfile import MyFactory class Options(usage.Options): optParameters = [["port", "p", 8000, "The port number to listen on."], ["my-hostname", "l", "", "the hostname of other server"], ["my-port", "i", 9000,"the port of the other server"]] @implementer(IServiceMaker, IPlugin) class MyServiceMaker(object): tapname = "myserver" description = "" options = Options def makeService(self, options): return internet.TCPServer(int(options["port"]), MyFactory(options["my-hostname"], options["my-port"])) serviceMaker = MyServiceMaker() Any help is appreciated. Thomas
![](https://secure.gravatar.com/avatar/ad5d35adba8666840c8ce22c1a43ef1f.jpg?s=120&d=mm&r=g)
On Tue, Jul 11, 2017 at 11:04 AM, Thomas Westfeld <thomas.westfeld@currenta.de> wrote:
This is a PYTHONPATH thing if I remember correctly. '.' was removed from the path as a side effect of making twistd a 'console script' and this was seen as a good/safer thing. I believe the proper solution is to install the Python package that contains your twisted/plugins/ directory. Here's a link to a mentioning email on this mailing list back then: https://twistedmatrix.com/pipermail/twisted-python/2016-September/030782.htm... Hope this helps, /dan -- Daniel Sutcliffe <dansut@gmail.com>
![](https://secure.gravatar.com/avatar/c4daed4d9cc7df1188e9521b5d3a784d.jpg?s=120&d=mm&r=g)
Hello Daniel, Indeed you were correct, the PYTHONPATH made the difference. Thank you! Thomas This is a PYTHONPATH thing if I remember correctly. '.' was removed from the path as a side effect of making twistd a 'console script' and this was seen as a good/safer thing. I believe the proper solution is to install the Python package that contains your twisted/plugins/ directory.
![](https://secure.gravatar.com/avatar/ad5d35adba8666840c8ce22c1a43ef1f.jpg?s=120&d=mm&r=g)
On Tue, Jul 11, 2017 at 11:04 AM, Thomas Westfeld <thomas.westfeld@currenta.de> wrote:
This is a PYTHONPATH thing if I remember correctly. '.' was removed from the path as a side effect of making twistd a 'console script' and this was seen as a good/safer thing. I believe the proper solution is to install the Python package that contains your twisted/plugins/ directory. Here's a link to a mentioning email on this mailing list back then: https://twistedmatrix.com/pipermail/twisted-python/2016-September/030782.htm... Hope this helps, /dan -- Daniel Sutcliffe <dansut@gmail.com>
![](https://secure.gravatar.com/avatar/c4daed4d9cc7df1188e9521b5d3a784d.jpg?s=120&d=mm&r=g)
Hello Daniel, Indeed you were correct, the PYTHONPATH made the difference. Thank you! Thomas This is a PYTHONPATH thing if I remember correctly. '.' was removed from the path as a side effect of making twistd a 'console script' and this was seen as a good/safer thing. I believe the proper solution is to install the Python package that contains your twisted/plugins/ directory.
participants (2)
-
Daniel Sutcliffe
-
Thomas Westfeld