Skip to content
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

转发贴图像init_wh报错 #71

Closed
single-ptilopsis opened this issue Jan 5, 2023 · 3 comments
Closed

转发贴图像init_wh报错 #71

single-ptilopsis opened this issue Jan 5, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@single-ptilopsis
Copy link

single-ptilopsis commented Jan 5, 2023

简要描述这个bug

Traceback (most recent call last):
  File "D:\ProgramProject\Tieba\aiotieba\v2.10.1\test.py", line 18, in <module>
    loop.run_until_complete(run())
  File "D:\ProgramProject\3.9\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "D:\ProgramProject\Tieba\aiotieba\v2.10.1\test.py", line 14, in run
    print(img.show_width)
  File "D:\ProgramProject\Tieba\aiotieba\v2.10.1\aiotieba\client\common\typedef\frags.py", line 193, in show_width
    self._init_wh()
  File "D:\ProgramProject\Tieba\aiotieba\v2.10.1\aiotieba\client\common\typedef\frags.py", line 179, in _init_wh
    self._show_width = int(show_width)
ValueError: invalid literal for int() with base 10: '%!s(*string=0xc1847cc0e0)'

如何复现

import asyncio

import aiotieba as tb


async def run():
    async with tb.Client() as client:
        threads = await client.get_threads('starry')
        for thread in threads:
            if thread.tid != 7905926315:
                continue

            for img in thread.share_origin.contents.imgs:
                print(img.show_width)


loop = asyncio.get_event_loop()
loop.run_until_complete(run())

你希望程序作出何种行为

输出show_width (show_height同理)

@lumina37
Copy link
Owner

lumina37 commented Jan 5, 2023

正在大面积重构,估计明晚的更新会修复这个bug

@n0099
Copy link

n0099 commented Jan 5, 2023

starry神发威了! #63 (comment)

@lumina37
Copy link
Owner

lumina37 commented Jan 9, 2023

2.10.2a1已经修复
这是最新的develop分支下的结果

<2023-01-09 11:20:46.136> [WARN] [_init_by_type] Unknown fragment type. type=34 frag={'data': type: 34
text: "afsff#2#"
}
560
560

@lumina37 lumina37 closed this as completed Jan 9, 2023
@lumina37 lumina37 added the bug Something isn't working label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants