[DRE-maint] Bug#784591: feed2imap: include-images configuration option is broken

Gerald Turner gturner at unzane.com
Thu May 7 00:24:09 UTC 2015


Control: tags -1 + patch

Found the problem.

In itemtomail.rb there are a couple of commented-out print statements
for debugging:

  print "#{cid}: Replacing '#{$&}' with '#{newtag}'...\n"
  ...
  print "Error while fetching image #{$2}: #{$!}...\n"

With those uncommented, I get the following output when running
feed2imap:

  Error while fetching image http://gwolf.org/files/images/11194600_10206683440551815_3215489579656446032_o.preview.jpg: undefined method `fetch' for HTTPFetcher:Class...

Comparing with the source of httpfetcher.rb in feed2imap package version
1.0-2 (oldstable), I see that there was some refactoring, I'm not a Ruby
programmer, but looks like the 'fetch' method of class HTTPFetcher
changed from being a static method to an instance method.  Attached is a
patch which re-introduces the "static" method to keep itemtomail.rb
working for inline images again, as well as make one of the [presumably
unexecuted] unit tests, tc_httpfetcher.rb, happy.

With this fix in place I now get the debugging output:

  921d1c349d2fbecb6e20518342016f26 at hostname: Replacing '<img alt="Bestest birthday ever" class="image image-preview " height="640" src="http://gwolf.org/files/images/11194600_10206683440551815_3215489579656446032_o.preview.jpg" title="Bestest birthday ever" width="480" />' with '<img alt="Bestest birthday ever" class="image image-preview " height="640" src="cid:921d1c349d2fbecb6e20518342016f26 at hostname" title="Bestest birthday ever" width="480" />'...

Thanks!

-- 
Gerald Turner <gturner at unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redefine-old-HTTPFetcher-fetch-method-to-fix-inline-images.patch
Type: text/x-diff
Size: 806 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20150506/41b756bb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 948 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20150506/41b756bb/attachment.sig>


More information about the Pkg-ruby-extras-maintainers mailing list