I had to upgrade my OS, as opensuse Leap 42.2 reached the end of its support cycle.

Before upgrading, I ran

cpan -a

to create the "autobundle" of all the installed modules.

After upgrading, though, I realized the autobundle includes all the non-core modules, i.e. also the ones installed by the system vendor (zypper install perl-*). So, I iterated over the list of modules, tried to run perl -M$module -e1 for each of them, and only installed those that failed.

On one of the machines, Dancer failed to install with the following test failures:

t/04_static_file/01_mime_types.t .................... 1/10 # Failed test 'a mime_type is found with MIME::Types' # at t/04_static_file/01_mime_types.t line 16. # got: 'application/vnd.easykaraoke.cdgdownload' # expected: 'application/zip' # Looks like you failed 1 test of 10. t/04_static_file/01_mime_types.t .................... Dubious, test re +turned 1 (wstat 256, 0x100) Failed 1/10 subtests t/04_static_file/02_dir_traversal.t ................. ok t/05_views/002_view_rendering.t ..................... ok t/05_views/03_layout.t .............................. ok t/06_helpers/000_create_fake_env.t .................. ok t/06_helpers/01_send_file.t ......................... 1/25 # Failed test 'mime_type can be forced' # at t/06_helpers/01_send_file.t line 83. # got: 'image/vnd.mozilla.apng' # expected: 'image/png' # Looks like you failed 1 test of 25. t/06_helpers/01_send_file.t ......................... Dubious, test re +turned 1 (wstat 256, 0x100) Failed 1/25 subtests t/06_helpers/02_http_status.t ....................... ok t/06_helpers/03_content_type.t ...................... 1/6 # Failed test 'headers include expected data for GET /png' # at t/06_helpers/03_content_type.t line 36. # Looks like you failed 1 test of 6.

And indeed,

perl -MMIME::Types -wE 'say MIME::Types->new->mimeTypeOf("zip")'

returns application/vnd.easykaraoke.cdgdownload on that machine, while on others, it returns the expected application/zip. Any idea why that happens and how to fix it?

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

In reply to Unexpected behaviour of MIME::Types by choroba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.