CanvasSync icon indicating copy to clipboard operation
CanvasSync copied to clipboard

TypeError: a bytes-like object is required, not 'str'

Open Me-Mr opened this issue 10 months ago • 2 comments

Hi, after entering encryption password it runs for a few seconds and I get this error:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/bin/canvas", line 8, in <module> sys.exit(entry()) ^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/bin/canvas.py", line 186, in entry run_canvas_sync() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/bin/canvas.py", line 132, in run_canvas_sync main_menu(settings) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/bin/canvas.py", line 146, in main_menu settings.set_settings() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/CanvasSync/settings/settings.py", line 157, in set_settings self.write_settings() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/CanvasSync/settings/settings.py", line 214, in write_settings out_file.write(encrypt(settings)) ^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/CanvasSync/settings/cryptography.py", line 48, in encrypt pass_file.write(hashed_password) TypeError: a bytes-like object is required, not 'str'

Me-Mr avatar Apr 18 '24 02:04 Me-Mr

I have the same issue.

nacierebiej avatar Apr 19 '24 22:04 nacierebiej

I figured it out: If you are on Mac go to this directory: /Users/[Username]/Library/Python/3.9/lib/python/site-packages/CanvasSync/settings/cryptography.py On Line 48 you will see pass_file.write(hashed_password) Change that to pass_file.write(str.encode(hashed_password))

kazar4 avatar Jun 18 '24 17:06 kazar4