-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Fixed #29199 -- Fixed crash when database user password contains @ sign on Oracle. #9768
Conversation
return settings_dict['NAME'] | ||
|
||
def _connect_string(self): | ||
return '%s/\\"%s\\"@%s' % (self.settings_dict['USER'], self.settings_dict['PASSWORD'], self._dsn()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only format that works with sqlplus
, but it doesn't work as a dsn
argument to cx_Oracle.connect()
. That's why I decided to separate the dsn()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried this patch out (applied against the stable/1.11.x branch) and it works great for me.
After reviewing the diff, the new code seems perfectly concise.
tests/backends/oracle/tests.py
Outdated
# expected. | ||
if 'ORA-01017' not in str(e): | ||
self.fail('Unexpected error raised with password: %s' % e) | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unneeded as per c9ae09a.
tests/backends/oracle/tests.py
Outdated
|
||
|
||
@unittest.skipUnless(connection.vendor == 'oracle', 'Oracle tests') | ||
class PasswordWithAtSignTest(TransactionTestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use a more generic class name so it could be used for other tests? (may be fine to rename and reuse HiddenNoDataFoundExceptionTest?)
…gn on Oracle. Thanks Tim Graham for the review.
@timgraham @shaneallgeier Thanks for reviews. I updated tests. |
https://code.djangoproject.com/ticket/29199