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

error in line 58 in b64encode #50

Open
torturado opened this issue Jan 28, 2022 · 1 comment
Open

error in line 58 in b64encode #50

torturado opened this issue Jan 28, 2022 · 1 comment

Comments

@torturado
Copy link

Traceback (most recent call last):
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\main.py", line 5, in
from stitch_cmd import *
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\stitch_cmd.py", line 5, in
import stitch_winshell
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\stitch_winshell.py", line 5, in
import stitch_lib
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\stitch_lib.py", line 5, in
from stitch_help import *
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\stitch_help.py", line 5, in
from stitch_utils import st_print
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\stitch_utils.py", line 25, in
from Stitch_Vars.globals import *
File "C:\Users\myuser:D\Downloads\Stitch-master\Stitch-master\Application\Stitch_Vars\globals.py", line 77, in
key = base64.b64encode(key)
File "C:\Users\myuser:D\AppData\Local\Programs\Python\Python39\lib\base64.py", line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'str'

@rajp013
Copy link

rajp013 commented Dec 5, 2022

in the globals.py file in if part add .encode('utf-8')

like this:-

if not os.path.exists(st_aes):
key = ''.join(random.SystemRandom().choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for _ in
range(32)).encode('utf-8')
key = base64.b64encode(key)

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

2 participants