Skip to content

Conversation

menezesandre
Copy link
Contributor

@menezesandre menezesandre commented Feb 19, 2025

Fixes #40, #81.
If the first converter raises an exception, then the res variable is not initialized and we get an UnboundLocalError when checking if res is not None.

Initialize `res` at the beginning of `_convert`. If the first converter raises an exception, then the `res` variable was not initialized and we got an error when checking `if res is not None`
@adam-lagoda
Copy link

@afourney
Copy link
Member

afourney commented Feb 28, 2025

Thanks for the fix! Running tests and merging now.

There appears to be an unrelated issue with the docx file being recognized as zip files. I will correct this.

@afourney afourney merged commit d0ed74f into microsoft:main Feb 28, 2025
3 checks passed
@menezesandre menezesandre deleted the patch-1 branch February 28, 2025 16:19
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.

'res' variable not declared inside _convert before usage
3 participants