rapidsai / dependency-file-generator

https://pypi.org/project/rapids-dependency-file-generator/
Apache License 2.0
15 stars 13 forks source link

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

Closed mdemoret-nv closed 8 months ago

mdemoret-nv commented 8 months ago

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

vyasr commented 8 months ago

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 commented 8 months ago

~@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).

mdemoret-nv commented 8 months ago

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!

ajschmidt8 commented 8 months ago

:tada: This PR is included in version 1.7.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: