Closed oguh43 closed 2 years ago
The line you link does not have diacritics (you link to master, probably another line now.) Did you try to provide the correct encoding via the command line option of pipreqs?
Some useful commands:
In my case, the error was SyntaxError: invalid non-printable character U+FEFF
, which hint to a (unnecessary) BOM character for UTF-8. Instead of providing UTF-8-SIG as encoding, I changes the file(s) to remove the BOM.
# Detect char encoding
> chardetect myfile.py
myfile.py: UTF-8-SIG with confidence 1.0
# Remove BOM of one file
> sed -i '1s/^\xEF\xBB\xBF//' myfile.py
# Or of all python files (this might require zsh?, but you can find ways around using find, xarg, ...
> sed -s -i '1s/^\xEF\xBB\xBF//' **/*.py
# check encoding again'
> chardetect myfile.py
myfile.py: utf-8 with confidence 0.99
`
Code can not contain characters with diacritics (á,é,ô,ň), else pipreqs breaks.