[Python-modules-commits] [python-mysqldb] 01/03: Import python-mysqldb_1.3.7.orig.tar.gz

Brian May bam at moszumanska.debian.org
Thu Nov 5 21:47:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

bam pushed a commit to branch master
in repository python-mysqldb.

commit 42be27eeb9905acf72eb37f43fed07e3d125bc95
Author: Brian May <bam at debian.org>
Date:   Fri Nov 6 08:25:52 2015 +1100

    Import python-mysqldb_1.3.7.orig.tar.gz
---
 HISTORY                            | 531 +++++++++++++++++++------------------
 INSTALL                            |  84 +-----
 MySQLdb/connections.py             |   3 +-
 MySQLdb/cursors.py                 |  72 ++---
 MySQLdb/release.py                 |   4 +-
 MySQLdb/times.py                   |  53 ++--
 PKG-INFO                           |   7 +-
 README.md                          |  31 ++-
 _mysql.c                           |  80 +++---
 metadata.cfg                       |   9 +-
 mysqlclient.egg-info/PKG-INFO      |   7 +-
 mysqlclient.egg-info/SOURCES.txt   |   4 +-
 mysqlclient.egg-info/pbr.json      |   1 -
 setup.cfg                          |   2 +-
 setup_posix.py                     |  27 +-
 tests/configdb.py                  |   5 +-
 tests/test_MySQLdb_capabilities.py |  69 ++++-
 tests/test_MySQLdb_dbapi20.py      | 409 ++++++++++++++--------------
 tests/test_MySQLdb_nonstandard.py  |   3 +-
 tests/test_MySQLdb_times.py        | 121 +++++++++
 20 files changed, 851 insertions(+), 671 deletions(-)

diff --git a/HISTORY b/HISTORY
index 58ff35e..97ffe20 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,255 +1,276 @@
-=====================
- What's new in 1.3.6
-=====================
-
-Fix escape_string() doesn't work.
-
-Remove `Cursor.__del__` to fix uncollectable circular reference on Python 3.3.
-
-Add context manager support to `Cursor`. It automatically closes cursor on `__exit__`.
-
-.. code-block::
-
-    with conn.cursor() as cur:
-        cur.execute("SELECT 1+1")
-        print(cur.fetchone())
-    # cur is now closed
-
-
-=====================
- What's new in 1.3.5
-=====================
-
-Fix TINYBLOB, MEDIUMBLOB and LONGBLOB are treated as string and decoded
-to unicode or cause UnicodeError.
-
-Fix aware datetime is formatted with timezone offset (e.g. "+0900").
-
-
-=====================
- What's new in 1.3.4
-=====================
-
-* Remove compiler warnings.
-* Fix compile error when using libmariadbclient.
-* Fix GIL deadlock while dealloc.
-
-=====================
- What's new in 1.3.3
-=====================
-
-* Fix exception reraising doesn't work.
-
-=====================
- What's new in 1.3.2
-=====================
-
-* Add send_query() and read_query_result() method to low level connection.
-* Add waiter option.
-
-
-=====================
- What's new in 1.3.1
-=====================
-
-This is a first fork of MySQL-python.
-Now named "mysqlclient"
-
-* Support Python 3
-* Add autocommit option
-* Support microsecond in datetime field.
-
-
-=====================
- What's new in 1.2.4
-=====================
-
-final
-=====
-
-No changes.
-
-
-rc 1
-====
-
-Fixed a dangling reference to the old types module.
-
-
-beta 5
-======
-
-Another internal fix for handling remapped character sets.
-
-_mysql.c was broken for the case where read_timeout was *not* available. (Issue #6)
-
-Documentation was converted to sphinx but there is a lot of cleanup left to do.
-
-
-beta 4
-======
-
-Added support for the MySQL read_timeout option. Contributed by
-Jean Schurger (jean at schurger.org).
-
-Added a workaround so that the MySQL character set utf8mb4 works with Python; utf8 is substituted
-on the Python side.
-
-
-beta 3
-======
-
-Unified test database configuration, and set up CI testing with Travis.
-
-Applied several patches from André Malo (ndparker at users.sf.net) which fix some issues
-with exception handling and reference counting and TEXT/BLOB conversion.
-
-
-beta 2
-======
-
-Reverted an accidental change in the exception format. (issue #1)
-
-Reverted some raise statements so that they will continue to work with Python < 2.6
-
-
-beta 1
-======
-
-A lot of work has been done towards Python 3 compatibility, and avoiding warnings with Python 2.7.
-This includes import changes, converting dict.has_kay(k) to k in dict, updating some test suite methods, etc.
-
-Due to the difficulties of supporting Python 3 and Python < 2.7, 1.2.4 will support Python 2.4 though 2.7.
-1.3.0 will support Python 3 and Python 2.7 and 2.6.
-
-MySQLdb-2.0 is instead going to become moist-1.0. See https://github.com/farcepest/moist
-
-The Windows build has been simplified, and I plan to correct pre-built i386 packages built
-against the python.org Python-2.7 package and MySQL Connector/C-6.0. Contact me if you
-need ia64 packages.
-
-The connection's cursorclass (if not default) was being lost on reconnect.
-
-Newer versions of MySQL don't use OpenSSL and therefore don't have HAVE_SSL defined, but they do have
-a different SSL library. Fixed this so SSL support would be enabled in this case.
-
-The regex that looked for SQL INSERT statement and VALUES in cursor.executemany() was made case-insensitive
-again.
-
-
-=====================
- What's new in 1.2.3
-=====================
-
-ez_setup.py has been update to include various fixes that affect the build.
-
-Better Python version and dependency detection as well as eliminate exception
-warnings under Python 2.6.
-
-Eliminated memory leaks related to Unicode and failed connections.
-
-Corrected connection .escape() functionality.
-
-Miscellaneous cleanups and and expanded testing suite to ensure ongoing release
-quality.
-
-=====================
- What's new in 1.2.2
-=====================
-
-The build system has been completely redone and should now build
-on Windows without any patching; uses setuptools.
-
-Added compatibility for Python 2.5, including support for with statement.
-
-connection.ping() now takes an optional boolean argument which can
-enable (or disable) automatic reconnection.
-
-Support returning SET columns as Python sets was removed due to an
-API bug in MySQL; corresponding test removed.
-
-Added a test for single-character CHAR columns.
-
-BLOB columns are now returned as Python strings instead of byte arrays.
-
-BINARY character columns are always returned as Python strings, and not
-unicode.
-
-Fixed a bug introduced in 1.2.1 where the new SHOW WARNINGS support broke
-SSCursor.
-
-Only encode the query (convert to a string) when it is a unicode instance;
-re-encoding encoded strings would break things.
-
-Make a deep copy of conv when connecting, since it can be modified.
-
-Added support for new VARCHAR and BIT column types.
-
-DBAPISet objects were broken, but nobody noticed.
-
-
-========================
- What's new in 1.2.1_p2
-========================
-
-There are some minor build fixes which probably only affect MySQL
-older than 4.0.
-
-If you had MySQL older than 4.1, the new charset and sql_mode
-parameters didn't work right. In fact, it was impossible to create
-a connection due to the charset problem.
-
-If you are using MySQL-4.1 or newer, there is no practical difference
-between 1.2.1 and 1.2.1_p2, and you don't need to upgrade.
-
-
-=====================
- What's new in 1.2.1
-=====================
-
-Switched to Subversion. Was going to do this for 1.3, but a
-SourceForge CVS outage has forced the issue.
-
-Mapped a lot of new 4.1 and 5.0 error codes to Python exceptions
-
-Added an API call for mysql_set_character_set(charset) (MySQL > 5.0.7)
-
-Added an API call for mysql_get_character_set_info() (MySQL > 5.0.10)
-
-Revamped the build system. Edit site.cfg if necessary (probably not
-in most cases)
-
-Python-2.3 is now the minimum version.
-
-Dropped support for mx.Datetime and stringtimes; always uses Python
-datetime module now.
-
-Improved unit tests
-
-New connect() options:
-* charset: sets character set, implies use_unicode
-* sql_mode: sets SQL mode (i.e. ANSI, etc.; see MySQL docs)
-
-When using MySQL-4.1 or newer, enables MULTI_STATEMENTS
-
-When using MySQL-5.0 or newer, enables MULTI_RESULTS
-
-When using MySQL-4.1 or newer, more detailed warning messages
-are produced
-
-SET columns returned as Python Set types; you can pass a Set as
-a parameter to cursor.execute().
-
-Support for the new MySQL-5.0 DECIMAL implementation
-
-Support for Python Decimal type
-
-Some use of weak references internally. Cursors no longer leak
-if you don't close them. Connections still do, unfortunately.
-
-ursor.fetchXXXDict() methods raise DeprecationWarning
-
-cursor.begin() is making a brief reappearence.
-
-cursor.callproc() now works, with some limitations.
-
+=====================
+ What's new in 1.3.7
+=====================
+
+Support link args other than '-L' and '-l' from mysql_config.
+
+Missing value for column without default value cause IntegrityError.  (#33)
+
+Support BIT type. (#38)
+
+More tests for date and time columns. (#41)
+
+Fix calling .execute() method for closed cursor cause TypeError. (#37)
+
+Improve peformance to parse date. (#43)
+
+Support geometry types (#49)
+
+Fix warning while multi statement cause ProgrammingError. (#48)
+
+
+=====================
+ What's new in 1.3.6
+=====================
+
+Fix escape_string() doesn't work.
+
+Remove `Cursor.__del__` to fix uncollectable circular reference on Python 3.3.
+
+Add context manager support to `Cursor`. It automatically closes cursor on `__exit__`.
+
+.. code-block::
+
+    with conn.cursor() as cur:
+        cur.execute("SELECT 1+1")
+        print(cur.fetchone())
+    # cur is now closed
+
+
+=====================
+ What's new in 1.3.5
+=====================
+
+Fix TINYBLOB, MEDIUMBLOB and LONGBLOB are treated as string and decoded
+to unicode or cause UnicodeError.
+
+Fix aware datetime is formatted with timezone offset (e.g. "+0900").
+
+
+=====================
+ What's new in 1.3.4
+=====================
+
+* Remove compiler warnings.
+* Fix compile error when using libmariadbclient.
+* Fix GIL deadlock while dealloc.
+
+=====================
+ What's new in 1.3.3
+=====================
+
+* Fix exception reraising doesn't work.
+
+=====================
+ What's new in 1.3.2
+=====================
+
+* Add send_query() and read_query_result() method to low level connection.
+* Add waiter option.
+
+
+=====================
+ What's new in 1.3.1
+=====================
+
+This is a first fork of MySQL-python.
+Now named "mysqlclient"
+
+* Support Python 3
+* Add autocommit option
+* Support microsecond in datetime field.
+
+
+=====================
+ What's new in 1.2.4
+=====================
+
+final
+=====
+
+No changes.
+
+
+rc 1
+====
+
+Fixed a dangling reference to the old types module.
+
+
+beta 5
+======
+
+Another internal fix for handling remapped character sets.
+
+_mysql.c was broken for the case where read_timeout was *not* available. (Issue #6)
+
+Documentation was converted to sphinx but there is a lot of cleanup left to do.
+
+
+beta 4
+======
+
+Added support for the MySQL read_timeout option. Contributed by
+Jean Schurger (jean at schurger.org).
+
+Added a workaround so that the MySQL character set utf8mb4 works with Python; utf8 is substituted
+on the Python side.
+
+
+beta 3
+======
+
+Unified test database configuration, and set up CI testing with Travis.
+
+Applied several patches from André Malo (ndparker at users.sf.net) which fix some issues
+with exception handling and reference counting and TEXT/BLOB conversion.
+
+
+beta 2
+======
+
+Reverted an accidental change in the exception format. (issue #1)
+
+Reverted some raise statements so that they will continue to work with Python < 2.6
+
+
+beta 1
+======
+
+A lot of work has been done towards Python 3 compatibility, and avoiding warnings with Python 2.7.
+This includes import changes, converting dict.has_kay(k) to k in dict, updating some test suite methods, etc.
+
+Due to the difficulties of supporting Python 3 and Python < 2.7, 1.2.4 will support Python 2.4 though 2.7.
+1.3.0 will support Python 3 and Python 2.7 and 2.6.
+
+MySQLdb-2.0 is instead going to become moist-1.0. See https://github.com/farcepest/moist
+
+The Windows build has been simplified, and I plan to correct pre-built i386 packages built
+against the python.org Python-2.7 package and MySQL Connector/C-6.0. Contact me if you
+need ia64 packages.
+
+The connection's cursorclass (if not default) was being lost on reconnect.
+
+Newer versions of MySQL don't use OpenSSL and therefore don't have HAVE_SSL defined, but they do have
+a different SSL library. Fixed this so SSL support would be enabled in this case.
+
+The regex that looked for SQL INSERT statement and VALUES in cursor.executemany() was made case-insensitive
+again.
+
+
+=====================
+ What's new in 1.2.3
+=====================
+
+ez_setup.py has been update to include various fixes that affect the build.
+
+Better Python version and dependency detection as well as eliminate exception
+warnings under Python 2.6.
+
+Eliminated memory leaks related to Unicode and failed connections.
+
+Corrected connection .escape() functionality.
+
+Miscellaneous cleanups and and expanded testing suite to ensure ongoing release
+quality.
+
+=====================
+ What's new in 1.2.2
+=====================
+
+The build system has been completely redone and should now build
+on Windows without any patching; uses setuptools.
+
+Added compatibility for Python 2.5, including support for with statement.
+
+connection.ping() now takes an optional boolean argument which can
+enable (or disable) automatic reconnection.
+
+Support returning SET columns as Python sets was removed due to an
+API bug in MySQL; corresponding test removed.
+
+Added a test for single-character CHAR columns.
+
+BLOB columns are now returned as Python strings instead of byte arrays.
+
+BINARY character columns are always returned as Python strings, and not
+unicode.
+
+Fixed a bug introduced in 1.2.1 where the new SHOW WARNINGS support broke
+SSCursor.
+
+Only encode the query (convert to a string) when it is a unicode instance;
+re-encoding encoded strings would break things.
+
+Make a deep copy of conv when connecting, since it can be modified.
+
+Added support for new VARCHAR and BIT column types.
+
+DBAPISet objects were broken, but nobody noticed.
+
+
+========================
+ What's new in 1.2.1_p2
+========================
+
+There are some minor build fixes which probably only affect MySQL
+older than 4.0.
+
+If you had MySQL older than 4.1, the new charset and sql_mode
+parameters didn't work right. In fact, it was impossible to create
+a connection due to the charset problem.
+
+If you are using MySQL-4.1 or newer, there is no practical difference
+between 1.2.1 and 1.2.1_p2, and you don't need to upgrade.
+
+
+=====================
+ What's new in 1.2.1
+=====================
+
+Switched to Subversion. Was going to do this for 1.3, but a
+SourceForge CVS outage has forced the issue.
+
+Mapped a lot of new 4.1 and 5.0 error codes to Python exceptions
+
+Added an API call for mysql_set_character_set(charset) (MySQL > 5.0.7)
+
+Added an API call for mysql_get_character_set_info() (MySQL > 5.0.10)
+
+Revamped the build system. Edit site.cfg if necessary (probably not
+in most cases)
+
+Python-2.3 is now the minimum version.
+
+Dropped support for mx.Datetime and stringtimes; always uses Python
+datetime module now.
+
+Improved unit tests
+
+New connect() options:
+* charset: sets character set, implies use_unicode
+* sql_mode: sets SQL mode (i.e. ANSI, etc.; see MySQL docs)
+
+When using MySQL-4.1 or newer, enables MULTI_STATEMENTS
+
+When using MySQL-5.0 or newer, enables MULTI_RESULTS
+
+When using MySQL-4.1 or newer, more detailed warning messages
+are produced
+
+SET columns returned as Python Set types; you can pass a Set as
+a parameter to cursor.execute().
+
+Support for the new MySQL-5.0 DECIMAL implementation
+
+Support for Python Decimal type
+
+Some use of weak references internally. Cursors no longer leak
+if you don't close them. Connections still do, unfortunately.
+
+ursor.fetchXXXDict() methods raise DeprecationWarning
+
+cursor.begin() is making a brief reappearence.
+
+cursor.callproc() now works, with some limitations.
+
diff --git a/INSTALL b/INSTALL
index f44b410..9caf5bc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -8,57 +8,25 @@ MySQLdb Installation
 Prerequisites
 -------------
 
-+ Python 2.3.4 or higher
++ Python 2.6, 2.7, 3.3 or higher
 
   * http://www.python.org/
 
-  * Versions lower than 2.3 WON'T WORK.
-
-  * 2.4 is the primary test environment.
-
-  * Red Hat Linux:
-
-    - Make sure you have the Python development headers and libraries
-      (python-devel).
-
 + setuptools
 
   * http://pypi.python.org/pypi/setuptools
 
-+ MySQL 3.23.32 or higher
++ MySQL 5.0 or higher
 
   * http://www.mysql.com/downloads/
 
-  * Versions lower than 3.22 definitely WON'T WORK.
-
-  * Versions lower than 3.22.19 might not work.
-
-  * MySQL-3.22 might work but isn't supported anymore. It's very old.
-
-  * MySQL-3.23 ought to work, but it's pretty elderly.
-
-  * MySQL-4.0 is supported, but not tested and slightly discouraged.
-
-  * MySQL-4.1 is supported. The prepared statements API is not
-    supported, and won't be until MySQLdb-1.3 or 2.0, if ever.
+  * MySQL-4.0 and MySQL-4.1 may work, but not supported.
 
   * MySQL-5.0 is supported and tested, including stored procedures.
 
   * MySQL-5.1 is supported (currently a release candidate) but untested.
     It should work.
 
-  * MySQL-6.0 is sorta-kinda-supported (currently alpha) but untested.
-    It should work.
-
-  * Drizzle <https://launchpad.net/drizzle> is a fork of MySQL. So far
-    the C API looks really similar except everything is renamed.
-    Drizzle support probably won't happen in 1.2. There may be have to
-    be an entirely different module, but still using DB-API.
-
-  * MaxDB, formerly known as SAP DB (and maybe Adabas D?), is a
-    completely different animal. Use the sapdb.sql module that comes
-    with MaxDB.
-
   * Red Hat Linux packages:
 
     - mysql-devel to compile
@@ -75,27 +43,6 @@ Prerequisites
 
     - MySQL-shared to run if you compiled with MySQL-shared installed
 
-  * Transactions (particularly InnoDB tables) are supported for
-    MySQL-3.23 and up. You may need a special package from your vendor
-    with this support turned on.
-
-+  zlib
-
-   * Required for MySQL-3.23 and newer.
-
-   * Red Hat Linux
-
-     - zlib-devel to compile
-
-     - zlib to run
-
-+ openssl
-
-  * May be needed for MySQL-4.0 or newer, depending on compilation
-    options. If you need it, you probably already have it.
-
-    - you may need openssl-devel on some platforms
-
 + C compiler
 
   * Most free software-based systems already have this, usually gcc.
@@ -103,10 +50,8 @@ Prerequisites
   * Most commercial UNIX platforms also come with a C compiler, or
     you can also use gcc.
 
-  * If you have some Windows flavor, you usually have to pay extra
-    for this, or you can use Cygwin_.
-
-.. _Cygwin: http://www.cygwin.com/
+  * If you have some Windows flavor, you should use Windows SDK or
+    Visual C++.
 
 
 Building and installing
@@ -134,12 +79,18 @@ edit the [options] section of site.cfg:
         if True, try to link against a static library; otherwise link
 	against dynamic libraries (default). You may need static linking
 	to use the embedded server.
+        This option doesn't work for MySQL>5.6 since libmysqlclient
+        requires libstdc++. If you want to use, add `-lstdc++` to
+        mysql_config manually.
 
+If `<mysql prefix>/lib` is not added to `/etc/ld.so.conf`, `import _mysql`
+doesn't work. To fix this, (1) set `LD_LIBRARY_PATH`, or (2) add
+`-Wl,-rpath,<mysql prefix>/lib` to ldflags in your mysql_config.
 
 Finally, putting it together::
 
-  $ tar xfz MySQL-python-1.2.1.tar.gz
-  $ cd MySQL-python-1.2.1
+  $ tar xz mysqlclient-1.3.6.tar.gz
+  $ cd mysqlclient-1.3.6
   $ # edit site.cfg if necessary
   $ python setup.py build
   $ sudo python setup.py install # or su first
@@ -168,15 +119,6 @@ On Windows, you will definitely have to edit site.cfg since there is
 no mysql_config in the MySQL package.
 
 
-Zope
-....
-
-If you are using a binary package of Zope, you need run setup.py with
-the python executable that came with Zope. Otherwise, you'll install
-into the wrong Python tree and Zope (ZMySQLDA) will not be able to
-find _mysql.
-
-
 Binary Packages
 ---------------
 
diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py
index a84896e..7ac040b 100644
--- a/MySQLdb/connections.py
+++ b/MySQLdb/connections.py
@@ -325,10 +325,9 @@ class Connection(_mysql.connection):
         def warning_count(self):
             """Return the number of warnings generated from the
             last query. This is derived from the info() method."""
-            from string import atoi
             info = self.info()
             if info:
-                return atoi(info.split()[-1])
+                return int(info.split()[-1])
             else:
                 return 0
 
diff --git a/MySQLdb/cursors.py b/MySQLdb/cursors.py
index d177f20..e2d74af 100644
--- a/MySQLdb/cursors.py
+++ b/MySQLdb/cursors.py
@@ -21,7 +21,7 @@ restr = r"""
             (?:
                 (?:
                         (?:\(
-                            # ( - editor hightlighting helper
+                            # ( - editor highlighting helper
                             .*
                         \))
                     |
@@ -109,6 +109,14 @@ class BaseCursor(object):
     def _warning_check(self):
         from warnings import warn
         if self._warnings:
+            # When there is next result, fetching warnings cause "command
+            # out of sync" error.
+            if self._result and self._result.has_next:
+                msg = "There are %d MySQL warnings." % (self._warnings,)
+                self.messages.append(msg)
+                warn(msg, self.Warning, 3)
+                return
+
             warnings = self._get_db().show_warnings()
             if warnings:
                 # This is done in two loops in case
@@ -163,7 +171,7 @@ class BaseCursor(object):
         if con is not None:
             con = con()
         if con is None:
-            self.errorhandler(self, ProgrammingError, "cursor closed")
+            raise ProgrammingError("cursor closed")
         return con
     
     def execute(self, query, args=None):
@@ -204,36 +212,34 @@ class BaseCursor(object):
         if isinstance(query, unicode):
             query = query.encode(db.unicode_literal.charset, 'surrogateescape')
 
+        res = None
         try:
-            r = None
-            r = self._query(query)
+            res = self._query(query)
         except TypeError as m:
             if m.args[0] in ("not enough arguments for format string",
                              "not all arguments converted"):
                 self.errorhandler(self, ProgrammingError, m.args[0])
             else:
                 self.errorhandler(self, TypeError, m)
-        except (SystemExit, KeyboardInterrupt):
-            raise
-        except:
+        except Exception:
             exc, value = sys.exc_info()[:2]
             self.errorhandler(self, exc, value)
         self._executed = query
         if not self._defer_warnings: self._warning_check()
-        return r
+        return res
 
     def executemany(self, query, args):
         """Execute a multi-row query.
-        
+
         query -- string, query to execute on server
 
         args
 
             Sequence of sequences or mappings, parameters to use with
             query.
-            
+
         Returns long integer rows affected, if any.
-        
+
         This method improves performance on multiple-row INSERT and
         REPLACE. Otherwise it is equivalent to looping over args with
         execute().
@@ -279,11 +285,10 @@ class BaseCursor(object):
         r = self._query(qs)
         if not self._defer_warnings: self._warning_check()
         return r
-    
-    def callproc(self, procname, args=()):
 
+    def callproc(self, procname, args=()):
         """Execute stored procedure procname with args
-        
+
         procname -- string, name of procedure to execute on server
 
         args -- Sequence of parameters to use with procedure
@@ -318,7 +323,7 @@ class BaseCursor(object):
                 q = q.encode(db.unicode_literal.charset)
             self._query(q)
             self.nextset()
-            
+
         q = "CALL %s(%s)" % (procname,
                              ','.join(['@_%s_%d' % (procname, i)
                                        for i in range(len(args))]))
@@ -326,9 +331,10 @@ class BaseCursor(object):
             q = q.encode(db.unicode_literal.charset)
         self._query(q)
         self._executed = q
-        if not self._defer_warnings: self._warning_check()
+        if not self._defer_warnings:
+            self._warning_check()
         return args
-    
+
     def _do_query(self, q):
         db = self._get_db()
         self._last_executed = q
@@ -336,8 +342,9 @@ class BaseCursor(object):
         self._do_get_result()
         return self.rowcount
 
-    def _query(self, q): return self._do_query(q)
-    
+    def _query(self, q):
+        return self._do_query(q)
+
     def _fetch_row(self, size=1):
         if not self._result:
             return ()
@@ -356,7 +363,7 @@ class BaseCursor(object):
     InternalError = InternalError
     ProgrammingError = ProgrammingError
     NotSupportedError = NotSupportedError
-   
+
 
 class CursorStoreResultMixIn(object):
 
@@ -403,11 +410,11 @@ class CursorStoreResultMixIn(object):
             result = self._rows
         self.rownumber = len(self._rows)
         return result
-    
+
     def scroll(self, value, mode='relative'):
         """Scroll the cursor in the result set to a new position according
         to mode.
-        
+
         If mode is 'relative' (default), value is taken as offset to
         the current position in the result set, if set to 'absolute',
         value states an absolute target position."""
@@ -427,7 +434,7 @@ class CursorStoreResultMixIn(object):
         self._check_executed()
         result = self.rownumber and self._rows[self.rownumber:] or self._rows
         return iter(result)
-    
+
 
 class CursorUseResultMixIn(object):
 
@@ -438,7 +445,7 @@ class CursorUseResultMixIn(object):
     the connection."""
 
     _defer_warnings = True
-    
+
     def _get_result(self): return self._get_db().use_result()
 
     def fetchone(self):
@@ -450,7 +457,7 @@ class CursorUseResultMixIn(object):
             return None
         self.rownumber = self.rownumber + 1
         return r[0]
-             
+
     def fetchmany(self, size=None):
         """Fetch up to size rows from the cursor. Result set may be smaller
         than size. If size is not defined, cursor.arraysize is used."""
@@ -460,7 +467,7 @@ class CursorUseResultMixIn(object):
         if not r:
             self._warning_check()
         return r
-         
+
     def fetchall(self):
         """Fetchs all available rows from the cursor."""
         self._check_executed()
@@ -477,10 +484,11 @@ class CursorUseResultMixIn(object):
         if row is None:
             raise StopIteration
         return row
-    
 
-class CursorTupleRowsMixIn(object):
+    __next__ = next
+
 
+class CursorTupleRowsMixIn(object):
     """This is a MixIn class that causes all rows to be returned as tuples,
     which is the standard form required by DB API."""
 
@@ -488,7 +496,6 @@ class CursorTupleRowsMixIn(object):
 
 
 class CursorDictRowsMixIn(object):
-
     """This is a MixIn class that causes all rows to be returned as
     dictionaries. This is a non-standard feature."""
 
@@ -520,7 +527,6 @@ class CursorDictRowsMixIn(object):
 
 
 class CursorOldDictRowsMixIn(CursorDictRowsMixIn):
-
     """This is a MixIn class that returns rows as dictionaries with
     the same key convention as the old Mysqldb (MySQLmodule). Don't
     use this."""
@@ -530,28 +536,24 @@ class CursorOldDictRowsMixIn(CursorDictRowsMixIn):
 
 class Cursor(CursorStoreResultMixIn, CursorTupleRowsMixIn,
              BaseCursor):
-
     """This is the standard Cursor class that returns rows as tuples
     and stores the result set in the client."""
 
 
 class DictCursor(CursorStoreResultMixIn, CursorDictRowsMixIn,
                  BaseCursor):
-
      """This is a Cursor class that returns rows as dictionaries and
     stores the result set in the client."""
-   
+
 
 class SSCursor(CursorUseResultMixIn, CursorTupleRowsMixIn,
                BaseCursor):
-
     """This is a Cursor class that returns rows as tuples and stores
     the result set in the server."""
 
 
 class SSDictCursor(CursorUseResultMixIn, CursorDictRowsMixIn,
                    BaseCursor):
-
     """This is a Cursor class that returns rows as dictionaries and
     stores the result set in the server."""
 
diff --git a/MySQLdb/release.py b/MySQLdb/release.py
index 5e2c51c..1fdb447 100644
--- a/MySQLdb/release.py
+++ b/MySQLdb/release.py
@@ -1,4 +1,4 @@
 
 __author__ = "Andy Dustman <farcepest at gmail.com>"
-version_info = (1,3,6,'final',1)
-__version__ = "1.3.6"
+version_info = (1,3,7,'final',1)
+__version__ = "1.3.7"
diff --git a/MySQLdb/times.py b/MySQLdb/times.py
index f28c7a6..e26f886 100644
--- a/MySQLdb/times.py
+++ b/MySQLdb/times.py
@@ -48,25 +48,32 @@ def format_TIMESTAMP(d):
 
 
 def DateTime_or_None(s):
-    if ' ' in s:
-        sep = ' '
-    elif 'T' in s:
-        sep = 'T'
-    else:
-        return Date_or_None(s)
-
     try:
-        d, t = s.split(sep, 1)
-        if '.' in t:
... 1324 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mysqldb.git



More information about the Python-modules-commits mailing list