[Twisted-Python] Twisted 1.0.4 - `mktap --help SERVER'

Francois Pinard pinard at iro.umontreal.ca
Wed Apr 23 17:06:24 MDT 2003


Hi, still me.

After having quickly glanced over the manual, I'm reading it a bit more
carefully now, and if comments like this message continue to pop up, you
will observe my progression, or non-progression if I cannot find enough
time :-), without my real will.  Sigh!  OK, let not me be too shy...

Page 21 (2.2.3 mktap and tapconvert) says: "For a given server, `mktap
--help <name>' shows the possible configuration options.".  The following
shell script:

---------------------------------------------------------------------->
#!/bin/bash
for s in coil conch dns ftp im inetd mail manhole news parent pinger ponger \
	 portforward procmon sibling socks telnet toc web words zoot; do
  echo $s =====================================
  mktap --help $s < /dev/null
done
----------------------------------------------------------------------<

seems to show that this is not completely true.

* For coil, dns, ftp, im, mail, pinger, ponger, portforward, socks, telnet,
  toc, web, words and zoot, I got no output at all, so I presume this
  may be interpreted as meaning that these servers use no option.  Yet,
  for all those, a `.tap' file was created, which is probably not what
  one expect from a mere `--help' option.  So maybe the `--help' did not
  work so well after all.

* I also got many DeprecationWarnings, which probably should not be there.
  Let's see:

  + conch yields:

---------------------------------------------------------------------->
WARNING: exceptions.DeprecationWarning::
    setApplication is deprecated, use setServiceCollection instead.
file: /usr/lib/python2.2/site-packages/twisted/scripts/mktap.py; line: 217
----------------------------------------------------------------------<

  + parent yields:

---------------------------------------------------------------------->
WARNING: exceptions.DeprecationWarning::
    You have to pass an authorizer separately from an application now.
file: /usr/lib/python2.2/site-packages/twisted/sibling/parentserv.py; line: 23

WARNING: exceptions.DeprecationWarning::
    Application.authorizer attribute is deprecated, use Service.authorizer instead
file: /usr/lib/python2.2/site-packages/twisted/cred/service.py; line: 84

WARNING: exceptions.DeprecationWarning::
    setApplication is deprecated, use setServiceCollection instead.
file: /usr/lib/python2.2/site-packages/twisted/python/reflect.py; line: 192

WARNING: exceptions.DeprecationWarning::
    Application.authorizer attribute is deprecated, use Service.authorizer instead
file: /usr/lib/python2.2/site-packages/twisted/spread/pb.py; line: 959
----------------------------------------------------------------------<

  + sibling yields:

---------------------------------------------------------------------->
WARNING: exceptions.DeprecationWarning::
    You have to pass an authorizer separately from an application now.
file: /usr/lib/python2.2/site-packages/twisted/sibling/siblingserv.py; line: 68

WARNING: exceptions.DeprecationWarning::
    Application.authorizer attribute is deprecated, use Service.authorizer instead
file: /usr/lib/python2.2/site-packages/twisted/cred/service.py; line: 84

WARNING: exceptions.DeprecationWarning::
    Application.authorizer attribute is deprecated, use Service.authorizer instead
file: /usr/lib/python2.2/site-packages/twisted/sibling/siblingserv.py; line: 80

WARNING: exceptions.DeprecationWarning::
    Application.authorizer attribute is deprecated, use Service.authorizer instead
file: /usr/lib/python2.2/site-packages/twisted/sibling/siblingserv.py; line: 82

WARNING: exceptions.DeprecationWarning::
    Application.authorizer attribute is deprecated, use Service.authorizer instead
file: /usr/lib/python2.2/site-packages/twisted/spread/pb.py; line: 959
----------------------------------------------------------------------<

  and for these three cases as well, a `.tap' file was created.  So maybe
  `--help' does not work as documented for these either.

* manhole did ask for supplementary information, like this:

---------------------------------------------------------------------->
Password: 
Confirm: 
----------------------------------------------------------------------<

  While sorting and cleaning out my various tries, I also found another
  case for `mktap --help manhole' which yielded the following:

---------------------------------------------------------------------->
An error unexpected occurred:
  File "/usr/lib/python2.2/site-packages/twisted/tap/manhole.py", line 45, in opt_password
    self['password'] = util.getPassword(confirm=1)
  File "/usr/lib/python2.2/site-packages/twisted/python/util.py", line 154, in getPassword
    if password[-1] == '\n':
IndexError: string index out of range
----------------------------------------------------------------------<

  yet I do not find back the exact recipe I use for producing this.
  Maybe the traceback will give hints about another problem?  In any case,
  a `.tap' file was created.

* For inetd, I got:

---------------------------------------------------------------------->
An error unexpected occurred:
  File "/usr/lib/python2.2/site-packages/twisted/runner/inetdconf.py", line 90, in parseLine
    self.parseFields(*line.split())
  File "/usr/lib/python2.2/site-packages/twisted/runner/inetdconf.py", line 174, in parseFields
    raise InvalidServicesConfError, 'Invalid port/protocol:' + \
InvalidServicesConfError: Invalid port/protocol:'3322-3325'
----------------------------------------------------------------------<

  At least, no `.tap' was created. :-)

* Both news and procmon provided the expected help output, and created no
  `.tap'.  However, the help was assorted with an error diagnostic,
  which is probably not appropriate for a mere help request.

  + news help output was prefixed with:

---------------------------------------------------------------------->
Usage Error: No newsgroups specified
----------------------------------------------------------------------<

  + procmon help output was suffixed with:

---------------------------------------------------------------------->
Wrong number of arguments.
----------------------------------------------------------------------<

  Even if the errors were expected, they should _ideally_ be presented
  both before, or both after; and both have the `Usage Error:' prefix,
  or both not have it.

All in all, I'm left with the impression that `--help' does not work,
or at least, not as documented in the book.

It might be worth, maybe, adding another unit test which makes sure that
`mktap --help <name>' produces for all servers, some output (on standard
output ideally, not standard error), or no output at all, but surely no
traceback, and with an exit status that would be consistently zero.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Twisted-Python mailing list