Code Monkey home page Code Monkey logo

Comments (5)

 avatar commented on July 30, 2024

Using <script type="text/coffeescript" src="{{ STATIC_URL }}tests.coffee" charset="utf-8"></script> (with STATIC_URL) causes an error too...

    Caught UncompressableFileError while rendering: 'tests.coffee' isn't accesible via COMPRESS_URL ('/static/') and can't be compressed

from django-compressor.

 avatar commented on July 30, 2024

I've located where the problem is occurring.

The else clause never executes to send the stdin to the process. In my coffeescript example configuration, (using stdin/stdout), the variables get set as so:

infile: None
self.filename: /snip/project/apps/tiny/static/tests.coffee

The command needs stdin, but doesn't get it, because of the or self.filename is not None check.

When it gets around to the YUI filter, both are none, so it sends the stdin that time and gets real output.
I fixed it by removing the self.filename check:

if infile is not None:

Here's the troubled line causing the issue.
https://github.com/jezdez/django_compressor/blob/master/compressor/filters/base.py#L68

Would love a quick fix. Thanks!

from django-compressor.

 avatar commented on July 30, 2024

Pull request to fix this opened:
#53

from django-compressor.

jezdez avatar jezdez commented on July 30, 2024

This needs tests.

from django-compressor.

 avatar commented on July 30, 2024

Alright. The problem with testing for infile not being None was that sometimes it stayed None.

Here, you see infile will still be None if the else executes (and it does in some cases). Which will render if infile is not None (on line 68) problematic.
https://github.com/jezdez/django_compressor/blob/master/compressor/filters/base.py#L60

And as for self.filename, I tested that out, and that check isn't even needed. For that reason, my fix wasn't complete, but I've completely fixed it and tested it out, and seeing where the execution is going on each test, so it's all correct now. :)

A test for this is coming.

Update: A test for this is now committed, as well as the correct fix.

from django-compressor.

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.