hgjazhgj / FGO-py

自动爬塔! 自动每周任务! 全自动免配置跨平台的Fate/Grand Order助手.启动脚本,上床睡觉,养肝护发,满加成圣诞了解一下?
http://fgo-py.hgjazhgj.top/
GNU Affero General Public License v3.0
1.53k stars 179 forks source link

windows下新安装FGO-py with alas报错 #142

Open JOYACEpoor opened 2 months ago

JOYACEpoor commented 2 months ago

在提问之前...

描述你的问题

cli启动失败

如何复现

  1. 在使用之前updater.py会报文件编码错误,需要在open('fgoConst.py')中指定文件编码open('fgoConst.py',encoding='utf-8')
  2. 修改后进度条会卡住,无法继续
  3. 再次修改launch.bat中的启动命令python -X utf-8 fgo.py cli --no-colorpython -X gbk fgo.py cli --no-color后进度条会跑两次,且进度条不在乱码,但报错
  4. 出现问题

预期行为

No response

相关日志

## Log1

INFO     21:35:10.131 │ : HEAD is now at 6fb7f2c v19.4.0                                                                 
ERROR    21:35:10.133 │ Traceback (most recent call last):                                                               
ERROR    21:35:10.135 │   File "C:\Users\MermaidGirl\Desktop\FGO-py.portable\deploy\updater.py", line 9, in <module>     
ERROR    21:35:10.136 │     with open('fgoConst.py')as f:installed_version=tuple(int(i)for i in                          
         f.readline()[10:-2].split('.'))                                                                                 
ERROR    21:35:10.138 │                                                                         ^^^^^^^^^^^^             
ERROR    21:35:10.139 │ UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 295: illegal multibyte        
         sequence                                                                                                        
INFO     21:35:10.155 │ : Update failed. See above. 

## Log2

INFO     21:41:20.076 │ : HEAD is now at 6fb7f2c v19.4.0                                                                 
INFO     21:41:20.823 │ FGO-py v19.4.0 PID 3216                                                                          
WARNING  21:41:20.824 │ Using Adb in PATH:                                                                               
         C:\Users\MermaidGirl\Desktop\AzurLaneAutoScript\toolkit\Lib\site-packages\adbutils\binaries\adb.EXE             
INFO     21:41:20.847 │ :                                                                                                
INFO     21:41:20.947 │ :   0%|          | 0/406 [00:00<?, ?it/s]                                                        
INFO     21:41:21.048 │ :  17%|█▋        | 68/406 [00:00<00:00, 679.80it/s]                                              
INFO     21:41:21.148 │ :  34%|███▎      | 137/406 [00:00<00:00, 681.80it/s]                                             
INFO     21:41:21.248 │ :  52%|█████▏    | 211/406 [00:00<00:00, 708.29it/s]                                             
INFO     21:41:21.349 │ :  69%|██████▉   | 282/406 [00:00<00:00, 708.95it/s]                                             
INFO     21:41:21.424 │ :  87%|████████▋ | 353/406 [00:00<00:00, 706.79it/s]                                             
INFO     21:41:21.703 │ :                                                                                                
INFO     21:41:21.705 │ :                                                                                                
INFO     21:41:22.092 │ :   0%|          | 0/4 [00:00<?, ?it/s]                                                          
INFO     21:41:22.469 │ :  25%|██▌       | 1/4 [00:00<00:01,  2.57it/s]                                                  
INFO     21:41:22.843 │ :  50%|█████     | 2/4 [00:00<00:00,  2.62it/s]                                                  
INFO     21:41:23.227 │ :  75%|███████▌  | 3/4 [00:01<00:00,  2.64it/s]                                                  
INFO     21:41:23.229 │ : 100%|██████████| 4/4 [00:01<00:00,  2.63it/s]                                                  
INFO     21:41:23.261 │ :                                                                                                
ERROR    21:41:23.263 │ Traceback (most recent call last):                                                               
ERROR    21:41:23.264 │   File "C:\Users\MermaidGirl\Desktop\FGO-py.portable\FGO-py\FGO-py\fgo.py", line 17, in <module> 
ERROR    21:41:23.266 │     case'cli':from fgoCli import main                                                            
ERROR    21:41:23.267 │               ^^^^^^^^^^^^^^^^^^^^^^^                                                            
ERROR    21:41:23.268 │   File "C:\Users\MermaidGirl\Desktop\FGO-py.portable\FGO-py\FGO-py\fgoCli.py", line 309, in      
         <module>                                                                                                        
ERROR    21:41:23.270 │                                                                                                  
         parser_teamup_set_index.add_argument('value',help='on/off',type=str.lower,choices=['on','off'])                 
ERROR    21:41:23.273 │     ^^^^^^^^^^^^^^^^^^^^^^^                                                                      
ERROR    21:41:23.274 │ NameError: name 'parser_teamup_set_index' is not defined. Did you mean: 'parser_teamup_set_'?

截图

QQ_1727012112581 QQ_1727012399010 QQ_1727012711209

其他

操作系统: Windows10 LTSB2016 in Proxmox VE FGO-py 版本: v19.4.0 CPU 型号: Intel CC150

来点色图

c3a29c27ba542715ccb35f7a5bc9da80

JOYACEpoor commented 2 months ago

启动路径C:\Users\MermaidGirl\Desktop\FGO-py.portable\FGO-py\deploy\AzurLaneAutoScript btw gui是可以使用且正常的,下图为todesk远程到windows使用完成战斗功能和启动路径内容等 QQ_1727015987849

hgjazhgj commented 2 months ago

在使用之前updater.py会报文件编码错误,需要在open('fgoConst.py')中指定文件编码open('fgoConst.py',encoding='utf-8')

当前版本示例的portable.launch.bat有误,会更正

修改后进度条会卡住,无法继续

我需要进一步检查alas中的相关实现,此问题由本人负责 目测是alas未能正确解码FGO-py的输出 我可能会在近期先在FGO-py侧进行让他不卡住能运行但是中文乱码的workaround修复(按理说就算乱码也应该是能够继续运行的

再次修改launch.bat中的启动命令python -X utf-8 fgo.py cli --no-color为python -X gbk fgo.py cli --no-color后进度条会跑两次,且进度条不在乱码,但报错

错误的修改方法,这会使得FGO-py不工作


这个-X utf8是python的utf8模式,意图是一站式地解决本软件所有的潜在的编码问题,并实现向python3.15的平滑过渡

JOYACEpoor commented 2 months ago

收到了,感谢回复

hgjazhgj commented 2 months ago

(按理说就算乱码也应该是能够继续运行的

对于你提供的log2中最终的报错,已在8月25日v19.4.1中修复,但是一直没有推送到终端用户 请在明天上午再次尝试更新,或是手动从GitHub拉取 亦即是说,目前alasfpybridge是能够正常运行的,只不过非ascii部分有乱码

JOYACEpoor commented 2 months ago

hi,情况更新了。我删除原文件夹后重新解压了一次portable并运行了一次fgopy 成功更新到了v19.4.1,但我注意到updater.py处仍然报文件编码错误

INFO     14:31:04.188 │ : HEAD is now at 648f43a v19.4.1 fix #136 #139                                                       
ERROR    14:31:04.191 │ Traceback (most recent call last):                                                                   
ERROR    14:31:04.192 │   File "C:\Users\MermaidGirl\Desktop\FGO-py.portable\deploy\updater.py", line 9, in <module>         
ERROR    14:31:04.194 │     with open('fgoConst.py')as f:installed_version=tuple(int(i)for i in                              
         f.readline()[10:-2].split('.'))                                                                                     
ERROR    14:31:04.195 │                                                                         ^^^^^^^^^^^^                 
ERROR    14:31:04.197 │ UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 295: illegal multibyte sequence   
INFO     14:31:04.219 │ : Update failed. See above.                                                                          

QQ_1727073393302

指定文件编码后继续运行,但如上文中仍然乱码,并无法继续运行 QQ_1727073509674

最后,当我修改launch.bat的启动命令中的utf8为不指定则可以启动(根据上文中标记为错误的修改方法,但实际上也可以成功运行,only -X utf8失败) QQ_1727073662932

w211691 commented 2 weeks ago

hi,情况更新了。我删除原文件夹后重新解压了一次portable并运行了一次fgopy 成功更新到了v19.4.1,但我注意到updater.py处仍然报文件编码错误

INFO     14:31:04.188 │ : HEAD is now at 648f43a v19.4.1 fix #136 #139                                                       
ERROR    14:31:04.191 │ Traceback (most recent call last):                                                                   
ERROR    14:31:04.192 │   File "C:\Users\MermaidGirl\Desktop\FGO-py.portable\deploy\updater.py", line 9, in <module>         
ERROR    14:31:04.194 │     with open('fgoConst.py')as f:installed_version=tuple(int(i)for i in                              
         f.readline()[10:-2].split('.'))                                                                                     
ERROR    14:31:04.195 │                                                                         ^^^^^^^^^^^^                 
ERROR    14:31:04.197 │ UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 295: illegal multibyte sequence   
INFO     14:31:04.219 │ : Update failed. See above.                                                                          

QQ_1727073393302

指定文件编码后继续运行,但如上文中仍然乱码,并无法继续运行 QQ_1727073509674

最后,当我修改launch.bat的启动命令中的utf8为不指定则可以启动(根据上文中标记为错误的修改方法,但实际上也可以成功运行,only -X utf8失败) QQ_1727073662932

碰到了一样的问题,最新版本: ═════════════════════════════════════════════════════════════════════════════════════════════ START
═════════════════════════════════════════════════════════════════════════════════════════════ INFO 17:18:33.101 │ [Server] cn
INFO 17:18:33.112 │ Bind task ['General', 'Alas', 'Fpy']
INFO 17:18:33.115 │ Save config ./config\FGOFGO.fpy.json,
Commission.Scheduler.Enable=True, Research.Scheduler.Enable=True,
Reward.Scheduler.Enable=True
INFO 17:18:33.135 │ Bind task ['General', 'Alas', 'Fpy']
INFO 17:18:33.137 │ Bind task ['General', 'Alas', 'FpyBenchmark', 'Fpy']
════════════════════════════════════ SHOW DEPLOY CONFIG ═════════════════════════════════════ INFO 17:18:33.155 │ SHOW DEPLOY CONFIG
INFO 17:18:33.157 │ Repository: git://git.lyoko.io/AzurLaneAutoScript
INFO 17:18:33.159 │ PypiMirror: https://pypi.tuna.tsinghua.edu.cn/simple
INFO 17:18:33.161 │ Language: zh-CN
INFO 17:18:33.163 │ Rest of the configs are the same as default
INFO 17:18:33.251 │ : D:\SoftWare\FGOPY\FGO-py\deploy\AzurLaneAutoScript\
INFO 17:18:34.227 │ : HEAD is now at 648f43a v19.4.1 fix #136 #139
ERROR 17:18:34.254 │ Traceback (most recent call last):
ERROR 17:18:34.258 │ File "D:\SoftWare\FGOPY\deploy\updater.py", line 9, in
ERROR 17:18:34.260 │ with open('fgoConst.py')as f:installed_version=tuple(int(i)for i in f.readline()[10:-2].split('.'))
ERROR 17:18:34.263 │
^^^^^^^^^^^^
ERROR 17:18:34.265 │ UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position
295: illegal multibyte sequence
INFO 17:18:34.303 │ : Update failed. See above.

hgjazhgj commented 2 weeks ago

我希望我最近能有时间来考察此问题(

w211691 commented 2 weeks ago

我希望我最近能有时间来考察此问题(

奇怪的BUG,单独使用FGOPY没有任何问题

hgjazhgj commented 2 weeks ago

这并不奇怪,原因是我在v19.4.0引入了PEP 540,但未在alas中更改编码