This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via 3a880112a5e4219a8bfcee684f2e90a1082c41f0 (commit)
via 76751416320130b67ee6a3dddf53141830706910 (commit)
via 1de380e5ddbe17b6c25edabd2561d40fc0436eb7 (commit)
via 325d0da1f45b6bd8a98c7472e207f6bda627ec01 (commit)
from 748b6d60cc57aa07baa48dbb4ac17e930a61715a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/3a880112a5e4219a8bfcee684f2e90a1082c41f0
commit 3a880112a5e4219a8bfcee684f2e90a1082c41f0
Merge: 748b6d6 7675141
Author: Oleg Broytman <ph...@ph...>
Date: Sun Feb 8 17:37:19 2015 +0300
Merge pull request #69 from drnlm/rewrite_parse_uri
Rewrite parse uri to use urlparse
http://sourceforge.net/p/sqlobject/sqlobject/ci/76751416320130b67ee6a3dddf53141830706910
commit 76751416320130b67ee6a3dddf53141830706910
Author: Neil <ne...@di...>
Date: Sun Feb 8 10:41:36 2015 +0200
Add workaround for python 2.6 urlparse behaviour
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 277d5d9..ded823f 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -213,6 +213,12 @@ class DBConnection:
@staticmethod
def _parseURI(uri):
parsed = urlparse(uri)
+ if sys.version_info[0] == 2 and sys.version_info[1] < 7:
+ # In python 2.6, urlparse only parses the uri completely
+ # for certain schemes, so we force the scheme to
+ # something that will be parsed correctly
+ scheme = parsed.scheme
+ parsed = urlparse(uri.replace(scheme, 'http', 1))
host, path = parsed.hostname, parsed.path
user, password, port = None, None, None
if parsed.username:
http://sourceforge.net/p/sqlobject/sqlobject/ci/1de380e5ddbe17b6c25edabd2561d40fc0436eb7
commit 1de380e5ddbe17b6c25edabd2561d40fc0436eb7
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:45:09 2015 +0200
Update urllib and urlparse code to support python 3
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 1ea7731..277d5d9 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -8,8 +8,12 @@ if sys.version_info[0] < 3:
import os
import threading
import types
-import urlparse
-import urllib
+try:
+ from urlparse import urlparse, parse_qsl
+ from urllib import unquote, quote, urlencode
+except ImportError:
+ from urllib.parse import urlparse, parse_qsl, unquote, quote, urlencode
+
import warnings
import weakref
@@ -126,9 +130,9 @@ class DBConnection:
def uri(self):
auth = getattr(self, 'user', '') or ''
if auth:
- auth = urllib.quote(auth)
+ auth = quote(auth)
if self.password:
- auth = auth + ':' + urllib.quote(self.password)
+ auth = auth + ':' + quote(self.password)
auth = auth + '@'
else:
assert not getattr(self, 'password', None), (
@@ -142,7 +146,7 @@ class DBConnection:
db = self.db
if db.startswith('/'):
db = db[1:]
- return uri + urllib.quote(db)
+ return uri + quote(db)
@classmethod
def connectionFromOldURI(cls, uri):
@@ -202,23 +206,23 @@ class DBConnection:
arglist = arglist.split('&')
for single in arglist:
argname, argvalue = single.split('=', 1)
- argvalue = urllib.unquote(argvalue)
+ argvalue = unquote(argvalue)
args[argname] = argvalue
return user, password, host, port, path, args
@staticmethod
def _parseURI(uri):
- parsed = urlparse.urlparse(uri)
+ parsed = urlparse(uri)
host, path = parsed.hostname, parsed.path
user, password, port = None, None, None
if parsed.username:
- user = urllib.unquote(parsed.username)
+ user = unquote(parsed.username)
if parsed.password:
- password = urllib.unquote(parsed.password)
+ password = unquote(parsed.password)
if parsed.port:
port = int(parsed.port)
- path = urllib.unquote(path)
+ path = unquote(path)
if (os.name == 'nt') and (len(path) > 2):
# Preserve backward compatibility with URIs like /C|/path;
# replace '|' by ':'
@@ -233,7 +237,7 @@ class DBConnection:
args = {}
if query:
- for name, value in urlparse.parse_qsl(query):
+ for name, value in parse_qsl(query):
args[name] = value
return user, password, host, port, path, args
@@ -1041,9 +1045,9 @@ class ConnectionURIOpener(object):
def connectionForURI(self, uri, oldUri=False, **args):
if args:
if '?' not in uri:
- uri += '?' + urllib.urlencode(args)
+ uri += '?' + urlencode(args)
else:
- uri += '&' + urllib.urlencode(args)
+ uri += '&' + urlencode(args)
if uri in self.cachedURIs:
return self.cachedURIs[uri]
if uri.find(':') != -1:
http://sourceforge.net/p/sqlobject/sqlobject/ci/325d0da1f45b6bd8a98c7472e207f6bda627ec01
commit 325d0da1f45b6bd8a98c7472e207f6bda627ec01
Author: Neil <ne...@di...>
Date: Fri Feb 6 11:44:33 2015 +0200
Rewrite _parseURI to use urlparse
diff --git a/sqlobject/dbconnection.py b/sqlobject/dbconnection.py
index 6bcfb43..1ea7731 100644
--- a/sqlobject/dbconnection.py
+++ b/sqlobject/dbconnection.py
@@ -1,5 +1,4 @@
import atexit
-from cgi import parse_qsl
import inspect
import sys
if sys.version_info[0] < 3:
@@ -9,6 +8,7 @@ if sys.version_info[0] < 3:
import os
import threading
import types
+import urlparse
import urllib
import warnings
import weakref
@@ -208,28 +208,15 @@ class DBConnection:
@staticmethod
def _parseURI(uri):
- protocol, request = urllib.splittype(uri)
+ parsed = urlparse.urlparse(uri)
+ host, path = parsed.hostname, parsed.path
user, password, port = None, None, None
- host, path = urllib.splithost(request)
-
- if host:
- # Python < 2.7 have a problem -
- # splituser() calls unquote() too early
- # user, host = urllib.splituser(host)
- if '@' in host:
- user, host = host.split('@', 1)
- if user:
- user, password = [x and urllib.unquote(x) or None
- for x in urllib.splitpasswd(user)]
- host, port = urllib.splitport(host)
- if port:
- port = int(port)
- elif host == '':
- host = None
-
- # hash-tag is splitted but ignored
- path, tag = urllib.splittag(path)
- path, query = urllib.splitquery(path)
+ if parsed.username:
+ user = urllib.unquote(parsed.username)
+ if parsed.password:
+ password = urllib.unquote(parsed.password)
+ if parsed.port:
+ port = int(parsed.port)
path = urllib.unquote(path)
if (os.name == 'nt') and (len(path) > 2):
@@ -241,9 +228,12 @@ class DBConnection:
if (path[0] == '/') and (path[2] == ':'):
path = path[1:]
+ query = parsed.query
+ # hash-tag / fragment is ignored
+
args = {}
if query:
- for name, value in parse_qsl(query):
+ for name, value in urlparse.parse_qsl(query):
args[name] = value
return user, password, host, port, path, args
-----------------------------------------------------------------------
Summary of changes:
sqlobject/dbconnection.py | 62 ++++++++++++++++++++++----------------------
1 files changed, 31 insertions(+), 31 deletions(-)
hooks/post-receive
--
SQLObject development repository
|