[issue12930] reindent.py inserts spaces in multiline literals

2020-10-25 Thread Dima Tisnek
Dima Tisnek added the comment: Given the trajectory of this bug, would it be easier to remove `reindent.py` from cpython code base entirely? -- ___ Python tracker ___

[issue12930] reindent.py inserts spaces in multiline literals

2020-10-25 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___

[issue12930] reindent.py inserts spaces in multiline literals

2012-09-30 Thread Roger Serwy
Roger Serwy added the comment: This issue also affects reindent.py in Python 3.x. The attached patch adds a -s switch to reindent.py to disallow changes to the contents of strings. The rstrip_and_expand_tabs function tokenizes the input to identify all strings and then expands and rstrips

[issue12930] reindent.py inserts spaces in multiline literals

2012-09-30 Thread Roger Serwy
Roger Serwy added the comment: Attached is a simple test of the -s functionality for reindent.py. It works on Linux but I'm not sure about Windows. -- Added file: http://bugs.python.org/file27367/test_reindent.py ___ Python tracker

[issue12930] reindent.py inserts spaces in multiline literals

2012-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Definitely a bugfix should not add any new switches. Patch would simply lead to preserving of all string literals and nothing more. I will look at Caio's patches a little later. Now Python contains automated tests for some tools. -- nosy:

[issue12930] reindent.py inserts spaces in multiline literals

2012-09-30 Thread Roger Serwy
Roger Serwy added the comment: Definitely a bugfix should not add any new switches. Patch would simply lead to preserving of all string literals and nothing more. I added the switch so that the existing behavior of reindent would stay the same in case some other scripts rely on that

[issue12930] reindent.py inserts spaces in multiline literals

2011-12-31 Thread Jonathan Rogers
Jonathan Rogers jonathanrrog...@gmail.com added the comment: I don't think reindent.py should change any bytes inside string literals since it can't know anything about what those strings mean or how they'll be used by the program at run time. Unfortunately, it starts out by unconditionally

[issue12930] reindent.py inserts spaces in multiline literals

2011-12-31 Thread Jonathan Rogers
Jonathan Rogers jonathanrrog...@gmail.com added the comment: Rather than expanding tab characters inside string literals, it's safer to replace them with '\t'. -- Added file: http://bugs.python.org/file24120/save_strings.patch ___ Python tracker

[issue12930] reindent.py inserts spaces in multiline literals

2011-12-21 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: I applied the patch and it failed against the attached tab_test.py file. For reference, every '\t' in the file is followed by Tab. -- nosy: +serwy Added file: http://bugs.python.org/file24074/tab_test.py

[issue12930] reindent.py inserts spaces in multiline literals

2011-11-21 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks, I’ll make time to review the change this week. -- dependencies: +Add tests for Tools/scripts/reindent.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Dima Tisnek
Dima Tisnek dim...@gmail.com added the comment: good enough for me :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930 ___ ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I want to look at this but lack time right now. Could someone make one up-to-date patch with all changes, code and tests? It will be much easier to review and test than an archive. -- ___ Python

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Forget that, there are no automated tests for tools. So, a text version of the files would be nice. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: Attaching files from tarball as requested. See http://bugs.python.org/issue12930#msg144314 for explanation -- Added file: http://bugs.python.org/file23500/testfile-original.py ___ Python tracker

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Caio Romão
Changes by Caio Romão caioro...@gmail.com: Added file: http://bugs.python.org/file23501/testfile-expected.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930 ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-22 Thread Caio Romão
Changes by Caio Romão caioro...@gmail.com: Added file: http://bugs.python.org/file23502/testfile-issue.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930 ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-10-21 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: It's been a while since this got any activity. Was the provided testfile not enough or any issue found? Just let me know and I'll make adjustments asap. -- ___ Python tracker rep...@bugs.python.org

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-20 Thread Dima Tisnek
Dima Tisnek dim...@gmail.com added the comment: Thanks Caio, your test case covers my issue; seeing these spelt out got me thinking, there are perhaps 3~4 different cases: def f0(): s = select some sql from somewhere; -- cannot be reindented def f1(): Multiline text docstring should

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-19 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Follow the “review” link for some comments. Do you have a test file that I could use to reproduce the bug and make sure it’s fixed? -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-19 Thread Caio Romão
Changes by Caio Romão caioro...@gmail.com: Removed file: http://bugs.python.org/file23146/caioromao-fix-12930-v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930 ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-19 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: New patch version ack-ing Éric's suggestion. Note: I'm now confused as to whether I should add my name to the ACKS file or not, heh. This patch doesn't include the change. -- Added file:

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-19 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: Attaching files for testing in a gzipped tarball: - testfile-original.py: file to be reindented with reindent.py - testfile-issue.py: resulting file after using the current Tools/scripts/reindent.py - testfile-expected.py: expected output

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-13 Thread Caio Romão
Changes by Caio Romão caioro...@gmail.com: Removed file: http://bugs.python.org/file23118/caioromao-fix-12930-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930 ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-13 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: Third version, with slightly less code and my name added to the Misc/ACKS file. -- Added file: http://bugs.python.org/file23146/caioromao-fix-12930-v3.patch ___ Python tracker rep...@bugs.python.org

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-07 Thread Dima Tisnek
New submission from Dima Tisnek dim...@gmail.com: Given this as input: #!/usr/bin/python def x(): s = line one line two line three return s reindent.py changes it to: #!/usr/bin/python def x(): s = line one line two line three return s Which means that I cannot use reindent.py

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-07 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: This patch fixes the reported issue. First time contributor here, feel free to bash. -- keywords: +patch nosy: +caioromao Added file: http://bugs.python.org/file23117/caioromao-fix-12930.patch ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-07 Thread Caio Romão
Changes by Caio Romão caioro...@gmail.com: Removed file: http://bugs.python.org/file23117/caioromao-fix-12930.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12930 ___

[issue12930] reindent.py inserts spaces in multiline literals

2011-09-07 Thread Caio Romão
Caio Romão caioro...@gmail.com added the comment: New patch, fixing issue pointed out by gutworth and some others that came up. I've used the following as a test input: -8--8 #!/usr/bin/python def x(): This is a doc ''' Another doc.''' s = line one line two