Code Monkey home page Code Monkey logo

Comments (4)

mscuthbert avatar mscuthbert commented on July 23, 2024

Sorry, but the external shell program and not working on Windows are show-stoppers to using this approach. If you want to make a separate repo that people can download which adds this functionality to music21 I'd be happy to point to that project.

from music21.

crantila avatar crantila commented on July 23, 2024

Sure, that makes sense. A half-solution and a new security hole really aren't very good. I'll try again!

from music21.

crantila avatar crantila commented on July 23, 2024

After some further research, we've decided not to bother with this in music21 itself. The following is an explanation of our decision, for people from The Future who may want to know.

We did find that the python-magic library allows both MIME type and encoding detection without using a shell command. It wraps (and therefore relies on the existence of) a C library for proper operation. We could ship the C library, the python-magic library, and a custom-made "magic file" that would allow fully accurate file-type guessing for all of music21's supported file types, in addition to greatly improved encoding detection. Although this really would solve the two problems, it also introduces significant complexity.

In addition, I believe I'm the only person who's ever desired more reliable file-type and encoding detection in music21, and I only want this because we (at ELVIS/SIMSSA) run music21 on a public Web server. In other words, considering the problems it would cause the music21 developers to maintain a feature that's really only for us, it's more reasonable at this time to improve our software than to push something to music21.

If something changes in the future, and the music21 developers would indeed like to incorporate improved file-type and encoding detection, I would be happy to contribute a patch. Thanks to Myke for allowing my exploration!

from music21.

mscuthbert avatar mscuthbert commented on July 23, 2024

Thanks for the update and explanation, Chris!

from music21.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.