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

fix invalid escape sequences #373

Merged
merged 1 commit into from Jun 16, 2023
Merged

fix invalid escape sequences #373

merged 1 commit into from Jun 16, 2023

Conversation

asottile
Copy link
Contributor

these will become SyntaxErrors in future versions of python


I found these by doing this:

python3 -Werror -m compileall .

also by doing this:

$ git ls-files -- '*.py' | xargs flake8 | grep W605
benchmark/bench_etree.py:10:25: W605 invalid escape sequence '\F'
benchmark/benchbase.py:20:26: W605 invalid escape sequence '\F'
doc/mklatex.py:27:31: W605 invalid escape sequence '\{'
doc/mklatex.py:27:35: W605 invalid escape sequence '\}'
doc/mklatex.py:27:39: W605 invalid escape sequence '\}'
doc/mklatex.py:170:15: W605 invalid escape sequence '\h'
doc/update_performance_results.py:5:6: W605 invalid escape sequence '\s'
doc/update_performance_results.py:5:21: W605 invalid escape sequence '\w'
doc/update_performance_results.py:5:26: W605 invalid escape sequence '\s'
doc/update_performance_results.py:5:38: W605 invalid escape sequence '\w'
doc/update_performance_results.py:5:42: W605 invalid escape sequence '\s'
doc/update_performance_results.py:5:45: W605 invalid escape sequence '\('
doc/update_performance_results.py:5:60: W605 invalid escape sequence '\w'
doc/update_performance_results.py:5:64: W605 invalid escape sequence '\s'
doc/update_performance_results.py:5:67: W605 invalid escape sequence '\w'
doc/update_performance_results.py:5:73: W605 invalid escape sequence '\s'
doc/update_performance_results.py:5:76: W605 invalid escape sequence '\)'
doc/update_performance_results.py:5:78: W605 invalid escape sequence '\s'
doc/update_performance_results.py:5:97: W605 invalid escape sequence '\s'
setup.py:117:64: W605 invalid escape sequence '\.'

these will become SyntaxErrors in future versions of python
@@ -7,7 +7,7 @@
serialized, children, nochange)

TEXT = "some ASCII text"
UTEXT = u"some klingon: \F8D2"
UTEXT = u"some klingon: \uF8D2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is technically a behaviour change -- though I think the original code was a mistake given the u prefix

@@ -17,7 +17,7 @@ def exec_(code, glob):
TREE_FACTOR = 1 # increase tree size with '-l / '-L' cmd option

_TEXT = "some ASCII text" * TREE_FACTOR
_UTEXT = u"some klingon: \F8D2" * TREE_FACTOR
_UTEXT = u"some klingon: \uF8D2" * TREE_FACTOR
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

@scoder scoder merged commit fdb73ec into lxml:master Jun 16, 2023
30 of 46 checks passed
@scoder
Copy link
Member

scoder commented Jun 16, 2023

Thanks

scoder pushed a commit that referenced this pull request Jul 4, 2023
these will become SyntaxErrors in future versions of python
@asottile asottile deleted the invalid-escape branch September 26, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants