ntpq quirks

Eric S. Raymond esr at thyrsus.com
Thu Dec 1 21:45:22 UTC 2016


Hal Murray <hmurray at megapathdsl.net>:
> The current peers command is broken.  It's printing a big bunch of blanks 
> instead of the host name for each slot.  It way overflows an 80 character 
> line.

Well, that was a symphony of stupid.  On my part.

Here's what happened.  I fixed the kludgy way I had implemented termsize(),
which was spewing messages to your terminal.  I did it by adapting some code
to use TIOCGWINSZ from Python, which is what I should have done in the first
place.

Very nice - except that (a) I failed to notice that the TIOCGWINSZ
call returned (columns, rows) rather than (rows, columns), and (b) I
forgot to 'waf build' after changing pylib/util.py, so I ran the stale
version of pylib/util.py when testing, so I didn't see your breakage.

Maybe I need more sleep.  Stuff like this shouldn't be getting past me.

I've firewalled against similar problems ubn the future by modifying
termsize() to return a namedtuple, and referring to the members by
name rather than index.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list