#775291 numerical feed name causes exception

#775291#5
Date:
2015-01-13 16:09:06 UTC
From:
To:
Hi

while running feed2imap, I got following error:

I, [2015-01-13T09:40:35.167347 #30040]  INFO -- : 55: 14 new items, 0 updated items.
F, [2015-01-13T09:40:35.167766 #30040] FATAL -- : Exception caught while uploading mail to RSS: undefined method `gsub' for 55:Fixnum
/usr/lib/ruby/vendor_ruby/feed2imap/feed2imap.rb:247:in `block in initialize'
/usr/lib/ruby/vendor_ruby/feed2imap/feed2imap.rb:220:in `each'
/usr/lib/ruby/vendor_ruby/feed2imap/feed2imap.rb:220:in `initialize'
/usr/bin/feed2imap:48:in `new'
/usr/bin/feed2imap:48:in `<main>'
F, [2015-01-13T09:40:35.168778 #30040] FATAL -- : We can't recover from IMAP errors, so we are exiting.

when debugging, I've realized that this is caused by following entry:

- name: 067
  url: https://067.cz/rss/
  target: "..."

While parsing the configuration, feed2imap parses 067 as number and
converts it to 55, but it later probaly fails to find such named
section.

#775291#10
Date:
2015-01-13 19:21:59 UTC
From:
To:
You need to quote the name:

  - name: "067"
    url: https://067.cz/rss/
    target: "..."

The config file is parsed as YAML, and a 067 unquoted _will_ be parsed as a
number.

I can even change feed2imap to handle receiving numbers as the feed name by
converting them to strings, but I can't stop the YAML parser from doing the
octal to decimal conversion for example.

#775291#15
Date:
2015-01-14 06:43:25 UTC
From:
To:
Hi

Dne Tue, 13 Jan 2015 17:21:59 -0200
Antonio Terceiro <terceiro@debian.org> napsal(a):

Thanks, I've figured this out.

I understand that the conversion happens, but that should not break the
program from further processing the entry. It seems that it tries to
call string method (gsub) on integer or float it gets from the yaml
parser.

#775291#20
Date:
2015-01-14 11:29:01 UTC
From:
To:
Control: tag -1 pending upstream

Yes, sure. I pushed a fix for this to the upstream repository yesterday,
and this will be fixed in the next upload.