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

py warnings - Android TV #114420

Open
Anto79-ops opened this issue Mar 29, 2024 · 16 comments · May be fixed by JeffLIrion/python-androidtv#360
Open

py warnings - Android TV #114420

Anto79-ops opened this issue Mar 29, 2024 · 16 comments · May be fixed by JeffLIrion/python-androidtv#360

Comments

@Anto79-ops
Copy link

The problem

hello

updating to 2024.4.0b0 and b1 on RPi4-4GB/HAOS/SSD and recieved these warnings in the log:

Logger: py.warnings
Source: components/androidtv/__init__.py:17
First occurred: 2:43:35 PM (15 occurrences)
Last logged: 2:43:35 PM

/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:85: SyntaxWarning: invalid escape sequence '\d' pattern = "userId=([\d]+)"
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:102: SyntaxWarning: invalid escape sequence '\d' pattern = "versionName=([\d\.]+)"
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/wm.py:12: SyntaxWarning: invalid escape sequence '\s' SIZE_RE = 'Physical size:\s([\d]+)x([\d]+)'
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/traffic.py:36: SyntaxWarning: invalid escape sequence '\d' pattern = "userId=([\d]+)"
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/cpustat.py:90: SyntaxWarning: invalid escape sequence '\s' "cpu\s+([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s")

thanks

What version of Home Assistant Core has the issue?

2024.4.0b1

What was the last working version of Home Assistant Core?

2024.3.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

AndroidTV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/androidtv_remote/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @tronikos, @Drafteed, mind taking a look at this issue as it has been labeled with an integration (androidtv_remote) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of androidtv_remote can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign androidtv_remote Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


androidtv_remote documentation
androidtv_remote source
(message by IssueLinks)

@frenck frenck added this to the 2024.4.0 milestone Mar 29, 2024
@Drafteed
Copy link
Contributor

@home-assistant unassign androidtv_remote

@home-assistant
Copy link

home-assistant bot commented Apr 1, 2024

Hey there @JeffLIrion, @ollo69, mind taking a look at this issue as it has been labeled with an integration (androidtv) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of androidtv can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign androidtv Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


androidtv documentation
androidtv source
(message by IssueLinks)

@RobertD502
Copy link
Contributor

Although @mib1185 opened a PR to fix the issue on ppadb's end, the library itself doesn't look like it is maintained any longer with a decent amount of stale PRs.

@andrewjswan
Copy link

#115038 (comment)

@gondlong
Copy link

same here.

Logger: py.warnings
Source: components/androidtv/__init__.py:18
First occurred: 9:10:45 PM (15 occurrences)
Last logged: 9:10:45 PM

/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:85: SyntaxWarning: invalid escape sequence '\d' pattern = "userId=([\d]+)"
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:102: SyntaxWarning: invalid escape sequence '\d' pattern = "versionName=([\d\.]+)"
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/wm.py:12: SyntaxWarning: invalid escape sequence '\s' SIZE_RE = 'Physical size:\s([\d]+)x([\d]+)'
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/traffic.py:36: SyntaxWarning: invalid escape sequence '\d' pattern = "userId=([\d]+)"
/usr/local/lib/python3.12/site-packages/ppadb/plugins/device/cpustat.py:90: SyntaxWarning: invalid escape sequence '\s' "cpu\s+([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s")

This warning appears after updating to 2024.6.2

@RobertD502
Copy link
Contributor

RobertD502 commented Jun 11, 2024

It has been an issue with the ppadb library for a while now. As far as I can tell, it hasn't caused any issues, at least for me, with the androidtv integration. You'll just need to get used to seeing this and ignoring it whenever Home Assistant is updated (the message won't appear during regular HA restarts). Once a fix is implemented in the backend library and Home Assistant uses the updated library, the message will stop appearing during HA updates.

As I mentioned before, although a user has created a PR for said library, the owner of it hasn't made any changes to it for 4 years - the PR doesn't have a high likelihood of getting merged. So, this message will likely only be fixed if a fork with the changes is made/used by Home Assistant instead of the current library.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@Anto79-ops
Copy link
Author

no stale please

@github-actions github-actions bot removed the stale label Sep 9, 2024
@rs443
Copy link

rs443 commented Sep 21, 2024

Had this warnings a few months and still present in latest 2024.9.2.

2024-09-21 06:21:21.982 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/device.py:34: SyntaxWarning: invalid escape sequence '\s'
  INSTALL_RESULT_PATTERN = "(Success|Failure|Error)\s?(.*)"

2024-09-21 06:21:21.988 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/command/transport/__init__.py:95: SyntaxWarning: invalid escape sequence '\['
  result_pattern = "^\[([\s\S]*?)\]: \[([\s\S]*?)\]\r?$"

2024-09-21 06:21:22.007 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:35: SyntaxWarning: invalid escape sequence '\s'
  pattern = "ACTIVITY\s([\w\.]+)/([\w\.]+)\s[\w\d]+\spid=([\d]+)"

2024-09-21 06:21:22.008 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:48: SyntaxWarning: invalid escape sequence '\s'
  total_meminfo_re = re.compile('\s*TOTAL\s*(?P<pss>\d+)'

2024-09-21 06:21:22.008 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:49: SyntaxWarning: invalid escape sequence '\s'
  '\s*(?P<private_dirty>\d+)'

2024-09-21 06:21:22.009 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:50: SyntaxWarning: invalid escape sequence '\s'
  '\s*(?P<private_clean>\d+)'

2024-09-21 06:21:22.009 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:51: SyntaxWarning: invalid escape sequence '\s'
  '\s*(?P<swapped_dirty>\d+)'

2024-09-21 06:21:22.009 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:52: SyntaxWarning: invalid escape sequence '\s'
  '\s*(?P<heap_size>\d+)'

2024-09-21 06:21:22.010 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:53: SyntaxWarning: invalid escape sequence '\s'
  '\s*(?P<heap_alloc>\d+)'

2024-09-21 06:21:22.010 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:54: SyntaxWarning: invalid escape sequence '\s'
  '\s*(?P<heap_free>\d+)')

2024-09-21 06:21:22.011 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:85: SyntaxWarning: invalid escape sequence '\d'
  pattern = "userId=([\d]+)"

2024-09-21 06:21:22.011 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/utils.py:102: SyntaxWarning: invalid escape sequence '\d'
  pattern = "versionName=([\d\.]+)"

2024-09-21 06:21:22.018 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/wm.py:12: SyntaxWarning: invalid escape sequence '\s'
  SIZE_RE = 'Physical size:\s([\d]+)x([\d]+)'

2024-09-21 06:21:22.035 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/traffic.py:36: SyntaxWarning: invalid escape sequence '\d'
  pattern = "userId=([\d]+)"

2024-09-21 06:21:22.043 WARNING (ImportExecutor_0) [py.warnings] /usr/local/lib/python3.12/site-packages/ppadb/plugins/device/cpustat.py:90: SyntaxWarning: invalid escape sequence '\s'
  "cpu\s+([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s([\d]+)\s")

@mib1185
Copy link
Contributor

mib1185 commented Sep 21, 2024

The fix Swind/pure-python-adb#109 hasn't been merged yet into the library.
Unfortunately the pure-python-adb seems to be abandoned (last activity 4 years ago). So if no one wants to take over this lib (fork and maintain it), this bug wouldn't be fixed.

@mib1185 mib1185 removed this from the 2024.4.0 milestone Sep 21, 2024
@tofuSCHNITZEL
Copy link
Contributor

Maybe I overlooked something but I don't think that the androidtv integration actually uses the pure-python-adb library anymore at all!
yes its mentioned in the manifest.json but there is no import of ppadb anywhere - so unless I majorly overlooked something I think we can just remove the requirement and all is well - I will try that in my local install now and if successfull prepare a PR.

@tofuSCHNITZEL
Copy link
Contributor

okay so update: indeed the integration is not using pure-python-adb (anymore) so it can definitly be removed from the requirements:
dev...tofuSCHNITZEL:home-assistant:update_androidtv
BUT unfortunately - the package "androidtv" that is used by the integration - depends on pure-python-adb... (https://github.com/JeffLIrion/python-androidtv/blob/343b74ea7bb3d159f8a715190b4b9d8c00c2c0fd/setup.py#L19)
so next step should be changing the androidtv package to not use pure-python-adb anymore (jetpacks away)

@hugh-martin
Copy link

I just upgraded HAOS from 13.2 to 14.1 and HA Core from 2024.11.2 to 2024.12.4 and just seeing these same 'invalid escape sequence' errors for the first time.

@CloCkWeRX
Copy link
Contributor

@JeffLIrion as you are the maintainer of the python-androidtv library; would you be open to just including a forked version with patches in your package or similar?

@CloCkWeRX
Copy link
Contributor

CloCkWeRX commented Feb 9, 2025

I have raised Swind/pure-python-adb#116 for discussion; and spm5065/pure-python-adb#4 is the fork I would choose + extras.

I have also raised JeffLIrion/python-androidtv#360 but may update that shortly if other PRs get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.