python / cpython

The Python programming language
https://www.python.org
Other
63.37k stars 30.35k forks source link

Support LMMS project files in mimetypes.guess_type #68667

Open 95367917-4af0-423a-aa93-b5d809d80cea opened 9 years ago

95367917-4af0-423a-aa93-b5d809d80cea commented 9 years ago
BPO 24479
Nosy @corona10
Files
  • seaman.mmp: Example decompressed LMMS project file
  • issue24479_support_mmp_and_mmpz_suffix_in_guess_type: added .mmp/.mmps type and tested it.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['type-feature', 'library'] title = 'Support LMMS project files in mimetypes.guess_type' updated_at = user = 'https://bugs.python.org/AndreasNilsson' ``` bugs.python.org fields: ```python activity = actor = 'vstinner' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'Andreas Nilsson' dependencies = [] files = ['39765', '39989'] hgrepos = [] issue_num = 24479 keywords = [] message_count = 5.0 messages = ['245556', '245617', '247168', '348632', '350462'] nosy_count = 3.0 nosy_names = ['Andreas Nilsson', 'Nan Wu', 'corona10'] pr_nums = [] priority = 'normal' resolution = None stage = 'needs patch' status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue24479' versions = ['Python 3.6'] ```

    95367917-4af0-423a-aa93-b5d809d80cea commented 9 years ago

    There is no support for recognizing LMMS project files (.mmpz / .mmp). Could this be added for strict=False?

    95367917-4af0-423a-aa93-b5d809d80cea commented 9 years ago

    Here is a decompressed example (use lmms -d \<file> to decompress). Shouldn't this be parsed as XML? Here's a log of my experiment with it:

    Python 2.7.9 (default, Apr  2 2015, 15:33:21) 
    [GCC 4.9.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import mimetypes
    >>> mimetypes.init()
    >>> mimetypes.guess_type("seaman.mmp")
    (None, None)
    >>> mimetypes.guess_type("seaman.mmp", False)
    (None, None)

    By default LMMS saves as .mmpz which is the compressed type, I do not know the encryption method they use though but I can ask them if you want so!

    3d3643ef-0805-40b0-8106-5600a91a57f5 commented 9 years ago

    Added a small patch. Pls let me know if anything missed.

    vstinner commented 5 years ago

    This issue is 4 years old and has patches: it is no newcomer friendly, I remove the "easy" keyword.

    corona10 commented 5 years ago

    @vstiner

    I'd like to work on this issue. My plan is adding mime-types as 'mmp' to 'application/x-lmms-project' and 'mmpz' to 'application/x-lmms-project' What do you think?