Ihor Radchenko <yanta...@posteo.net> writes: > WORG documentation is not accurate here. > > If the block has :file parameter _or_ :file-exp parameter and #+name, > the results of evaluation are inserted into a file. Otherwise, results > of evaluation are interpreted as file name--*undocumented*. > > That said, your patch should still work fine even with these > considerations. But we may need to sort out this undocumented behaviour. > Probably, an error like in `org-babel-graphical-output-file' should be > thrown by `org-babel-generate-file-param'.
I think the Worg documentation is accurately describing the behavior of ob-python -- it's just that ob-python uses ":results file" in a nonstandard way. But I'm hesitant to make a breaking change to ob-python on this. Until now it has been the only way for ob-python to return a plot. And the matplotlib example in Worg has been there for 10 years, long before I started maintaining ob-python.