Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: SyntaxError in Python / Bash (Read 409 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SyntaxError in Python / Bash

Hello, I just had to reinstall Artix after my disk failed. Before I was using a base build with XFCE, this time I've used the preconfigured XFCE spin. If I run Python interactively from the terminal and try to paste code in from a text file I get the "unsafe paste" dialog but then it works, all so far so good, but if I disable the unsafe paste check I get "SyntaxError: multiple statements found". The previous install didn't do this and other Linux systems I have access to don't either. Any ideas? Thanks.
EDIT: just realised my other, older install at work is doing the same thing, and that BASH 5.1 was just released so I expect the problem has come in from there.
EDIT 2: OK, you learn something new every day: today I learned what "bracketed paste" is, and it's enabled by default in BASH 5.1. I was able to get the functionality I want back by putting "set enable-bracketed-paste off" into ~/.inputrc
(Yes, I know it's not good practice to paste code into Python interactive mode, but for my use case it's really handy and really not worth doing anything more complicated).