Non-free license of _jsmin.py taints WebHelpers

Kyle VanderBeek avatarKyle VanderBeek created an issue

I am the package owner for WebHelpers in Fedora. The license in _jsmin.py is not a recognized OSS-compatible license and has the problematically non-libre "Good, not Evil" clause. To keep WebHelpers distributable, a suitable OSS replacement needs to be found.

Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=608778

For the time being, we will probably be forced to remove/replace the file with a null-functioning API equivalent.

Comments (5)

  1. Mike Orr

    Thanks. As soon as I get my DSL installed in my new apartment, I'll get on this. I think you can remove the _jsmin.c module and it will fall back to the Python code. If you do this, please put a note in the Fedora webhelpers readme about what was changed and how to restore the original behavior. I'll write to the author and see if he's willing to relicense it. The jsmin code has always been convoluted so now may be a time to remove it from WebHelpers; I'll look into that. But please make sure WebHelpers >= 1.0 gets into Fedora because we're trying to phase out 0.6.4.

  2. Mike Orr

    Suggested code from the Fedora bug:

    webhelpers/pylonslib/_jsmin.py::
    
    raise ImportError('_jsmin has been removed due to having a non-free software
    license')
    
    and in webhelpers/pylonslib/minify.py::
    
    try:
        from _jsmin import JavascriptMinify
    except ImportError:
        class JavascriptMinify(object):
            def minify(self, instream, outstream):
                data = instream.read()
                outstream.write(data)
                instream.close()
    
    

    Fedora: "Maybe also have it print out a comment line that explains why the code hasn't actually been minified."

    A Python warning would be the proper way. There are already (or have been) DeprecationWarnings in WebHelpers. Although maybe a different warning class would be more appropriate for this situation.

  3. Mike Orr

    Actually, I think the person who suggested a "comment line" meant a Javascript comment in the output, not a message on stdout. Maybe. The problem is that this would be a message to the end user, not to the app developer. I may implement this as a warning plus a module constant to toggle the comment.

  4. Mike Orr

    Fixed in 103c5a6124b8 . The helper will use the external "jsmin" package if installed, otherwise it will pass through the Javascript unchanged and issue a warning. The _jsmin module has been replaced by a stub that raises ImportError and has a comment explaining the situation.

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.