Subject: [sup-talk] fatal exception: invalid contacts.txt

From: [email-masked] (Alan De Smet)
Date: Thu, 14 Feb 2008 15:22:01 -0600

I'm trying to import a bunch of contacts into sup by directly
modifying the .sup/contacts.txt file.  Apparently blank lines and
comments are not welcome.  If the goals of contacts.txt include
that humans are able to edit it, blank lines and comments are
helpful and it would be nice if they were allowed.  If that's
madness, and only software should edit the file, I'd expect an
error message and more graceful exit.

This is sup v0.4, installed this morning via gem.  It (and
rubygems) is installed as a user, not root, on a Red Hat
Enterprise Linux 5 machine.

contents of contacts.txt:
> alice: Alice <alice at example.com>
> 
> bob: Bob <bob at example.com>

Output:
> [Thu Feb 14 15:17:25 -0600 2008] using character set encoding "UTF-8"
> [Thu Feb 14 15:17:25 -0600 2008] optional 'chronic' library not found (run 'gem install chronic' to install)
> [Thu Feb 14 15:17:25 -0600 2008] locking /u/a/d/adesmet/.sup/lock...
> [Thu Feb 14 15:17:25 -0600 2008] stopped cursing
> [Thu Feb 14 15:17:25 -0600 2008] oh crap, an exception
> [Thu Feb 14 15:17:25 -0600 2008] unlocking /u/a/d/adesmet/.sup/lock...
> ----------------------------------------------------------------
> I'm very sorry. It seems that an error occurred in Sup. Please
> accept my sincere apologies. If you don't mind, please send the
> contents of sup-exception-log.txt and a brief report of the
> circumstances to sup-talk at rubyforge dot orgs so that I might
> address this problem. Thank you!
> 
> Sincerely,
> William
> ----------------------------------------------------------------
> --- RuntimeError from thread: main
> can't parse /u/a/d/adesmet/.sup/contacts.txt line "\n"
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup/contact.rb:18:in `initialize'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup/contact.rb:17:in `foreach'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup/contact.rb:17:in `initialize'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup.rb:96:in `new'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup.rb:96:in `start'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/bin/sup:113
> opt/ruby_gem_home/bin/sup:19:in `load'
> opt/ruby_gem_home/bin/sup:19

contents of sup-exception-log.txt:
> --- RuntimeError from thread: main
> can't parse /u/a/d/adesmet/.sup/contacts.txt line "\n"
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup/contact.rb:18:in `initialize'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup/contact.rb:17:in `foreach'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup/contact.rb:17:in `initialize'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup.rb:96:in `new'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/lib/sup.rb:96:in `start'
> /afs/cs.wisc.edu/u/a/d/adesmet/bin/opt/ruby_gem_home/gems/sup-0.4/bin/sup:113
> opt/ruby_gem_home/bin/sup:19:in `load'
> opt/ruby_gem_home/bin/sup:19

You get very similar output with a contacts.txt file of:
> alice: Alice <alice at example.com>
> # Bob's a nice guy
> bob: Bob <bob at example.com>

-- 
Alan De Smet              http://www.highprogrammer.com/alan

---

From: [email-masked] (William Morgan)
Date: Sat, 16 Feb 2008 05:15:49 -0800

Reformatted excerpts from Alan De Smet's message of 2008-02-14:
> If the goals of contacts.txt include that humans are able to edit it,
> blank lines and comments are helpful and it would be nice if they were
> allowed.

I agree completely. I'll work on a better parser for this. Patches
welcome, of course!

-- 
William <wmorgan-sup at masanjin.net>