summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2016-05-16 13:11:54 -0400
committerGerrit Code Review <gerrit2@ln3.zzzcomputing.com>2016-05-16 13:11:54 -0400
commit88cd6e4706cc2adb25907e129b3cf37e52be9fc1 (patch)
tree8e3030c5e8282839cb9d43c2b23c65d646dbcfd9
parent1873d8107ac8cf4258440914d68f12332220e244 (diff)
parent9611ba3a9d7cb134869d3b17949a33647bd56045 (diff)
downloadsqlalchemy-88cd6e4706cc2adb25907e129b3cf37e52be9fc1.tar.gz
Merge "Fix TypeError during cx_Oracle connection"
-rw-r--r--doc/build/changelog/changelog_10.rst11
-rw-r--r--lib/sqlalchemy/dialects/oracle/cx_oracle.py10
2 files changed, 18 insertions, 3 deletions
diff --git a/doc/build/changelog/changelog_10.rst b/doc/build/changelog/changelog_10.rst
index 30f8fb73e..972e808df 100644
--- a/doc/build/changelog/changelog_10.rst
+++ b/doc/build/changelog/changelog_10.rst
@@ -54,6 +54,17 @@
.. change::
:tags: bug, oracle
+ :tickets: 3705
+
+ Fixed a bug in the cx_Oracle connect process that caused a TypeError
+ when the either the user, password or dsn was empty. This prevented
+ external authentication to Oracle databases, and prevented connecting
+ to the default dsn. The connect string oracle:// now logs into the
+ default dsn using the Operating System username, equivalent to
+ connecting using '/' with sqlplus.
+
+ .. change::
+ :tags: bug, oracle
:tickets: 3699
Fixed a bug in the result proxy used mainly by Oracle when binary and
diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py
index 0c93ced97..cfd942d85 100644
--- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py
+++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py
@@ -914,13 +914,17 @@ class OracleDialect_cx_oracle(OracleDialect):
dsn = url.host
opts = dict(
- user=url.username,
- password=url.password,
- dsn=dsn,
threaded=self.threaded,
twophase=self.allow_twophase,
)
+ if dsn is not None:
+ opts['dsn'] = dsn
+ if url.password is not None:
+ opts['password'] = url.password
+ if url.username is not None:
+ opts['user'] = url.username
+
if util.py2k:
if self._cx_oracle_with_unicode:
for k, v in opts.items():