kbandla / pydeep

Python bindings for ssdeep
Other
91 stars 33 forks source link

pathlib Object Fails on Python 3.7 #19

Closed utkonos closed 5 years ago

utkonos commented 5 years ago

Passing a pathlib object under python 3.7 fails with this exception:

>>> import pathlib
>>> a = pathlib.Path('/path/to/file')
>>> pydeep.hash_file(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument 1 must be str, not PosixPath

I looked at the code, but I'm not sure how to fix this.

kbandla commented 5 years ago

pydeep.hash_file(a.as_posix()) should work. hash_file expects a string object.

utkonos commented 5 years ago

Yes, this works.