Xyne's Forum

Ignore the dust.

You are not logged in.

#1 2014-02-17 06:18:20

jtgd
Member
Registered: 2014-02-17
Posts: 1

moz2fs

I hope this is the right place to ask but I am not able to get moz2fs to work.
It looks like something I need (for deduplication) but when I run it I get:

$ moz2fs bookmarks-2014-02-15_111602.json mozfs
Traceback (most recent call last):
  File "/usr/bin/moz2fs", line 411, in <module>
    main()
  File "/usr/bin/moz2fs", line 404, in main
    obj = load(pargs.fro)
  File "/usr/bin/moz2fs", line 60, in load
    return json.load(f)
  File "/usr/lib/python3.3/json/__init__.py", line 271, in load
    return loads(fp.read(),
  File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 16031: ordinal not in range(128)
$

Any clues?
It looks like it has a problem with 8-bit chars, but Firefox does store those...

Offline

#2 2014-02-23 13:08:09

Xyne
Member
Registered: 2013-01-05
Posts: 16

Re: moz2fs

Sorry for the late reply. As you can see, this forum is not very active so I don't sign in that often (and so it is not very active tongue).

The error arises in Python's JSON module itself, which means that there's either something wrong with the file (e.g. Firefox does not properly encode it) or there's a bug in Python's module. You can try passing the file through some sort of JSON cleaner (there must be something online) and then try passing it to the script again.

I would also determine exactly which bookmark is responsible by looking at the JSON file. Sometimes websites report incorrect encodings which Firefox blindly trusts and therefore ends up including invalid characters in some output.

Offline

Board footer

Powered by FluxBB