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

ZeroDivisionError for running pyminifier tool on multiple files, one of which being empty #37

Open
deeplook opened this issue Mar 17, 2015 · 1 comment

Comments

@deeplook
Copy link

I found the pyminifier command-line tool to have issues when run on multiples files while one of them is empty, which then raises a ZeroDivisionError, see below. Tested on pyminifier version 2.1 on OS X 10.10, Python 2.7.8 (same on Python 3.4.2):

$ pyminifier --version
2.1
$ touch __init__.py
$ pyminifier __init__.py
# Created by pyminifier (https://github.com/liftoff/pyminifier)

$ pyminifier __init__.py __init__.py
Traceback (most recent call last):
  File "/opt/bin/pyminifier", line 9, in <module>
    load_entry_point('pyminifier==2.1', 'console_scripts', 'pyminifier')()
  File "/opt/lib/python2.7/site-packages/pyminifier/pyminifier.py", line 383, in main
    (float(new_filesize) / float(filesize)) * 100, 2)
ZeroDivisionError: float division by zero
eric-bonfadini added a commit to eric-bonfadini/pyminifier that referenced this issue Apr 28, 2015
…on multiple files, one of which being empty
liftoff added a commit that referenced this issue Jun 25, 2015
Fixed issue #37 ZeroDivisionError for running pyminifier tool on multiple files, one of which being empty.
@sejans
Copy link

sejans commented Dec 28, 2015

add fix with #51

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