soachishti / moss.py

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

I get a broken pipe #42

Closed jakob1379 closed 3 years ago

jakob1379 commented 3 years ago

When I follow the example I get a broken pipe error which I do not know how to handle from the error messages. Any ideas?

>>> import mosspy
>>> from glob import glob
>>> 
>>> uid = '240793999'
>>> m = mosspy.Moss(uid, "python")
>>> 
>>> files = glob("Hand-in 5/submissions/*/*.py")
>>> basefile = glob("Hand-in 5/code/*.py")
>>> 
>>> [m.addBaseFile(bfile) for bfile in basefile]
>>> m.addFilesByWildcard("Hand-in 5/submissions/*/*.py")

>>> url = m.send(lambda file_path, display_name: print('*', end='', flush=True))
**********Traceback (most recent call last):
  File "submission_unzip.py", line 13, in <module>
    url = m.send(lambda file_path, display_name: print('*', end='', flush=True))
  File "/home/fuzie/.pyenv/versions/appcheck/lib/python3.8/site-packages/mosspy/moss.py", line 131, in send
    self.uploadFile(s, file_path, display_name, index, on_send)
  File "/home/fuzie/.pyenv/versions/appcheck/lib/python3.8/site-packages/mosspy/moss.py", line 104, in uploadFile
    s.send(message.encode())
BrokenPipeError: [Errno 32] Broken pipe

I have verified that both files and basefiles are added to the m.files and m.basefiles

soachishti commented 3 years ago

@jakob1379 Can you visit following issues, they might help. Also have you tried the sample case shared in moss_usage.py?

https://github.com/soachishti/moss.py/issues/34 https://github.com/soachishti/moss.py/issues/12

jakob1379 commented 3 years ago

You were right. I didn't know a unique userid resided inside the moss script. Thanks!