-
Notifications
You must be signed in to change notification settings - Fork 167
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
[makeotf] consume tx
stderr
#1074
Comments
Out of curiosity: did this ever work the way you wanted it to (i.e. in older versions of AFDKO)? The reason I ask is, we've been tinkering with that |
@josh-hadley before 5f6f575 the messages from tx and other commands were always discarded (see all the |
@josh-hadley Yes, I can put together a sample script. For what I was doing, I've gone back to subprocess like so: args = ["makeotf", "-f", file, "-o", outputPath, "-r", "-nshw"]
run = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
with open(path, "w") as f:
f.write(run.stdout) which consumes the even the tx output from makeotf when making a TTF. Previously I was doing: from contextlib import redirect_stdout, redirect_stderr
args = ["-f", file, "-o", outputPath, "-r", "-nshw"]
with open(os.path.join(outputPath, f"makeotf_output.txt"), "a") as f:
with redirect_stdout(f), redirect_stderr(f):
makeOTFParams = makeotf.MakeOTFParams()
makeotf.getOptions(makeOTFParams, args)
makeotf.setMissingParams(makeOTFParams)
makeotf.setOptionsFromFontInfo(makeOTFParams)
makeotf.runMakeOTF(makeOTFParams) That wouldn't catch the output from Again, I don't think this is a big issue, and should likely be closed. Subprocess is likely the better way to run this, not calling it directly in another script. |
Closing, per discussion. |
(this is a weird edge case, so feel free to close)
When running
makeotf
from inside another script and redirecting stdout and stderr to a file, thetx
errors when converting a formatafdko/python/afdko/makeotf.py
Line 2019 in d0ccb71
The text was updated successfully, but these errors were encountered: