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 f8d9c4461436912ae7e9cfc8366537a93ffd8cb3 (commit)
via 12f98ccbc4041f947dfa44a82de354914f78ba5e (commit)
via 73513675144495b48a555a0a28f33fdc02eee044 (commit)
via e9649a1889252e469a3032838c8653bf495f01f6 (commit)
from 985b73167935bdd1c59f461079c6bb1642122d40 (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/f8d9c4461436912ae7e9cfc8366537a93ffd8cb3
commit f8d9c4461436912ae7e9cfc8366537a93ffd8cb3
Merge: 7351367 12f98cc
Author: Oleg Broytman <ph...@ph...>
Date: Thu Mar 5 23:06:55 2015 +0300
Merge pull request #110 from drnlm/require_mysqldb_1.2.2
Bump MySQLdb requirement to at least 1.2.2
http://sourceforge.net/p/sqlobject/sqlobject/ci/12f98ccbc4041f947dfa44a82de354914f78ba5e
commit 12f98ccbc4041f947dfa44a82de354914f78ba5e
Author: Neil <drn...@gm...>
Date: Thu Mar 5 21:43:07 2015 +0200
Bump MySQLdb requirement to at least 1.2.2
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index 0701367..b346110 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -54,12 +54,8 @@ class MySQLConnection(DBAPI):
MySQLdb.Binary = lambda x: mysql_Bin(x).decode(
'ascii', errors='surrogateescape')
- # MySQLdb < 1.2.1: only ascii
- # MySQLdb = 1.2.1: only unicode
- # MySQLdb > 1.2.1: both ascii and unicode
- self.need_unicode = (
- (self.module.version_info[:3] >= (1, 2, 1)) and
- (self.module.version_info[:3] < (1, 2, 2)))
+ if self.module.version_info[:3] < (1, 2, 2):
+ raise ValueError('SQLObject requires MySQLdb 1.2.2 or later')
self._server_version = None
self._can_use_microseconds = None
@@ -110,12 +106,6 @@ class MySQLConnection(DBAPI):
conn.autocommit(auto)
def _executeRetry(self, conn, cursor, query):
- if self.need_unicode and not isinstance(query, unicode):
- try:
- query = unicode(query, self.dbEncoding)
- except UnicodeError:
- pass
-
# When a server connection is lost and a query is attempted, most of
# the time the query will raise a SERVER_LOST exception, then at the
# second attempt to execute it, the mysql lib will reconnect and
http://sourceforge.net/p/sqlobject/sqlobject/ci/73513675144495b48a555a0a28f33fdc02eee044
commit 73513675144495b48a555a0a28f33fdc02eee044
Merge: 985b731 e9649a1
Author: Oleg Broytman <ph...@ph...>
Date: Thu Mar 5 18:45:06 2015 +0300
Merge pull request #108 from drnlm/python3_doc
Document SQLObject's behaviour with python 3 a bit
http://sourceforge.net/p/sqlobject/sqlobject/ci/e9649a1889252e469a3032838c8653bf495f01f6
commit e9649a1889252e469a3032838c8653bf495f01f6
Author: Neil <drn...@gm...>
Date: Thu Mar 5 11:47:27 2015 +0200
Document SQLObject's behaviour with python 3 a bit
diff --git a/docs/Python3.txt b/docs/Python3.txt
new file mode 100644
index 0000000..c099ec9
--- /dev/null
+++ b/docs/Python3.txt
@@ -0,0 +1,83 @@
+++++++++++++++++++++++
+SQLObject and Python 3
+++++++++++++++++++++++
+
+
+.. contents::
+
+
+Changes between Python 2 and Python 3
+-------------------------------------
+
+There are a few changes in the behaviour of SQLObject on Python 3, due to
+the changed stings / bytes handling introduced in Python 3.0.
+
+BLOBCol
+~~~~~~~
+
+In Python 3, BLOBCol now accepts and returns bytes, rather than strings as it
+did in Python 2.
+
+StringCol
+~~~~~~~~~
+
+In Python 3, StringCol now accepts arbitrary Unicode strings.
+
+UnicodeCol
+~~~~~~~~~~
+
+The dbEncoding parameter to UnicodeCol has no effect in Python 3 code. This
+is now handled by the underlying database layer and is no longer exposed
+via SQLObject. The parameter is still available for those writing Python 2
+compatible code.
+
+
+Python 3 and MySQL
+------------------
+
+SQLObject is tested using mysqlclient_ as the database driver on Python 3.
+Note that the default encoding of MySQL databases is *latin1*, which can cause
+problems with general Unicode strings. We recommend specifying the character
+set as *utf8* when using MySQL to protect against these issues.
+
+.. _mysqlclient: https://pypi.python.org/pypi/mysqlclient
+
+
+Using databases created with SQLObject and Python 2 in Python 3
+---------------------------------------------------------------
+
+For most cases, things should just work as before. The only issues should
+around UnicodeCol, as how this is handled has changed.
+
+SQLite
+~~~~~~
+
+The Python 3 sqlite driver expects Unicode columns to be encoded using
+utf8. Columns created using the default encoding on Python 2 should work fine,
+but columns created with a different encoding set using the dbEncoding
+parameter may cause problems.
+
+Postgres
+~~~~~~~~
+
+Postgres' behaviour is similar to sqlite. Columns created using the
+default encoding on Python 2 should work fine, but columns created with a
+different encoding set using the dbEncoding may cause problems.
+
+MySQL
+~~~~~
+
+For MySQL, the results depend on whether the Python 2 database was using
+MySQLdb's Unicode mode or not.
+
+If a character set was specified for the database using the charset parameter,
+such as::
+
+ mysql:///localhost/test?charset=latin1
+
+Things should work provided the same character set is specified when using
+Python 3.
+
+If a character set wasn't specified, then things may work if the character set
+is set to match the dbEncoding parameter used when defining the UnicodeCol.
+
-----------------------------------------------------------------------
Summary of changes:
docs/Python3.txt | 83 ++++++++++++++++++++++++++++++++++++
sqlobject/mysql/mysqlconnection.py | 14 +-----
2 files changed, 85 insertions(+), 12 deletions(-)
create mode 100644 docs/Python3.txt
hooks/post-receive
--
SQLObject development repository
|