LSPosed / MagiskOnWSALocal

Integrate Magisk root and Google Apps into WSA (Windows Subsystem for Android)
GNU Affero General Public License v3.0
9.6k stars 23.12k forks source link

Fix python `SyntaxWarning`s on non-raw regex strings #810

Closed Morilli closed 2 weeks ago

Morilli commented 3 months ago

This fixes some SyntaxWarnings from new(er) python versions on non-raw strings used in re. contexts.

$ python3 --version
3.12.4

e.g.

COMMAND_LINE=--arch x64 --release-type retail --root-sol magisk --magisk-ver stable --install-gapps --remove-amazon
INFO: Architecture: x64
INFO: Release Type: retail
INFO: Magisk Version: stable
INFO: Root Solution: magisk
INFO: Compress Format: none
INFO: Release Name: Retail

Generating WSA Download Links
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:148: SyntaxWarning: invalid escape sequence '\.'
  if re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:150: SyntaxWarning: invalid escape sequence '\d'
  u'\d{4}.\d{5}.\d{1,}.\d{1,}', filename).group()
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:156: SyntaxWarning: invalid escape sequence '\.'
  if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:156: SyntaxWarning: invalid escape sequence '\.'
  if re.match(f"Microsoft\.UI\.Xaml\..*_{arch}_.*\.appx", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:159: SyntaxWarning: invalid escape sequence '\.'
  elif re.match(f"Microsoft\.VCLibs\..+\.UWPDesktop_.*_{arch}_.*\.appx", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:159: SyntaxWarning: invalid escape sequence '\.'
  elif re.match(f"Microsoft\.VCLibs\..+\.UWPDesktop_.*_{arch}_.*\.appx", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:162: SyntaxWarning: invalid escape sequence '\.'
  elif re.match(f"Microsoft\.VCLibs\..+_.*_{arch}_.*\.appx", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:162: SyntaxWarning: invalid escape sequence '\.'
  elif re.match(f"Microsoft\.VCLibs\..+_.*_{arch}_.*\.appx", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:165: SyntaxWarning: invalid escape sequence '\.'
  elif not skip_wsa_download and re.match(f"MicrosoftCorporationII\.WindowsSubsystemForAndroid_.*\.msixbundle", filename):
/mnt/d/GitHub/MagiskOnWSALocal/scripts/generateWSALinks.py:167: SyntaxWarning: invalid escape sequence '\d'
  u'\d{4}.\d{5}.\d{1,}.\d{1,}', filename).group()
Generating WSA download link: arch=x64 release_type=Retail
...

I'm not sure if these invalid sequences actually affect the result, but it's best to fix them anyway.