Closed ShaunCurrier closed 8 years ago
Have you tried escaping the dollar sign with another dollar sign (e.g. “$$”). This is required when any configuration parameter contains a "$" that is not meant to reference an external parameter.
Sorry, we didn't try that. Understand that dollar signs may be used for parameters, but can we get a better error message? Currently, the exception is raised from the depths of Python and it's not clear what's happening or why. If I understand your diagnosis correctly, what's happening is that the single dollar sign is interpreted as denoting a parameter, but the parameter name had no meaning (obviously because it was unintentional). In this situation, I'd hope for a meaningful error.
Here is the fix for this issue
https://github.com/asifhj/PyTd
There is a pull request also for code merge
I've confirmed that escaping the $ with another $ does solve the issue.
It looks like if the dollar sign is anywhere but the last character of the password, than a more useful error message is returned.
teradata.api.InterfaceError: ('CONFIG_ERROR', 'Unable to resolve variable "pas$word". Not found: \'word\'')
But I do see the stack trace above when the $ is at the end of the password.
I'll work on a fix that will improve the error message and include instructions about how to escape the input if a parameter reference is unintended. Thanks for reporting.
The problem is the way that string replacement is being done on the following line: https://github.com/Teradata/PyTd/blob/master/teradata/udaexec.py#L583
The line marked with the comment above is the problem. The
substitute()
method relies on special use of dollar signs in strings being operated on, which is a problem when a password with a dollar sign in it rolls around.