Docker版本运行报错SyntaxError: (unicode error)
Z5bra opened this issue · comments
bm commented
是否使用了最新代码
是
Bug描述
#运行命令:
docker run -it --rm -v /root/oneforall-docker/results:/OneForAll/results -v /root/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target *打码*.com run
#报错结果
Traceback (most recent call last):
File "oneforall.py", line 15, in <module>
import export
File "/OneForAll/export.py", line 13, in <module>
from common import utils
File "/OneForAll/common/utils.py", line 21, in <module>
from common.database import Database
File "/OneForAll/common/database.py", line 8, in <module>
from config.log import logger
File "/OneForAll/config/log.py", line 27
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte
运行环境
- 系统:CentOS Linux release 7.9.2009(必写)
Jing Ling commented
暂时不支持输入中文域名
bm commented
@shmilylty 不是,我那里是手动打个码XD,是正常的域名
奶茶说 commented
这个看起来是因为log.py文件里面的特殊字符导致的,如果修改过的话可以检查一下是不是添加了奇怪的字符;或者这个文件是不是用sftp/scp发到windows里面,编辑完没有使用utf-8保存就传回来了。如果没有修改过的话,给我几天时间装一下CentOS看看能不能复现。
bm commented
@Tardis07 @shmilylty 我直接下载config文件后运行,出现了新的报错
[root@root ~]# docker run -it --rm -v ~/oneforall-docker/results:/OneForAll/results -v ~/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target example.com run
Traceback (most recent call last):
File "oneforall.py", line 15, in <module>
import export
File "/OneForAll/export.py", line 13, in <module>
from common import utils
File "/OneForAll/common/utils.py", line 21, in <module>
from common.database import Database
File "/OneForAll/common/database.py", line 9, in <module>
from config import settings
ImportError: cannot import name 'settings' from 'config' (unknown location)
目录结构如下:
[root@root oneforall-docker]# tree ./
./
├── config
│ ├── api.py
│ ├── log.py
│ ├── __pycache__
│ │ ├── log.cpython-38.pyc
│ │ └── settings.cpython-38.pyc
│ └── setting.py
├── manual
└── results
└── oneforall.log
Jing Ling commented
是否使用了最新代码 是
Bug描述
#运行命令: docker run -it --rm -v /root/oneforall-docker/results:/OneForAll/results -v /root/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target *打码*.com run #报错结果 Traceback (most recent call last): File "oneforall.py", line 15, in <module> import export File "/OneForAll/export.py", line 13, in <module> from common import utils File "/OneForAll/common/utils.py", line 21, in <module> from common.database import Database File "/OneForAll/common/database.py", line 8, in <module> from config.log import logger File "/OneForAll/config/log.py", line 27 SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte
运行环境
- 系统:CentOS Linux release 7.9.2009(必写)
已经删除这些特殊字符 5278c2f
可以再测试一下是否还有问题
bm commented
@shmilylty 我删除了镜像和config文件,重新下载最新的config文件,拉取镜像后,依然报上述新的错误
@Tardis07 @shmilylty 我直接下载config文件后运行,出现了新的报错
[root@root ~]# docker run -it --rm -v ~/oneforall-docker/results:/OneForAll/results -v ~/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target example.com run Traceback (most recent call last): File "oneforall.py", line 15, in <module> import export File "/OneForAll/export.py", line 13, in <module> from common import utils File "/OneForAll/common/utils.py", line 21, in <module> from common.database import Database File "/OneForAll/common/database.py", line 9, in <module> from config import settings ImportError: cannot import name 'settings' from 'config' (unknown location)目录结构如下:
[root@root oneforall-docker]# tree ./ ./ ├── config │ ├── api.py │ ├── log.py │ ├── __pycache__ │ │ ├── log.cpython-38.pyc │ │ └── settings.cpython-38.pyc │ └── setting.py ├── manual └── results └── oneforall.log
bm commented
报错如下:
[root@root ~]# docker run -it --rm -v ~/oneforall-docker/results:/OneForAll/results -v ~/oneforall-docker/config:/OneForAll/config shmilylty/oneforall --target baidu.com run
Traceback (most recent call last):
File "oneforall.py", line 15, in <module>
import export
File "/OneForAll/export.py", line 13, in <module>
from common import utils
File "/OneForAll/common/utils.py", line 21, in <module>
from common.database import Database
File "/OneForAll/common/database.py", line 9, in <module>
from config import settings
ImportError: cannot import name 'settings' from 'config' (unknown location)
目录结构如下:
[root@root oneforall-docker]# tree ./
./
├── config
│ ├── api.py
│ ├── log.py
│ ├── __pycache__
│ │ └── log.cpython-38.pyc
│ └── setting.py
└── results
└── oneforall.log
3 directories, 5 files
奶茶说 commented
超过一个月没有回复,并且没有其他人复现该问题,默认问题已解决并关闭