Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AttributeError: 'dict' object has no attribute 'encode' #111

Open
chirul0 opened this issue Feb 20, 2024 · 3 comments
Open

[Bug]: AttributeError: 'dict' object has no attribute 'encode' #111

chirul0 opened this issue Feb 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@chirul0
Copy link

chirul0 commented Feb 20, 2024

enex2notion version

0.3.1

What OS are you using?

MacOS

OS Version / Linux distribution

14.2.1

Bug description

AttributeError: 'dict' object has no attribute 'encode' error when running enex2notion with done-file

Log excerpt

Traceback (most recent call last):
  File "/opt/homebrew/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_3/libexec/lib/python3.12/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_3/libexec/lib/python3.12/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_3/libexec/lib/python3.12/site-packages/enex2notion/cli.py", line 40, in _process_input
    enex_uploader.upload_notebook(enex_file)
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_3/libexec/lib/python3.12/site-packages/enex2notion/cli_upload.py", line 66, in upload_notebook
    self.upload_note(note, note_idx)
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_3/libexec/lib/python3.12/site-packages/enex2notion/cli_upload.py", line 69, in upload_note
    if note.note_hash in self.done_hashes:
       ^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_3/libexec/lib/python3.12/site-packages/enex2notion/enex_types.py", line 50, in note_hash
    s1_hash.update(h.encode("utf-8"))
                   ^^^^^^^^
AttributeError: 'dict' object has no attribute 'encode'
@chirul0 chirul0 added the bug Something isn't working label Feb 20, 2024
@chirul0
Copy link
Author

chirul0 commented Feb 22, 2024

Looks like there was a minor upgrade to enex2notion to 0.3.1_4. Ran it again and still hitting the error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_4/libexec/lib/python3.12/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_4/libexec/lib/python3.12/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_4/libexec/lib/python3.12/site-packages/enex2notion/cli.py", line 40, in _process_input
    enex_uploader.upload_notebook(enex_file)
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_4/libexec/lib/python3.12/site-packages/enex2notion/cli_upload.py", line 66, in upload_notebook
    self.upload_note(note, note_idx)
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_4/libexec/lib/python3.12/site-packages/enex2notion/cli_upload.py", line 69, in upload_note
    if note.note_hash in self.done_hashes:
       ^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.3.1_4/libexec/lib/python3.12/site-packages/enex2notion/enex_types.py", line 50, in note_hash
    s1_hash.update(h.encode("utf-8"))
                   ^^^^^^^^
AttributeError: 'dict' object has no attribute 'encode'

@chirul0
Copy link
Author

chirul0 commented Feb 22, 2024

Tried w/ python3.11. Same error:

Traceback (most recent call last):
  File "enex2notion-venv/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "enex2notion-venv/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "enex2notion-venv/lib/python3.11/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "enex2notion-venv/lib/python3.11/site-packages/enex2notion/cli.py", line 40, in _process_input
    enex_uploader.upload_notebook(enex_file)
  File "enex2notion-venv/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 66, in upload_notebook
    self.upload_note(note, note_idx)
  File "enex2notion-venv/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 69, in upload_note
    if note.note_hash in self.done_hashes:
       ^^^^^^^^^^^^^^
  File "enex2notion-venv/lib/python3.11/site-packages/enex2notion/enex_types.py", line 50, in note_hash
    s1_hash.update(h.encode("utf-8"))
                   ^^^^^^^^
AttributeError: 'dict' object has no attribute 'encode'

@chirul0
Copy link
Author

chirul0 commented Feb 22, 2024

Same w/ python3.10:

Traceback (most recent call last):
  File "enex2notion-venv/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "enex2notion-venv/lib/python3.10/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "enex2notion-venv/lib/python3.10/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "enex2notion-venv/lib/python3.10/site-packages/enex2notion/cli.py", line 40, in _process_input
    enex_uploader.upload_notebook(enex_file)
  File "enex2notion-venv/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 66, in upload_notebook
    self.upload_note(note, note_idx)
  File "enex2notion-venv/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 69, in upload_note
    if note.note_hash in self.done_hashes:
  File "enex2notion-venv/lib/python3.10/site-packages/enex2notion/enex_types.py", line 50, in note_hash
    s1_hash.update(h.encode("utf-8"))
AttributeError: 'dict' object has no attribute 'encode'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant