diff options
-rw-r--r-- | changelog.rst | 4 | ||||
-rw-r--r-- | pgcli/pgexecute.py | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/changelog.rst b/changelog.rst index 91f908a5..fa7d402d 100644 --- a/changelog.rst +++ b/changelog.rst @@ -6,6 +6,7 @@ Bug fixes: * Escape switches to VI navigation mode when not canceling completion popup. (Thanks: `Nathan Verzemnieks`_) * Allow application_name to be overridden. (Thanks: `raylu`_) * Fix for "no attribute KeyringLocked" (#1040). (Thanks: `Irina Truong`_) +* Pgcli no longer works with password containing spaces (#1043). (Thanks: `Irina Truong`_) 2.1.0 ===== @@ -960,4 +961,5 @@ Improvements: .. _`Scott Brenstuhl`: https://github.com/808sAndBR .. _`easteregg`: https://github.com/verfriemelt-dot-org .. _`Nathan Verzemnieks`: https://github.com/njvrzm -.. _`raylu`: https://github.com/benchling +.. _`raylu`: https://github.com/raylu + diff --git a/pgcli/pgexecute.py b/pgcli/pgexecute.py index a0c7dc9e..8e5616f7 100644 --- a/pgcli/pgexecute.py +++ b/pgcli/pgexecute.py @@ -7,7 +7,7 @@ import psycopg2.extensions as ext import sqlparse import pgspecial as special import select -from psycopg2.extensions import POLL_OK, POLL_READ, POLL_WRITE +from psycopg2.extensions import POLL_OK, POLL_READ, POLL_WRITE, make_dsn from .packages.parseutils.meta import FunctionMetadata, ForeignKey from .encodingutils import unicode2utf8, PY2, utf8tounicode @@ -238,9 +238,8 @@ class PGExecute(object): }) if 'password' in conn_params and 'dsn' in conn_params: - conn_params['dsn'] = "{0} password={1}".format( - conn_params['dsn'], conn_params.pop('password') - ) + conn_params['dsn'] = make_dsn( + conn_params['dsn'], password=conn_params.pop('password')) conn = psycopg2.connect(**conn_params) cursor = conn.cursor() |