ArneBachmann / tagsplorer

A quick and resource-efficient OS-independent tagging filetree extension tool and library
Mozilla Public License 2.0
3 stars 1 forks source link

Index file size differs between CPython and PyPy, although same number of found elements #56

Closed ArneBachmann closed 3 years ago

ArneBachmann commented 7 years ago

Problem occurs when reading PyPy-index with CPython3:

Traceback (most recent call last):
  File "tp.py", line 390, in <module>
    Main().parse()
  File "tp.py", line 382, in parse
    elif _.options.stats: _.stats()
  File "tp.py", line 311, in stats
    idx.load(indexFile)
  File "/home/ash/Desktop/svn/projects/tagsplorer/lib.py", line 341, in load
    c = pickle.loads(zlib.decompress(fd.read()) if _.compressed else fd.read())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)
ArneBachmann commented 7 years ago

U+00C3 | Ã | c3 83 | LATIN CAPITAL LETTER A WITH TILDE

ArneBachmann commented 3 years ago

Pypy: Indexed 2446 folders with 2446 tags 13:47:33.032 INFO lib::10 | Wrote 17 config bytes 13:47:33.032 INFO lib::10 | Wrote 25829 index bytes (2446 entries and 12826 paths)

CPython: Indexed 2446 folders with 2446 tags 13:48:09.673 INFO lib:store:106 | Wrote 17 config bytes 13:48:09.673 INFO lib:store:209 | Wrote 26589 index bytes (2446 entries and 12827 paths)

ArneBachmann commented 3 years ago

Yet both seem to be compatible and the pickle version is fixed in the code, so we can close this.