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

dedent is not working properly with tab indent #4869

Closed
felixxm opened this issue Jan 31, 2017 · 0 comments
Closed

dedent is not working properly with tab indent #4869

felixxm opened this issue Jan 31, 2017 · 0 comments
Labels
Milestone

Comments

@felixxm
Copy link
Contributor

felixxm commented Jan 31, 2017

utils.formatting.dedent is not working properly with tab indent. whitespace_counts contains number of spaces from the beginning of each line (see formatting.py#L35), if string doesn't contain spaces then it is equal to [0,0,0,...,0] which is always true (see formatting.py#L45), hence it will never go to tab stripping.

Steps to reproduce

>>> dedent("first string\n\n\tsecond string")

Expected behavior

>>> "first string\n\nsecond string"

Actual behavior

>>> "first string\n\n\tsecond string"
@xordoquy xordoquy added the Bug label Feb 2, 2017
@xordoquy xordoquy added this to the 3.5.4 Release milestone Feb 2, 2017
@xordoquy xordoquy closed this as completed Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants