SUMMARY When I save a script written in the Scripter with a filename that doesn't explicitly end with .py (even though the "files of type" field is "python file (*.py)"), the script doesn't run anymore but gives an error message. STEPS TO REPRODUCE 1. open Tools > Scripts > Scripter 2. write print("test") 3. Save As "foo" (no .py extension) 4. run by clicking the arrow icon OBSERVED RESULT ====================================== ********************** AttributeError: 'NoneType' object has no attribute 'loader' In file: <frozen importlib._bootstrap> In function: module_from_spec at line: 574. Line with error: ********************** EXPECTED RESULT test SOFTWARE VERSIONS Qt Version: 5.10.0 Python2: 2.7.15 Python3: 3.6.6
Hi Noémie, I'm wondering, why would you do that? The bit of backtrace you give is all in python, not in Krita's code. Could you also pass the full backtrace, not just a snippet?
Hi, I'm not sure I understand your question so do ask again if I didn't answer it. Why did I call it "foo" and not "foo.py"? When you save an image in krita, you don't need to add the extension, it does so automatically; I didn't think about it and assumed python scripts worked the same. And when I got the error message (the one I put in "Observed result"), it didn't help me find what was wrong. I'm worried it might happen to other people too. My bug report wasn't very clear, sorry; what I put in Observed Result (and in Expected Result as well) is the full result I got in the 'Output' section of the Scripter, I didn't remove any of it. The debugger remained empty. I also just ran it from terminal and it didn't print anything new when I saved without the file extension, nor when I ran it (and got the error in the Scripter Output). Please tell me if there is another way to get information that would be useful to you.
If I save a file from the scripter plugin, it does automatically add the .py suffix. In any case, I would like to see the full error: the bit that comes after In function: module_from_spec at line: 574. Line with error:
Created attachment 115672 [details] screenshot of the error message
I guess it's just my computer then, it's not important to fix. Like I said, I gave you the full result I saw in Output. See the file attached.
Okay... Well, it's a bit weird, there definitely should have been more text :-). But I'll close this issue then.