You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
target file "bowler_bug.py":
def foo():
bar = 1
return bar(EOF)
code to run:
from bowler import Query
path = "bowler_bug.py"
Query(path).select_var("bar").rename("new_bar").execute(write=True, silent=True)
result:
hunks failed to apply, rejects saved to bowler_bug.py.rej
Traceback (most recent call last):
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/bowler/tool.py", line 348, in apply_hunks
sh.patch(*args[1:], _in=accepted_hunks.encode("utf-8")) # type: ignore
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 1427, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 774, in init
self.wait()
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/bin/patch -u bowler_bug.py
STDOUT:
patching file bowler_bug.py
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file bowler_bug.py.rej
STDERR:
When a new line is added, the renaming works
The text was updated successfully, but these errors were encountered:
iddobergersf
changed the title
Rename variable with no blank line in end of file crashes
Rename variable crashes when no blank line is in the end of the .py file
Jul 22, 2019
iddobergersf
changed the title
Rename variable crashes when no blank line is in the end of the .py file
Rename variable crashes when there isn't a blank line is in the end of the .py file
Jul 22, 2019
I will take a look, the .rej file is probably missing the "no newline at end of file" line. If so this is likely https://bugs.python.org/issue2142 which is still open.
target file "bowler_bug.py":
def foo():
bar = 1
return bar(EOF)
code to run:
from bowler import Query
path = "bowler_bug.py"
Query(path).select_var("bar").rename("new_bar").execute(write=True, silent=True)
result:
hunks failed to apply, rejects saved to bowler_bug.py.rej
Traceback (most recent call last):
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/bowler/tool.py", line 348, in apply_hunks
sh.patch(*args[1:], _in=accepted_hunks.encode("utf-8")) # type: ignore
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 1427, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 774, in init
self.wait()
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/Users/iddoberger/.virtualenvs/dev_research_venv/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/bin/patch -u bowler_bug.py
STDOUT:
patching file bowler_bug.py
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file bowler_bug.py.rej
STDERR:
When a new line is added, the renaming works
The text was updated successfully, but these errors were encountered: