Skip to content
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

Licensing #41

Closed
drakkan opened this issue Oct 15, 2015 · 4 comments
Closed

Licensing #41

drakkan opened this issue Oct 15, 2015 · 4 comments

Comments

@drakkan
Copy link

drakkan commented Oct 15, 2015

sendfile depends on Unidecode that is GPL this means that sendfile and all other software that import it should be GPL too. Since unidecode is used only here:

https://github.com/johnsensible/django-sendfile/blob/master/sendfile/__init__.py#L80

would be possible to remove this dependency?

@drakkan
Copy link
Author

drakkan commented Oct 16, 2015

unidecode dependency seems required to support old browsers

312170c
http://kbyanc.blogspot.hk/2010/07/serving-file-downloads-with-non-ascii.html

maybe it could be done optional, for example:

  1. make an explicit setting to not set filename as ascii and so don't use unidecode
  2. use a try except and don't set filename as ascii if unidecode is not installed

what do you think about?

@johnsensible
Copy link
Owner

I guess it could be possible to remove the dependency. The Unidecode package does appear to do a pretty good job, but if we just want to do something basic then something like this might work well enough:

import unicodedata
unicodedata.normalize('NFKD', attachment_filename).encode('ascii','ignore')

from here:
http://stackoverflow.com/questions/2365411/python-convert-unicode-to-ascii-without-errors

Care to submit a patch/pull request for it?

@drakkan
Copy link
Author

drakkan commented Oct 16, 2015

created a pull request, thanks!

@johnsensible
Copy link
Owner

Merged it and made a new version (0.3.10), which is now also on PyPi.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants