-
Notifications
You must be signed in to change notification settings - Fork 49
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
autopep double escape in multiline string literals #618
Comments
@c0c0n3 this is not happening for the github workflow afaik, maybe we have just to adjust something in the lint script? |
@chicco785 what autopep8 version do we have in CircleCI? I used the latest 1.6.0, maybe that doesn't happen in older versions? we could also look into what the |
@chicco785 or it could be print('''
\tonnect
''') outputs: print('''
\connect
''') simply because there's no |
linting is performed by github workflows, not in circle-ci: still from the workflow, I can't infer the autopep version. |
here is the answer: 1.5.4 |
So it's a problem (or feature?) with autopep v1.6. If I try linting w/ v $ cd ngsi-timeseries-api
$ pipenv install autopep8==1.5.4
$ pipenv shell
$ autopep8 --exit-code --recursive --in-place --aggressive --aggressive . git says nothing changed. In other words, autopep 1.5.4 does not escape |
I think the first thing we need to understand is if pep 1.6 is right or not :) Then let's handle accordingly. |
Hi, @c0c0n3 I analyzed this issue and my understanding was autopep version in CREATE DATABASE ${db_name} \connect ${db_name} CREATE EXTENSION IF NOT EXISTS postgis CASCADE; Or we should've pinned the autopep |
@Necravisaketi thanks for the analysis, that helps! I'd suggest
Thoughts? |
Describe the bug
With our linting configuration, it sometime autopep escapes escape chars that it shouldn't---see this comment to #499 about it.
To Reproduce
Install autopep and run the command line in
lint.py.sh
Git should report that
timescale-container/quantumleap-db-setup.py
changed. If you do a diff you should see a\
character being escaped. That shouldn't happen I think b/c the string in question is a multiline string literal?Expected behavior
Not sure if it's autopep at fault or backslashes should actually always be escaped. If you run the following Python code
the characters
\connect
get printed on stdout. But the same happens if you runNotice the double backslash...
Environment
autopep8
version:1.6.0
The text was updated successfully, but these errors were encountered: