Sup-sync exception

View: New views
5 Messages — Rating Filter:   Alert me  

Sup-sync exception

by Mark Anderson-16 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I have an offlineimap synced IMAP Maildir area, and for some reason I get an error when I try to run sup-sync.

Any ideas?

-Mark

144> sup-sync
/home/manderso/src/sup-git/mainline/lib/sup/util.rb:9: warning: method redefined; discarding old gen_lock_id
/home/manderso/src/sup-git/mainline/lib/sup/util.rb:20: warning: method redefined; discarding old dump_lock_id
[Thu Nov 05 13:25:38 -0700 2009] WARNING: can't find character set by using locale, defaulting to utf-8
/home/manderso/src/sup-git/mainline/lib/sup/message-chunks.rb:36: warning: method redefined; discarding old make_tmpname
/home/manderso/src/sup-git/mainline/lib/sup/imap.rb:119: warning: ambiguous first argument; put parentheses or even spaces
[Thu Nov 05 13:25:39 -0700 2009] using index Redwood::FerretIndex
/home/manderso/src/sup-git/mainline/bin/sup-sync:11: warning: method redefined; discarding old to_s
[Thu Nov 05 13:25:40 -0700 2009] crypto: detected gpg binary in /usr/bin/gpg
[Thu Nov 05 13:25:40 -0700 2009] locking /home/manderso/.sup/lock...
[Thu Nov 05 13:25:40 -0700 2009] loading index...
[Thu Nov 05 13:25:40 -0700 2009] loaded index of 3830 messages
[Thu Nov 05 13:25:40 -0700 2009] scanning maildir /home/manderso/MailExchange/INBOX...
[Thu Nov 05 13:25:42 -0700 2009] done scanning maildir
Scanning maildir:/home/manderso/MailExchange/INBOX...
[Thu Nov 05 13:25:42 -0700 2009] unlocking /home/manderso/.sup/lock...
/home/manderso/src/sup-git/mainline/lib/sup/buffer.rb:15:in `cols': undefined local variable or method `stdscr' for Ncurses:Module (NameError)
        from /home/manderso/src/sup-git/mainline/lib/sup/message-chunks.rb:165:in `initialize'
        from /home/manderso/src/sup-git/mainline/lib/sup/message-chunks.rb:165:in `map'
        from /home/manderso/src/sup-git/mainline/lib/sup/message-chunks.rb:165:in `initialize'
        from /home/manderso/src/sup-git/mainline/lib/sup/message.rb:591:in `new'
        from /home/manderso/src/sup-git/mainline/lib/sup/message.rb:591:in `text_to_chunks'
        from /home/manderso/src/sup-git/mainline/lib/sup/message.rb:511:in `message_to_chunks'
        from /home/manderso/src/sup-git/mainline/lib/sup/message.rb:239:in `load_from_source!'
        from /home/manderso/src/sup-git/mainline/lib/sup/message.rb:335:in `build_from_source'
        from /home/manderso/src/sup-git/mainline/lib/sup/poll.rb:145:in `each_message_from'
        from /home/manderso/src/sup-git/mainline/lib/sup/maildir.rb:160:in `each'
        from /home/manderso/src/sup-git/mainline/lib/sup/maildir.rb:157:in `upto'
        from /home/manderso/src/sup-git/mainline/lib/sup/maildir.rb:157:in `each'
        from /home/manderso/src/sup-git/mainline/lib/sup/util.rb:560:in `send'
        from /home/manderso/src/sup-git/mainline/lib/sup/util.rb:560:in `__pass'
        from /home/manderso/src/sup-git/mainline/lib/sup/util.rb:547:in `method_missing'
        from /home/manderso/src/sup-git/mainline/lib/sup/poll.rb:139:in `each_message_from'
        from /home/manderso/src/sup-git/mainline/lib/sup/util.rb:520:in `send'
        from /home/manderso/src/sup-git/mainline/lib/sup/util.rb:520:in `method_missing'
        from /home/manderso/src/sup-git/mainline/bin/sup-sync:146
        from /home/manderso/src/sup-git/mainline/bin/sup-sync:141:in `each'
        from /home/manderso/src/sup-git/mainline/bin/sup-sync:141

_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk

Re: Sup-sync exception

by rick.tessner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Excerpts from Mark Anderson's message of Thu Nov 05 12:29:23 -0800 2009:
>
> I have an offlineimap synced IMAP Maildir area, and for some reason I get an error when I try to run
> sup-sync.

I had that exact same thing.  If you applied a patch that used
Ncurses.cols rather than WRAP_LEN to determine screen width, you'll have
that problem in the non-curses based sup applications.

The patch came from an email with the subject

    [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.

I initially didn't have any problems whatsoever with that patch until I ran
sup-sync. I fixed it with the attached commit.

This patch just does a rescue on that call.  The patch is only
applicable if you had applied a patch that came through previously on
this list for using Ncurses.cols rather than WRAP_LEN in
lib/sup/message-chunks.rb
--
Rick Tessner
rick.tessner@...


_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk

0001-Corrects-Use-terminal-width-instead-of-hardcoded-80-.patch (2K) Download Attachment

Re: Sup-sync exception

by Mark Anderson-16 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excerpts from rick.tessner's message of Fri Nov 06 08:13:19 -0700 2009:
> I had that exact same thing.  If you applied a patch that used
> Ncurses.cols rather than WRAP_LEN to determine screen width, you'll have
> that problem in the non-curses based sup applications.
>
> The patch came from an email with the subject
>
>     [PATCH] Use terminal width instead of hardcoded 80 as the wrap length.

I had applied that previous patch, as you guessed.

There was another patch that is complementary in getting the console to recognize the width of the terminal, I forget the tname, but here's what I have in my message-chunks.rb:

  TERM_WIDTH = `stty size 2>/dev/null`.split[1].to_i # to_i returns 0 if it fails
  WRAP_LEN = TERM_WIDTH > 0 && TERM_WIDTH || 80 # wrap messages and text attachments at this width

I don't know why that patch preferred `stty` to ENV["COLUMNS"], since that one had worked for me.

> I initially didn't have any problems whatsoever with that patch until I ran
> sup-sync. I fixed it with the attached commit.
>
> This patch just does a rescue on that call.  The patch is only
> applicable if you had applied a patch that came through previously on
> this list for using Ncurses.cols rather than WRAP_LEN in
> lib/sup/message-chunks.rb

Thanks, it is much happier now.

-Mark

_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk

Re: Sup-sync exception

by Anthony Martinez-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excerpts from Mark Anderson's message of Fri Nov 06 13:06:17 -0700 2009:
> There was another patch that is complementary in getting the console to
> recognize the width of the terminal, I forget the tname, but here's what I
> have in my message-chunks.rb:
>
>   TERM_WIDTH = `stty size 2>/dev/null`.split[1].to_i # to_i returns 0 if it fails
>   WRAP_LEN = TERM_WIDTH > 0 && TERM_WIDTH || 80 # wrap messages and text attachments at this width
>
> I don't know why that patch preferred `stty` to ENV["COLUMNS"], since that one
> had worked for me.

That'd be my patch. I used stty because ENV["COLUMNS"] doesn't consistently work
for me:

$ echo $COLUMNS
132
$ perl -wE 'say $ENV{COLUMNS}'
Use of uninitialized value in say at -e line 1.

$ ruby -e 'puts ENV["COLUMNS"]'
nil
$ irb
irb(main):001:0> ENV["COLUMNS"]
=> "132"

In Sup's console mode, ENV["COLUMNS"] is set, but when I tried
  WRAP_LEN = ENV["COLUMNS"]
in message-chunks.rb, it gets nil. It appears to have something to do with
readline:

$ irb --noreadline
irb(main):001:0> ENV["COLUMNS"]
=> nil

I also tried Ncurses.cols, as suggested on sup-devel, and got a similar
exception to yours. `stty`, albeit cheesy, works well enough for right now (even
though I'm not quite happy with it, since, in addition to its reliance on the
output of an external command, it also won't react to window size changes)

Perhaps this should be a configuration option -- give it a number to wrap to
that width, :auto to wrap to the terminal size (in some fashion that will allow
it to resize when the terminal does), and in the absence of any configuration,
80.

--
Every program has at least one bug and can be shortened by at least one
instruction -- from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.
_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk

Re: Sup-sync exception

by Mark Alexander-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excerpts from Anthony Martinez's message of Fri Nov 06 21:16:42 -0500 2009:
> That'd be my patch. I used stty because ENV["COLUMNS"] doesn't consistently work
> for me:
>
> $ echo $COLUMNS
> 132
> $ perl -wE 'say $ENV{COLUMNS}'
> Use of uninitialized value in say at -e line 1.

It sounds like you didn't do this:

export COLUMNS
_______________________________________________
sup-talk mailing list
sup-talk@...
http://rubyforge.org/mailman/listinfo/sup-talk