Test failures due to .es file name suffix for text/javascript file · Issue #75 · danny0838/PyWebScrapBook · GitHub
Skip to content

Test failures due to .es file name suffix for text/javascript file #75

Description

@maxnikulin

The following tests may fail:

  • tests.test_scrapbook_indexer.TestUnSingleHtmlConverter.test_rewrite_svg
  • tests.test_scrapbook_indexer.TestUnSingleHtmlConverter.test_rewrite_svg_file
-   <script href="313d6864fa48b411d082f7692efd0c0892788fc4.es"></script>
?                                                          ^
+   <script href="313d6864fa48b411d082f7692efd0c0892788fc4.js"></script>
?                                                          ^

Originally I mentioned it in #34 (comment)

I think the origin of the issue is

In [1]: import mimetypes

In [2]: mimetypes.guess_extension("text/javascript")
Out[2]: '.es'

due to

grep -w es /etc/mime.types 
text/javascript                                 es js mjs

It is specific to Debian Linux and its derivatives
https://salsa.debian.org/debian/media-types/-/commit/f67681aabbce05378e0ac45f92d398f8b7a31d5e
while RedHat-based distributions (Fedora, etc.) are not affected
https://pagure.io/mailcap/blob/master/f/mime.types#_1990

While I believe that it was oversight of the Debian media-types project to put es suffix before js, PyWebScrapBook should either explicitly set text/javascript to .js mapping or should allow .es in tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions