codeskyblue / codeskyblue/uiautodev

升级到 0.5.0版本之后发生错误

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
538
Forks
88
PR merge metrics
No merged PRs in 30d

Description

INFO: 127.0.0.1:51549 - "OPTIONS /api/android/127.0.0.1%3A16736/screenshot/0?_t=1724682215720 HTTP/1.1" 200 OK
screenshot failed
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautodev\router\device.py", line 61, in _screenshot
pil_img = driver.screenshot(id).convert("RGB")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautodev\driver\android.py", line 38, in screenshot
return self.ud.screenshot()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 260, in screenshot
jpg_raw = base64.b64decode(base64_data)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\base64.py", line 80, in b64decode
s = _bytes_from_decode_data(s)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\base64.py", line 45, in _bytes_from_decode_data
raise TypeError("argument should be a bytes-like object or ASCII "
TypeError: argument should be a bytes-like object or ASCII string, not 'NoneType'
INFO: 127.0.0.1:51549 - "GET /api/android/127.0.0.1%3A16736/screenshot/0?_t=1724682215720 HTTP/1.1" 500 Internal Server Error
INFO: 127.0.0.1:51529 - "GET /api/android/127.0.0.1%3A16736/hierarchy HTTP/1.1" 200 OK

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the screenshot request after upgrading to version 0.5.0, using the Android endpoint shown in the logs. Trace uiautodev/router/device.py, driver/android.py, and uiautomator2/__init__.py through the screenshot call and inspect why the base64 input is None. Done means the screenshot request succeeds instead of returning HTTP 500, with a regression test or verified reproduction if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.