Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
cloudooo cloudooo
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • cloudooocloudooo
  • Merge requests
  • !28

Merged
Created Mar 29, 2021 by Jérome Perrin@jeromeOwner

manager/getAllowedExtensionList: use explicit extensions in ERP5 legacy mode

  • Overview 6
  • Commits 1
  • Pipelines 2
  • Changes 2

In python2, mimetypes module was not deterministic and this snippet:

import mimetypes; print(mimetypes.guess_extension("text/html"))

use to be ".html" on python 2.7.14, but is ".htm" on python 2.7.18

Similarly:

import mimetypes; print(mimetypes.guess_extension("application/msword"))

was ".doc" on 2.7.14 and ".dot" on 2.7.18 (this was in my observations, this does not look deterministic as it is iterating on a dict, maybe this behaviour is not always same)

For html conversion engine, ERP5 expect that the extension for text/html is .html, not .htm. Some tests also expect that the conversion for word is .doc so to keep compatibility with extensions used in ERP5 compatibility mode, define explicitly these two extensions instead of depending on python standard library.

Edited Mar 29, 2021 by Jérome Perrin
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/compat-erp5-html-extension
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7