soachishti / moss.py

Python client for Moss: A System for Detecting Software Similarity
MIT License
381 stars 75 forks source link

adding a file size check so we don't trigger the 0 file size bug #13

Closed jpetrucciani closed 5 years ago

jpetrucciani commented 5 years ago

Currently, there appears to be an issue with the library (or MOSS itself?) where if you add a file that exists but has no contents, the moss.send() call appears to hang for a bit, then returns an empty string. Maybe the socket.send() in the uploadFile method call doesn't like sending 0 bytes?

I've just set it to ignore empty files in my program using this library, but I figured it may be useful to fix upstream!

soachishti commented 5 years ago

Hi, Thanks for the fix. Can you please commit the code without reformatting because it have hid the actual change. :)

jpetrucciani commented 5 years ago

Yep, I can change it! I've got black running by default so it formatted automatically.

jpetrucciani commented 5 years ago

I've updated this fork to just include the fixes!

soachishti commented 5 years ago

Looks good. Changes are now merged.