-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
[Bug] Override grammar: quoted strings ending with a trailing backslash may trigger parsing errors #1600
Comments
Looks like defining QUOTED_VALUE like in OmegaConf (in the iteration you are pointing to solves the issues)?
By this you mean the case where Hydra is getting a single backslash, yes?
|
I'm actually planning to use the lexer mode-based approach from omry/omegaconf#695 because later I'll also need to be able to handle nested quoted strings within interpolations (if you think we can avoid it let me know).
Yes, those would crash because |
If we find a way to make the Hydra grammar agnostic to interpolations we should not need this. |
Fix escaping in quoted values Fixes #1600
🐛 Bug
Description
The following override examples cause exceptions (note: there is escaping from the shell, so when using
\\
below, Hydra only sees\
, and escaped quotes are also replaced, e.g.\"
->"
):Note that if the second string is using double quotes then there is no exception:
Expected behavior
The fix to this issue should make it so that:
#\
(i.e., with a single backslash), compared to the current behavior where 3b and 4b yield#\\
Migration instructions
If a working string in Hydra 1.0 triggers an exception or behaves unexpectedly in Hydra 1.1, this means some
\
need to be properly escaped. Here are two examples (where again,\
are doubled because of shell escaping):Are you willing to open a pull request? (See CONTRIBUTING)
Yes I will.
Additional context
This is caused by the definition of
QUOTED_VALUE
in the grammar, similar to OmegaConf's issue omry/omegaconf#617The text was updated successfully, but these errors were encountered: