Description
Thanks for the work on this project.
The file android_env/wrappers/a11y_grpc_wrapper.py uses urllib.request.urlopen() but only imports urllib, not
urllib.request. This causes an AttributeError when the accessibility forwarder APK download is triggered.
Error might go unnoticed if another module imports this.
Steps to Reproduce
from android_world.env.android_world_controller import get_controller
ctrl = get_controller(
console_port=5554,
adb_path='~/Library/Android/sdk/platform-tools/adb',
grpc_port=8554
)
Error
File ".../android_env/wrappers/a11y_grpc_wrapper.py", line 41, in _get_accessibility_forwarder_apk
with urllib.request.urlopen(
^^^^^^^^^^^^^^
AttributeError: module 'urllib' has no attribute 'request'
Environment
- android-env version: 1.2.3
- Python version: 3.12
- OS: macOS (Apple Silicon)
Root Cause
Line 22 of a11y_grpc_wrapper.py:
import urllib
Should be:
import urllib.request
In Python 3, urllib is a package and submodules must be explicitly imported.
Proposed Fix
- import urllib
+ import urllib.request
---
Description
Thanks for the work on this project.
The file
android_env/wrappers/a11y_grpc_wrapper.pyusesurllib.request.urlopen()but only importsurllib, noturllib.request. This causes anAttributeErrorwhen the accessibility forwarder APK download is triggered.Error might go unnoticed if another module imports this.
Steps to Reproduce