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

fix: Avoid crash when file in repo contains non-unicode characters #59

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

mdemoret-nv
Copy link
Contributor

This fix prevents a crash when using --clean on a repo where a file contains non-unicode characters. Fix seems benign since any file with non-unicode characters likely wasnt created by this tool.

Closes #58

@mdemoret-nv mdemoret-nv changed the title Avoid crash when file in repo contains non-unicode characters fix: Avoid crash when file in repo contains non-unicode characters Dec 13, 2023
@vyasr
Copy link
Contributor

vyasr commented Dec 13, 2023

I agree that this seems safe, but would like confirmation from one more dev just in case there's a use case I'm missing.

@bdice
Copy link
Contributor

bdice commented Dec 13, 2023

@mdemoret-nv Can you share an example file where this failed (minimized is best), and also the full error output you got with the UnicodeDecodeError?

I was able to reproduce this by attempting to read a Linux executable (or shared library, or similar binary).

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @vyasr and this seems like a reasonable fix. I found a way to reproduce this locally, so we're good to merge once my suggestion is applied.

@mdemoret-nv
Copy link
Contributor Author

Discussed with @vyasr and this seems like a reasonable fix. I found a way to reproduce this locally, so we're good to merge once my suggestion is applied.

Committed. Thanks!

@vyasr vyasr merged commit 61a6a8e into rapidsai:main Dec 13, 2023
3 checks passed
ajschmidt8 pushed a commit that referenced this pull request Dec 13, 2023
## [1.7.2](v1.7.1...v1.7.2) (2023-12-13)

### Bug Fixes

* Avoid crash when file in repo contains non-unicode characters ([#59](#59)) ([61a6a8e](61a6a8e)), closes [#58](#58)
@ajschmidt8
Copy link
Member

🎉 This PR is included in version 1.7.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

difyrrwrzd added a commit to difyrrwrzd/dependency-file-generator that referenced this pull request Aug 10, 2024
## [1.7.2](rapidsai/dependency-file-generator@v1.7.1...v1.7.2) (2023-12-13)

### Bug Fixes

* Avoid crash when file in repo contains non-unicode characters ([#59](rapidsai/dependency-file-generator#59)) ([f178845](rapidsai/dependency-file-generator@f178845)), closes [#58](rapidsai/dependency-file-generator#58)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tool fails when using --clean if files with non-unicode characters exist in the repo
4 participants