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

Python 3.12 Support #328

Closed
pandasauce opened this issue Sep 19, 2024 · 1 comment · Fixed by #329
Closed

Python 3.12 Support #328

pandasauce opened this issue Sep 19, 2024 · 1 comment · Fixed by #329

Comments

@pandasauce
Copy link

Looks like some regular expressions used in the project are making Python 3.12 upset:

  killedRE = re.compile('</hierarchy>[\n\S]*Killed', re.MULTILINE)
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/viewclient.py:3588: SyntaxWarning: invalid escape sequence '\S'
  dumpedToDevTtyRE = re.compile('</hierarchy>[\n\S]*UI hierchary dumped to: /dev/tty.*', re.MULTILINE)
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/viewclient.py:3598: SyntaxWarning: invalid escape sequence '\['
  if re.search('\[: not found', received):
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:617: SyntaxWarning: invalid escape sequence '\s'
  rsRE = re.compile('\s*mRestrictedScreen=\((?P<x>\d+),(?P<y>\d+)\) (?P<w>\d+)x(?P<h>\d+)')
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:673: SyntaxWarning: invalid escape sequence '\d'
  phyDispRE = re.compile('Physical size: (?P<width>\d+)x(?P<height>\d+).*Physical density: (?P<density>\d+)',
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:685: SyntaxWarning: invalid escape sequence '\d'
  '.*PhysicalDisplayInfo{(?P<width>\d+) x (?P<height>\d+), .*, density (?P<density>[\d.]+).*')
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:698: SyntaxWarning: invalid escape sequence '\s'
  phyDispRE = re.compile('\s*mUnrestrictedScreen=\((?P<x>\d+),(?P<y>\d+)\) (?P<width>\d+)x(?P<height>\d+)')
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:700: SyntaxWarning: invalid escape sequence '\s'
  dispWHRE = re.compile('\s*DisplayWidth=(?P<width>\d+) *DisplayHeight=(?P<height>\d+)')
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:746: SyntaxWarning: invalid escape sequence '\s'
  surfaceOrientationRE = re.compile('SurfaceOrientation:\s+(\d+)')
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1341: SyntaxWarning: invalid escape sequence '\{'
  widRE = re.compile('^ *Window #%s Window\{%s (u\d+ )?%s?.*\}:' %
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1343: SyntaxWarning: invalid escape sequence '\{'
  currentFocusRE = re.compile('^  mCurrentFocus=Window\{%s .*' % _nh('winId'))
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1346: SyntaxWarning: invalid escape sequence '\['
  containingFrameRE = re.compile('^   *mContainingFrame=\[%s,%s\]\[%s,%s\] mParentFrame=\[%s,%s\]\[%s,%s\]' %
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1349: SyntaxWarning: invalid escape sequence '\['
  contentFrameRE = re.compile('^   *mContentFrame=\[%s,%s\]\[%s,%s\] mVisibleFrame=\[%s,%s\]\[%s,%s\]' %
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1353: SyntaxWarning: invalid escape sequence '\['
  framesRE = re.compile('^   *Frames: containing=\[%s,%s\]\[%s,%s\] parent=\[%s,%s\]\[%s,%s\]' %
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1355: SyntaxWarning: invalid escape sequence '\['
  contentRE = re.compile('^     *content=\[%s,%s\]\[%s,%s\] visible=\[%s,%s\]\[%s,%s\]' %
/usr/local/lib/python3.12/site-packages/com/dtmilano/android/adb/adbclient.py:1466: SyntaxWarning: invalid escape sequence '\s'
  activityRE = re.compile('\s*ACTIVITY ([A-Za-z0-9_.]+)/([A-Za-z0-9_.\$]+) \w+ pid=(\d+)')
@dtmilano
Copy link
Owner

They are just warnings, as Python 3.12 is more strict.
Feel free to publish a PR, the changes are fairly simple.

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 a pull request may close this issue.

2 participants