-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bugfix/html temp file writing #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the width and height parameters in the BaseSVGRenderer
class.
# buffering=0 is very important if you want to yield inside | ||
# Since we don't use the delete option here (we delete manually below) | ||
# we yield outside of this context | ||
# The code below is essentially equivalent to `with open()...write` | ||
with NamedTemporaryFile(prefix="penai_", suffix=extension, mode=mode, delete=False) as file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had issues with this function again yesterday and to my surprise, I actually had to figure out that we can't just use buffering=0
here as it seems to be a requirement for writing to files in text mode for whatever reason.
The solution therefore seems to be to just flush the file after writing. We should also remove the then misleading comment.
You can also stick to the current state and I will provide a PR on top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it already I though. Also had issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was already removed. Was your comment on an older version?
9fa795e
to
93e1554
Compare
No description provided.