-
Notifications
You must be signed in to change notification settings - Fork 981
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 while running slither #1540
Comments
Can you post the full error message trace? |
|
@elopez Do you have an idea what could cause this? |
maybe there's something non-utf8 in brownie's stderr? 🤔 I think Windows used some other encoding for the terminal output. @NoroMeb would you mind opening a terminal, navigating to your project folder with python3 -c "import subprocess, shutil; stdout, stderr = subprocess.Popen(['brownie', 'compile'], executable=shutil.which('brownie'), stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate(); open('stdout.bin', 'wb').write(stdout); open('stderr.bin', 'wb').write(stderr)" |
@elopez i tried but I have an error that github don't support binary files, what can i do ? |
I think you can create a zip file with them and upload that @NoroMeb |
Thanks @NoroMeb!
stdout is usual ASCII output:
But stderr has this message (encoded in a DOS codepage, like https://en.wikipedia.org/wiki/Code_page_850) :
Maybe we could sprinkle all the "debug" decode calls with ignore or backslashreplace: % python3
Python 3.10.9 (main, Dec 15 2022, 17:11:09) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = open('stderr.bin', 'rb').read()
>>> print(x.decode())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 11: invalid start byte
>>> print(x.decode(errors="ignore"))
Information: impossible de trouver des fichiers pour le(s) mod?le(s) spcifi(s).
>>> print(x.decode(errors="backslashreplace"))
Information\xff: impossible de trouver des fichiers pour le(s) mod?le(s) sp\x82cifi\x82(s). |
I think this makes sense as long as it doesn't cause errors to not surface
and cause weird behavior later in the program
…On Fri, Jan 6, 2023 at 7:44 AM Emilio López ***@***.***> wrote:
Thanks @NoroMeb <https://github.com/NoroMeb>!
@0xalpharush <https://github.com/0xalpharush>:
$ file *
stderr.bin: Non-ISO extended-ASCII text, with CRLF line terminators
stdout.bin: ASCII text, with CRLF line terminators
stdout is usual ASCII output:
Brownie v1.19.0 - Python development framework for Ethereum
Project has been compiled. Build artifacts saved at (...)
But stderr has this message (encoded in a DOS codepage, like
https://en.wikipedia.org/wiki/Code_page_850) :
Information : impossible de trouver des fichiers pour le(s) modèle(s) spécifié(s).
Maybe we could sprinkle all the "debug" decode calls with ignore or
backslashreplace
<https://johnlekberg.com/blog/2020-04-03-codec-errors.html>:
% python3
Python 3.10.9 (main, Dec 15 2022, 17:11:09) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = open('stderr.bin', 'rb').read()
>>> print(x.decode())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 11: invalid start byte
>>> print(x.decode(errors="ignore"))
Information: impossible de trouver des fichiers pour le(s) mod?le(s) spcifi(s).
>>> print(x.decode(errors="backslashreplace"))
Information\xff: impossible de trouver des fichiers pour le(s) mod?le(s) sp\x82cifi\x82(s).
—
Reply to this email directly, view it on GitHub
<#1540 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU2VY44YVQFXXCJT5BVADCDWRAOSBANCNFSM6AAAAAATOYPQQY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@0xalpharush @elopez what can i do to make it work for me ? |
Sometimes tools produce output not in UTF-8, and failing because the tool error could not be processed does not provide a good UX. This sprinkles backslashreplace on bytes.decode() for things that are meant to be logged or printed as part of an error or warning message. Fixes: crytic/slither#1540
I don't understand French much, but maybe the error message "Information : impossible de trouver des fichiers pour le(s) modèle(s) spécifié(s)." gives you a better idea of what the underlying problem is. I opened a PR with a fix to not fail completely if the error message has unexpected text encoding, this should also alleviate the problem: crytic/crytic-compile#351 If you want to try it out, you should be able to install the patched versions of Slither and crytic-compile as follows:
|
@elopez
|
The PR got merged earlier today and the branch got deleted, so you got that error. You should be ok with just installing dev now:
|
Does it act like main branche ? |
yep, |
Getting this error :
while running
slither .
on the root of my brownie project .have someone faced this error before and could handle it ?
ps : i have all dependencies installed successfully and brownie contracts compile with no probleme .
The text was updated successfully, but these errors were encountered: