On Saturday, 22 January 2022 19.49.26 WET Pavel Sanda wrote:
> Hi Jose,
> 
> this what I see in curent master:
> 1. start lyx
> 2. load file
> 3. this is  what I see in terminal window:
> env: '$${python}': No such file or directory
> 
> Most likely related to image preview conversions, this what I see with debug
> messages on graphics:
> graphics/PreviewLoader.cpp (757): PreviewLoader::finishedInProgress(127):
> processing failed for $${python} $$s/scripts/lyxpreview2bitmap.py --png
> "/tmp/lyx_tmpdir.LiGxsfYQmUxW/lyx_tmpbuf6/lyxpreviewGdodeo.tex" --dpi 115
> --fg ff9822 --bg 000000 --bibtex="bibtex"
> 
> 
> These binaries available on my system:
> python     python2    python2.7  python3    python3.9
> python defaults to python2.7
> 
> Pavel

The problem here is that the placeholder is not replaced before being used.
In order to see what python is being used you can see:

Help->About LyX


In a hunch does the attached patch fixes the issue?
The idea is to replace the placeholder when the converter is added/imported.

-- 
José Abílio
diff --git a/src/Converter.cpp b/src/Converter.cpp
index c00941d21f..7bb998d5a9 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -148,6 +148,12 @@ void Converter::readFlags()
 }
 
 
+void Converter::setCommand(std::string const & command)
+{
+	command_ = subst(command, token_python, os::python());
+}
+
+
 Converter const * Converters::getConverter(string const & from,
 					    string const & to) const
 {
diff --git a/src/Converter.h b/src/Converter.h
index 5197e3447a..091dbcd394 100644
--- a/src/Converter.h
+++ b/src/Converter.h
@@ -58,7 +58,7 @@ public:
 	///
 	std::string const command() const { return command_; }
 	///
-	void setCommand(std::string const & command) { command_ = command; }
+	void setCommand(std::string const & command);
 	///
 	std::string const flags() const { return flags_; }
 	///
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to