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

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

Open
Me-Mr opened this issue Apr 18, 2024 · 2 comments
Open

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

Me-Mr opened this issue Apr 18, 2024 · 2 comments

Comments

@Me-Mr
Copy link

Me-Mr commented Apr 18, 2024

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'

@nacierebiej
Copy link

I have the same issue.

@kazar4
Copy link

kazar4 commented Jun 18, 2024

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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants