Remove custom language pack behavior #291
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
is_tracked_with_lfs
method has branching logic set according to the contents of an error message. However, this error message comes fromgit
which has localization support: if the default locale is set to something other than English, then the error message will be different.While it isn't an issue in other parts of the library where we leverage this error message to give more information about the error, it would be an issue here as the end result is vastly different: from a
return False
to araise Exception
. Raising an exception here would result in a non-understandable error that would be complex to diagnose.Instead, we choose to check if the folder is a git repository when an error is detected: if it is not, then the file is not tracked with GIT LFS. If it is a git repository but the command still resulted in an error, the error is raised.
Another possibility would have been to force the locale to be a given language, such as English with the following environment variable set:
LC_ALL=en_EN
before launching the program. This, however, relies on the user having the English language pack already installed in their environment, which may not be the case.