Skip to content

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Jan 26, 2021

As currently implemented, get_loaded_model inspects the $LOAD_PATH global for path values when trying to find the path for a model file. This would be fine, except that variable is affected by userspace, which means that it will sometimes contain non-string values, often Pathnames. To avoid responding with the error Unable to annotate #{model_path}: no implicit conversion of Pathname into String in this situation, we simply add an explicit to_s call before performing string-specific operations.

Thanks to @a0s for doing the investigation here, and identifying exactly what needed to be changed in order to resolve this issue!

Fixes #758

…ring values As currently implemented, `get_loaded_model` inspects the `$LOAD_PATH` global for path values when trying to find the path for a model file. This would be fine, except that variable is affected by userspace, which means that it will sometimes contain non-string values, often Pathnames. To avoid responding with the error `Unable to annotate #{model_path}: no implicit conversion of Pathname into String` in this situation, we simply add an explicit `to_s` call before performing string-specific operations. Fixes ctran#758
@bopm
Copy link

bopm commented May 10, 2021

@ctran any news on this one?

@ctran ctran merged commit e075a21 into ctran:develop May 10, 2021
@ctran
Copy link
Owner

ctran commented May 10, 2021

Thanks!

ocarta-l pushed a commit to ocarta-l/annotate_models that referenced this pull request Jun 18, 2021
…ring values (ctran#848) As currently implemented, `get_loaded_model` inspects the `$LOAD_PATH` global for path values when trying to find the path for a model file. This would be fine, except that variable is affected by userspace, which means that it will sometimes contain non-string values, often Pathnames. To avoid responding with the error `Unable to annotate #{model_path}: no implicit conversion of Pathname into String` in this situation, we simply add an explicit `to_s` call before performing string-specific operations. Fixes ctran#758
@Hamms Hamms deleted the ensure-string-paths branch April 28, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants