Skip to content

Check the length of the screencap before indexing into it#53

Merged
Swind merged 1 commit intoSwind:masterfrom
JeffLIrion:screencap-fix
Aug 5, 2020
Merged

Check the length of the screencap before indexing into it#53
Swind merged 1 commit intoSwind:masterfrom
JeffLIrion:screencap-fix

Conversation

@JeffLIrion
Copy link
Copy Markdown
Contributor

@JeffLIrion JeffLIrion commented Jul 25, 2020

Source: https://community.home-assistant.io/t/native-support-for-android-tv-android-devices/82792/463

Abridged traceback:

File "/usr/local/lib/python3.8/site-packages/androidtv/adb_manager/adb_manager_async.py", line 39, in screencap
  return await asyncio.get_running_loop().run_in_executor(None, self._device.screencap)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
  result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/ppadb/command/transport/__init__.py", line 48, in screencap
  if result[5] == 0x0d:
IndexError: bytearray index out of range

@Swind
Copy link
Copy Markdown
Owner

Swind commented Aug 5, 2020

Hi @JeffLIrion

Thanks for your pull request !

@Swind Swind merged commit 9644c6b into Swind:master Aug 5, 2020
Swind pushed a commit that referenced this pull request Aug 5, 2020
Release Note:

1. Merge Implement async functionality #47 by JeffLIrion
2. Merge Check the length of the screencap before indexing into it #53 by JeffLIrion
3. Remove python 2 support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants