Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

gnsync exception: unexpected args type #136

Open
rhyc opened this issue Feb 20, 2023 · 0 comments
Open

gnsync exception: unexpected args type #136

rhyc opened this issue Feb 20, 2023 · 0 comments

Comments

@rhyc
Copy link

rhyc commented Feb 20, 2023

environment:
geeknote 3.1
ubuntu 20.04
python v3.8.10
venv

I get the following exception after running gnsync --path /my/path --format plain --all --download-only

2023-02-20 08:54:02,661 : Unexpected args type: <class 'bytes'>. Expect list or dict
Traceback (most recent call last):
  File "/home/myhome/myenv/lib/python3.8/site-packages/geeknote/gnsync.py", line 53, in wrapper
    return func(*args, **kwargs)
  File "/home/myhome/myenv/lib/python3.8/site-packages/geeknote/gnsync.py", line 500, in _get_notes
    tools.strip(self.notebook_name.encode("utf-8"))
  File "/home/myhome/myenv/lib/python3.8/site-packages/geeknote/tools.py", line 55, in strip
    raise Exception("Unexpected args type: " "%s. Expect list or dict" % type(data))
Exception: Unexpected args type: <class 'bytes'>. Expect list or dict

self.notebook_name is encoded into utf-8 byte streams before feeding into tools.strip, but tools.strip expects str instead of bytes.

After I add the following in tools.strip, gnsync seems to work now.

    if isinstance(data, bytes):
        data = data.decode('utf-8')
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant