Skip to content
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

Small refactor for MarkItDown.convert_response function. #168

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Abdujabbar
Copy link

I am trying to refactor this block of code:

https://github.com/microsoft/markitdown/blob/main/src/markitdown/_markitdown.py#L1396-L1419

As we can see here, we are using try/except, which requires manually closing/removing the file.

I want to suggest using context managers, and use NamedTemporaryFile.

I think it's better to read, and support in the future the code.

@Abdujabbar
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant