|
@@ -144,8 +144,10 @@ class DirectoryReader():
|
|
|
f = open(full_path, 'rU');
|
|
|
text = f.read();
|
|
|
# getting along with the different string handling of python 2 and 3
|
|
|
- if sys.version_info[0] < 3:
|
|
|
+ try:
|
|
|
text = text.decode('utf-8')
|
|
|
+ except (UnicodeDecodeError, AttributeError):
|
|
|
+ pass
|
|
|
f.close()
|
|
|
checksum = binascii.crc32(text.encode('utf8')) & 0xffffffff # to match python 3
|
|
|
|