Windows 7,Python 3.7.9(64bit),I was trying install frida manually follow a blog,then I executed command “python setup.py installI” in frida-tools-1.1.0 directory.,the cmd showed below:Installing frida-script.py script to D:\Software\Python\Python37\DLLs\Scripts Traceback (most recent call last): File "setup.py", line 53, in <module> "frida-trace = frida_tools.tracer:main" File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\__init__.p y", line 144, in setup return distutils.core.setup(**attrs) File "D:\Software\Python\Python37\Lib\distutils\core.py", line 148, in setup dist.run_commands() File "D:\Software\Python\Python37\Lib\distutils\dist.py", line 966, in run_com mands self.run_command(cmd) File "D:\Software\Python\Python37\Lib\distutils\dist.py", line 985, in run_com mand cmd_obj.run() File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\in stall.py", line 67, in run self.do_egg_install() File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\in stall.py", line 117, in do_egg_install cmd.run(show_deprecation=False) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 424, in run self.easy_install(spec, not self.no_deps) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 673, in easy_install return self.install_item(None, spec, tmpdir, deps, True) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 720, in install_item self.process_distribution(spec, dist, deps) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 745, in process_distribution self.install_egg_scripts(dist) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 621, in install_egg_scripts self.install_wrapper_scripts(dist) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 814, in install_wrapper_scripts self.write_script(*args) File "D:\Software\Python\Python37\DLLs\lib\site-packages\setuptools\command\ea sy_install.py", line 858, in write_script f.write(contents) UnicodeEncodeError: 'gbk' codec can't encode character '\u0158' in position 2: i llegal multibyte sequence
It seems wrong with easy_install.py,below is the code
mask = current_umask()
ensure_directory(target)
if os.path.exists(target):
os.unlink(target)
with open(target, "w" + mode) as f:
f.write(contents)
chmod(target, 0o777 - mask)
line 858 is:f.write(contents)
two days age,I met this error first,and I modify line 857,it becomes with open(target,"w",encoding='utf-8') as f:' then I modify line 858,it becomes
f.write(str(contents))` with the help of GPT,then it worked,but I
don’t know whether it is the solution to solve it.Thanks.