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: string argument without an encoding #86

Open
sebbad opened this issue Mar 20, 2019 · 4 comments
Open

ERROR: string argument without an encoding #86

sebbad opened this issue Mar 20, 2019 · 4 comments
Labels

Comments

@sebbad
Copy link

sebbad commented Mar 20, 2019

Running cc2538-bsl on Mac OS with python 3.7 provides the following errors:

"ERROR: string argument without an encoding"

This seems to be related to the handling of bytearrays in recent python versions. If I understand it correctly recent python version require the encoding to be explicitly stated in the bytearray function if the parameter is a string. This seems to be the case in the script. When providing an encoding (tried with 'utf8'), the error disappeared.

@JelmerT JelmerT added the bug label Mar 26, 2019
@JelmerT
Copy link
Owner

JelmerT commented Mar 26, 2019

Thanks for reporting this, interesting that this hasn't come up earlier.

Feel free to submit a PR adding the encoding.

@JelmerT
Copy link
Owner

JelmerT commented Jan 20, 2021

@sebbad could you describe the steps to reproduce this bug?

@felipefbs
Copy link

I had this same issue, and I run through the cc2538-bsl.py code and found that the error it's on the byte array casting. But I found that I was running an old version and using the new version I had no problems. Seems that everything its good now.

if have_magic:
            file_type = bytearray(magic.from_file(path, True))
## I just put the "utf-8" and worked for me
if have_magic:
            file_type = bytearray(magic.from_file(path, True), "utf-8")

@JelmerT
Copy link
Owner

JelmerT commented Apr 30, 2021

@sebbad can you confirm your issue is fixed with the latest version of the script?

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

No branches or pull requests

3 participants