iron.nvim
iron.nvim copied to clipboard
EOL while scanning string literal error in python when last letter is 'r'
When using iron-send-line, certain lines invoke this error. To reproduce simply write any string ending in r like so
b = "aar"
use iron-send-line on this and I get the error below:
Input In [42]
b = "aar""
^
SyntaxError: EOL while scanning string literal
It seems a string ending in r" is interpreted as a string literal. I can work around it by preceding the string by r, like so:
b = r"aar"
But it only works in limited instances and complex Path variables containing strings throw the error above regardless.
Hi @drusmanbashir, I've recently fixed an issue with handling characters (#221) which I think might've fixed this one also. Sorry for not answering before.
On my local tests I didn't have any issues, but if it still persists, please let me know.
I stumbled upon this bug too.
E.g. if i send to REPL this:
dat["r"]
I get:
In [86]: dat["r"]"
Input In [86]
dat["r"]"
^
SyntaxError: unterminated string literal (detected at line 1)
Same happens with single quotes but then the line is terminated with a single quote
I believe this bug has been fixed in the latest iron version. I dont get any error if i run
dat["r"]
for example
I'm using the latest version, I've installed the plugins just a few hours ago
Is it happening for ipython or only for regular python repl?
I suspect it might have something to do w/ bracketed paste
I'm using this custom REPL
repl_definition = {
python = {
command = {"python", "manage.py", "shell", "-i", "ipython"},
format = require("iron.fts.common").bracketed_paste
},
}
Edit:
It works if I send a motion .e.g. ap
Does it break only on send_line then? Interesting...