-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FDKFeatureCompiler is broken on POSIX #442
Comments
in the meantime, things have changed and now afdko comes installable via pip so it has nice anybody with a windows machine at hand and with the afdko installed (from pip) could please try this command and let me know if it works now, without adding the import subprocess
subprocess.check_output(["makeotf", "-h"]) |
yes, I tried on my Windows VM without shell=True and it works. Will revert that commit for now. |
Try concatenating the entire command string before you use it as an argument in the call to |
no I don't want to do that. It's not necessary. A list of strings as args is the recommended one. |
https://docs.python.org/3/library/subprocess.html#frequently-used-arguments
|
Here is an example provided in the current Py3 docs: subprocess.check_output(
"ls non_existent_file; exit 0",
stderr=subprocess.STDOUT,
shell=True) |
the use of shell=True is discouraged for security considerations, and is only needed when one needs access to shell-specific features like pipes, wildcards, env variable expansion, etc. (which we don't need in this particular case). |
👍 The Py2 documentation provides an example of list arguments with check_output but only with the executable and a single argument to the executable. It looks like Py3 encourages use of Here are the cPython repository tests for Closed so I will quit investigating :) |
@anthrotype I've issued a pre-release build that contains the fix for adobe-type-tools/afdko#417, in case you want to give it a try. |
This commit which added
shell=True
to the subprocess invocation of makeotf may have fixed it for windows, but broke it for POSIX:6d10690
Quoting subprocess docs
So on Unix, fontmake is trying to call makeotf as:
/bin/sh -c makeotf -f font.ttf -ff feautures -o output.ttf
, which means that the shell is only treating the first argument after -c as the command, the rest is ignored as those are not shell options, but options to the makeotf command...Interestingly nobody complained in the last 8 months...
Which makes me think not many people rely on this feature.
I would actually like to kill it, or at least remove it from fontmake proper, and maybe readd it later as a new optional ufo2ft feature compiler class.
But in any case, we should implement this properly, and with tests, otherwise it gets unnoticed like now.
Perhaps we can do that after makeotf will return a sensible exit code, instead of always success, leaving us in the position of having to parse its output to determine whether it has failed or not:
adobe-type-tools/afdko#417
Or even better, if ever MakeOTF.py exposed some function that we could import and call directly from fontmake instead of having to create temporary files and spawn a new process.
The text was updated successfully, but these errors were encountered: