miyakogi / pyppeteer

Headless chrome/chromium automation library (unofficial port of puppeteer)
Other
3.56k stars 372 forks source link

SyntaxError: invalid escape sequence #294

Open steven-81 opened 4 years ago

steven-81 commented 4 years ago

With Python 3.7 there is an issue with invalid escape characters (see error message below).

from pyppeteer.us_keyboard_layout import keyDefinitions E File "/Users/xxxxx/.virtualenvs/xxxxxx/lib/python3.7/site-packages/pyppeteer/us_keyboard_layout.py", line 73 E 'Digit9': {'keyCode': 57, 'code': 'Digit9', 'shiftKey': '(', 'key': '9'}, E ^ E SyntaxError: invalid escape sequence (

Current work around is making a raw string.

tirkarthi commented 4 years ago

Some more invalid escape sequence warnings in Python 3.8

find . -iname '*.py'  | xargs -P 4 -I{} python3.8 -Wall -m py_compile {} 
./pyppeteer/us_keyboard_layout.py:73: DeprecationWarning: invalid escape sequence \(
  'Digit9': {'keyCode': 57, 'code': 'Digit9', 'shiftKey': '\(', 'key': '9'},
./pyppeteer/us_keyboard_layout.py:143: DeprecationWarning: invalid escape sequence \<
  'Comma': {'keyCode': 188, 'code': 'Comma', 'shiftKey': '\<', 'key': ','},
./pyppeteer/us_keyboard_layout.py:247: DeprecationWarning: invalid escape sequence \<
  '<': {'keyCode': 188, 'key': '\<', 'code': 'Comma'},
Mattwmaster58 commented 4 years ago

Hi @steven-81, it looks like this project has been abandoned. You may want to consider the active fork pyppeteer2. Feel free to create an issue there if your problem persists with the updated libary.

I know for a fact that us_keyboard_definitions.py has been updated in the fork, no idea when the update will land on PyPi though, and no idea if this issue has been fixed, I will take a look into it.