Skip to content

Support LMMS project files in mimetypes.guess_type #68667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AndreasNilsson mannequin opened this issue Jun 20, 2015 · 8 comments
Open

Support LMMS project files in mimetypes.guess_type #68667

AndreasNilsson mannequin opened this issue Jun 20, 2015 · 8 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@AndreasNilsson
Copy link
Mannequin

AndreasNilsson mannequin commented Jun 20, 2015

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:

    assignee = None
    closed_at = None
    created_at = <Date 2015-06-20.10:18:22.508>
    labels = ['type-feature', 'library']
    title = 'Support LMMS project files in mimetypes.guess_type'
    updated_at = <Date 2019-08-26.21:32:02.659>
    user = 'https://bugs.python.org/AndreasNilsson'

    bugs.python.org fields:

    activity = <Date 2019-08-26.21:32:02.659>
    actor = 'vstinner'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2015-06-20.10:18:22.508>
    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']

    @AndreasNilsson
    Copy link
    Mannequin Author

    AndreasNilsson mannequin commented Jun 20, 2015

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

    @AndreasNilsson AndreasNilsson mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jun 20, 2015
    @ned-deily ned-deily added the easy label Jun 20, 2015
    @AndreasNilsson
    Copy link
    Mannequin Author

    AndreasNilsson mannequin commented Jun 22, 2015

    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!

    @NanWu
    Copy link
    Mannequin

    NanWu mannequin commented Jul 23, 2015

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

    @vstinner
    Copy link
    Member

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

    @corona10
    Copy link
    Member

    corona10 commented Aug 25, 2019

    @vstinner

    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?

    @vstinner vstinner removed the easy label Aug 26, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @hugovk
    Copy link
    Member

    hugovk commented Apr 20, 2025

    mimetypes.py says:

        # Before adding new types, make sure they are either registered with IANA,
        # at https://www.iana.org/assignments/media-types/media-types.xhtml
        # or extensions, i.e. using the x- prefix

    And I don't see any LMMS / mmp / mmpz / application/x-lmms-project at https://www.iana.org/assignments/media-types/media-types.xhtml.

    There is a smaller list of non-standard types:

        # These are non-standard types, commonly found in the wild.  They will
        # only match if strict=0 flag is given to the API methods.

    I guess we could add it there?

    @corona10 Are you still interested in this?

    @corona10
    Copy link
    Member

    @hugovk
    I think that we could add this media type if it is frequently handled.
    (I have become pretty conservative in my views when compared to 2019; it is a very interesting change.)
    If you want to finalize this issue, you can go ahead :)

    @hugovk
    Copy link
    Member

    hugovk commented Apr 20, 2025

    Thanks, is there some sort of documentation or prior use for application/x-lmms-project?

    The 2015 patch suggested application/octet-stream but would be better to use something more specific.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants