Answer the question
In order to leave comments, you need to log in
Why can't heroku see the ttf file?
When uploading to Heroku Discord, the bot encountered a problem that the script does not see the file (the font, in this case) and refuses to work correctly.
On the locale everything works fine, but on the remote it does not launch functions using the font.
The font in the repository is in .fonts/BAUHS93.ttf, i.e. should not be a problem with detection.
Error in Heroku logs:
What is wrong, please tell me?
Answer the question
In order to leave comments, you need to log in
You are using a relative font path - ".fonts/BAUHS93.ttf".
The relative path is set relative to the current working directory of the program.
Depending on the launch method, it may or may not match the directory where the script is located.
Use sys.argv[0] to get the path to the script and the pathlib module to get the absolute path to the font file instead of relative.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question