Skip to content

Commit 73c4296

Browse files
authored
Merge branch 'master' into feature/add_ssl_mode
2 parents 53e19a7 + 8fd628e commit 73c4296

25 files changed

+283
-299
lines changed

.travis.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ language: python
44
# See aws s3 ls s3://travis-python-archives/binaries/ubuntu/16.04/x86_64/
55
python:
66
- "nightly"
7-
- "pypy3.5"
8-
- "pypy2.7-5.10.0"
7+
- "pypy3"
8+
- "3.8"
99
- "3.7"
1010
- "3.6"
1111
- "3.5"
12-
- "2.7"
1312

1413
cache: pip
1514

@@ -38,14 +37,17 @@ after_success:
3837

3938
matrix:
4039
include:
41-
- &django_py27
42-
python: "2.7"
40+
- &django_2_2
41+
name: "Django 2.2 test"
42+
env:
43+
- DJANGO_VERSION=2.2.7
44+
python: "3.5"
4345
install:
4446
- pip install -U pip
45-
- wget https://github.com/django/django/archive/1.11.18.tar.gz
46-
- tar xf 1.11.18.tar.gz
47-
- pip install django-1.11.18/
48-
- cp ci/test_mysql.py django-1.11.18/tests/
47+
- wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz
48+
- tar xf ${DJANGO_VERSION}.tar.gz
49+
- pip install -e django-${DJANGO_VERSION}/
50+
- cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/
4951
- pip install .
5052

5153
before_script:
@@ -54,11 +56,12 @@ matrix:
5456
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql
5557

5658
script:
57-
- cd django-1.11.18/tests/
59+
- cd django-${DJANGO_VERSION}/tests/
5860
- ./runtests.py --parallel=1 --settings=test_mysql
5961

60-
- &django_py3
61-
<<: *django_py27
62-
python: "3.7"
62+
#- &django_3_0
63+
# <<: *django_2_2
64+
# name: "Django 3.0 test (Python 3.8)"
65+
# python: "3.8"
6366

6467
# vim: sw=2 ts=2 sts=2

HISTORY.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
======================
2+
What's new in 1.4.6
3+
======================
4+
5+
Release: 2019-11-21
6+
7+
* The ``cp1252`` encoding is used when charset is "latin1". (#390)
8+
9+
======================
10+
What's new in 1.4.5
11+
======================
12+
13+
Release: 2019-11-06
14+
15+
* The ``auth_plugin`` option is added. (#389)
16+
17+
18+
======================
19+
What's new in 1.4.4
20+
======================
21+
22+
Release: 2019-08-12
23+
24+
* ``charset`` option is passed to ``mysql_options(mysql, MYSQL_SET_CHARSET_NAME, charset)``
25+
before ``mysql_real_connect`` is called.
26+
This avoid extra ``SET NAMES <charset>`` query when creating connection.
27+
28+
29+
======================
30+
What's new in 1.4.3
31+
======================
32+
33+
Release: 2019-08-09
34+
35+
* ``--static`` build supports ``libmariadbclient.a``
36+
* Try ``mariadb_config`` when ``mysql_config`` is not found
37+
* Fixed warning happend in Python 3.8 (#359)
38+
* Fixed ``from MySQLdb import *``, while I don't recommend it. (#369)
39+
* Fixed SEGV ``MySQLdb.escape_string("1")`` when libmariadb is used and
40+
no connection is created. (#367)
41+
* Fixed many circular references are created in ``Cursor.executemany()``. (#375)
42+
43+
144
======================
245
What's new in 1.4.2
346
======================

INSTALL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MySQLdb Installation
88
Prerequisites
99
-------------
1010

11-
+ Python 2.7, 3.5 or higher
11+
+ Python 3.5 or higher
1212

1313
+ setuptools
1414

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
build:
33
python3 setup.py build_ext -if
44

5+
.PHONY: doc
6+
doc:
7+
pip install .
8+
pip install sphinx
9+
cd doc && make html
510

611
.PHONY: clean
712
clean:

MySQLdb/__init__.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818
from . import _mysql
1919

2020
if version_info != _mysql.version_info:
21-
raise ImportError("this is MySQLdb version %s, but _mysql is version %r" %
22-
(version_info, _mysql.version_info))
21+
raise ImportError("this is MySQLdb version %s, but _mysql is version %r\n_mysql: %r" %
22+
(version_info, _mysql.version_info, _mysql.__file__))
2323

2424
threadsafety = 1
2525
apilevel = "2.0"
2626
paramstyle = "format"
2727

2828
from ._mysql import *
29-
from MySQLdb.compat import PY2
3029
from MySQLdb.constants import FIELD_TYPE, SSL_MODE
3130
from MySQLdb.times import Date, Time, Timestamp, \
3231
DateFromTicks, TimeFromTicks, TimestampFromTicks
@@ -71,12 +70,8 @@ def test_DBAPISet_set_equality_membership():
7170
def test_DBAPISet_set_inequality_membership():
7271
assert FIELD_TYPE.DATE != STRING
7372

74-
if PY2:
75-
def Binary(x):
76-
return bytearray(x)
77-
else:
78-
def Binary(x):
79-
return bytes(x)
73+
def Binary(x):
74+
return bytes(x)
8075

8176
def Connect(*args, **kwargs):
8277
"""Factory function for connections.Connection."""
@@ -89,7 +84,7 @@ def Connect(*args, **kwargs):
8984
'Date', 'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks',
9085
'TimestampFromTicks', 'DataError', 'DatabaseError', 'Error',
9186
'FIELD_TYPE', 'IntegrityError', 'InterfaceError', 'InternalError',
92-
'MySQLError', 'NULL', 'NUMBER', 'NotSupportedError', 'DBAPISet',
87+
'MySQLError', 'NUMBER', 'NotSupportedError', 'DBAPISet',
9388
'OperationalError', 'ProgrammingError', 'ROWID', 'STRING', 'TIME',
9489
'TIMESTAMP', 'Warning', 'apilevel', 'connect', 'connections',
9590
'constants', 'converters', 'cursors', 'debug', 'escape',

MySQLdb/_exceptions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
55
https://www.python.org/dev/peps/pep-0249/
66
"""
7-
from .compat import StandardError
87

9-
10-
class MySQLError(StandardError):
8+
class MySQLError(Exception):
119
"""Exception related to operation with MySQL."""
1210

1311

0 commit comments

Comments
 (0)