after from_statement() were called.
[ticket:2199]. Also in 0.6.9.
+- engine
+ - Use urllib.parse_qsl() in Python 2.6 and above,
+ no deprecation warning about cgi.parse_qsl()
+ [ticket:1682]
+
- mssql
- Adjusted the pyodbc dialect such that bound
values are passed as bytes and not unicode
be used directly and is also accepted directly by ``create_engine()``.
"""
-import re, cgi, sys, urllib
-from sqlalchemy import exc
+import re, urllib
+from sqlalchemy import exc, util
class URL(object):
if components['database'] is not None:
tokens = components['database'].split('?', 2)
components['database'] = tokens[0]
- query = (len(tokens) > 1 and dict(cgi.parse_qsl(tokens[1]))) or None
+ query = (len(tokens) > 1 and dict(util.parse_qsl(tokens[1]))) or None
# Py2K
if query is not None:
query = dict((k.encode('ascii'), query[k]) for k in query)
m = re.match( r'(\w+)://(.*)', name)
if m is not None:
(name, args) = m.group(1, 2)
- opts = dict( cgi.parse_qsl( args ) )
+ opts = dict( util.parse_qsl( args ) )
return URL(name, *opts)
else:
return None
from compat import callable, cmp, reduce, defaultdict, py25_dict, \
threading, py3k, jython, pypy, win32, set_types, buffer, pickle, \
- update_wrapper, partial, md5_hex, decode_slice, dottedgetter
+ update_wrapper, partial, md5_hex, decode_slice, dottedgetter,\
+ parse_qsl
from _collections import NamedTuple, ImmutableContainer, immutabledict, \
Properties, OrderedProperties, ImmutableProperties, OrderedDict, \
return func(*(args + fargs), **newkeywords)
return newfunc
+
+if sys.version_info < (2, 6):
+ # emits a nasty deprecation warning
+ # in newer pythons
+ from cgi import parse_qsl
+else:
+ from urlparse import parse_qsl
+
if py3k:
# they're bringing it back in 3.2. brilliant !
def callable(fn):