diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-05-29 18:49:27 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-05-29 18:49:27 -0400 |
| commit | 3bf77b1b0b18b6091c96e37823bcca87237d5482 (patch) | |
| tree | 7ce0a8733694d2ebf6e696dcca68d22fad8bd62b /lib/sqlalchemy/engine/url.py | |
| parent | 9c746c44a314d357b855108b6e99b773ce52f760 (diff) | |
| parent | be2c145a84df5db0233f84995765d3f614776f75 (diff) | |
| download | sqlalchemy-3bf77b1b0b18b6091c96e37823bcca87237d5482.tar.gz | |
Merge branch 'rel_0_9'
Conflicts:
lib/sqlalchemy/dialects/postgresql/hstore.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/compat.py
Diffstat (limited to 'lib/sqlalchemy/engine/url.py')
| -rw-r--r-- | lib/sqlalchemy/engine/url.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py index c4931b48c..ed5729eea 100644 --- a/lib/sqlalchemy/engine/url.py +++ b/lib/sqlalchemy/engine/url.py @@ -14,7 +14,6 @@ be used directly and is also accepted directly by ``create_engine()``. """ import re -import urllib from .. import exc, util from . import Dialect @@ -67,7 +66,7 @@ class URL(object): if self.username is not None: s += self.username if self.password is not None: - s += ':' + urllib.quote_plus(self.password) + s += ':' + util.quote_plus(self.password) s += "@" if self.host is not None: s += self.host @@ -76,7 +75,7 @@ class URL(object): if self.database is not None: s += '/' + self.database if self.query: - keys = self.query.keys() + keys = list(self.query) keys.sort() s += '?' + "&".join("%s=%s" % (k, self.query[k]) for k in keys) return s @@ -150,7 +149,7 @@ def make_url(name_or_url): existing URL object is passed, just returns the object. """ - if isinstance(name_or_url, basestring): + if isinstance(name_or_url, util.string_types): return _parse_rfc1738_args(name_or_url) else: return name_or_url @@ -177,17 +176,15 @@ def _parse_rfc1738_args(name): tokens = components['database'].split('?', 2) components['database'] = tokens[0] query = (len(tokens) > 1 and dict(util.parse_qsl(tokens[1]))) or None - # Py2K - if query is not None: + if util.py2k and query is not None: query = dict((k.encode('ascii'), query[k]) for k in query) - # end Py2K else: query = None components['query'] = query if components['password'] is not None: components['password'] = \ - urllib.unquote_plus(components['password']) + util.unquote_plus(components['password']) name = components.pop('name') return URL(name, **components) |
