<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 17, 2012, at 8:53 PM, Itamar Turner-Trauring wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<div bgcolor="#FFFFFF" text="#000000">
Apparently this was removed as part of deprecating the old strports
syntax, but:<br>
<br>
1) "twistd web --port=9000" never gave a deprecation warnings.<br></div></blockquote><div><br></div>This is a problem for future user-visible feature deprecations: Python won't show you deprecation warnings any more unless you ask, so if a feature is deprecated in the user interface of something, we need a separate mechanism to alert the user of it. The idea with most features is that <i>trial</i> will always show you all deprecation warnings, so you'll notice while running your tests :).</div><div><br></div><div>Somebody needs to go through and look at currently deprecated command-line features to ensure that this won't happen in the future - any volunteers?.<br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000">
<blockquote>itamar@blake:~$ twistd --version<br>
twistd (the Twisted daemon) 11.0.0<br>
Copyright (c) 2001-2011 Twisted Matrix Laboratories.<br>
See LICENSE for details.<br>
<br>
itamar@blake:~$ twistd -n web --port=9000 --path=/<br>
2012-03-17 20:50:21-0400 [-] Log opened.<br>
2012-03-17 20:50:21-0400 [-] twistd 11.0.0 (/usr/bin/python 2.7.2)
starting up.<br>
2012-03-17 20:50:21-0400 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.<br>
2012-03-17 20:50:21-0400 [-] twisted.web.server.Site starting on
9000<br>
2012-03-17 20:50:21-0400 [-] Starting factory
<twisted.web.server.Site instance at 0x180bd40><br>
<br>
</blockquote>
2) The current --help just says " -p, --port= strports description
of the port to start the server on." It'll be completely unclear to
users what that means.<br></div></blockquote><div><br></div><div>There should be a new ticket: --help-strports or something, and every option that takes one should refer to it, similar to --help-auth-types for cred plugins.</div><br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000">
I am tempted to revert the ticket that removed this functionality -
can anyone tell me why we shouldn't?<br>
<br>
In particular, before the removal should be re-merged again, the
original syntax should be restored, along with decent --help. We
should always support just giving the port number and defaulting to
TCP. As it is, we've gone from a straightforward command line option
that also had some sophisticated features to something that will
break in a mysterious, hard to debug manner.<br>
</div></blockquote><br></div><div>I am inclined to agree, sort of. Currently, the plain integer will default to just IPv4. An un-decorated integer really <i>should</i> (eventually) default to listening on all available interfaces, IPv4 and IPv6 together.</div><div><br></div><div>Jean-Paul managed to convince me in the review for <a href="http://twistedmatrix.com/trac/ticket/4473">http://twistedmatrix.com/trac/ticket/4473</a> that supporting raw integers made the implementation ugly, but reflecting upon this experience I think I was wrong, and that clarity of the user experience here is more important than clarity of the implementation. I do still think that <i>examples</i> should move towards using 'tcp:80', though, so users might realize there's something other than 'tcp' that could go there.</div><div><br></div><div>I'm glad you noticed it: please go ahead and revert the removal.</div><div><br></div><div>-glyph</div><div><br></div></body></html>