diff --git a/dports/lang/python26/Portfile b/dports/lang/python26/Portfile
index 7015a30..4f075b1 100644
--- a/dports/lang/python26/Portfile
+++ b/dports/lang/python26/Portfile
@@ -7,7 +7,7 @@ PortGroup select 1.0
 name                    python26
 # Remember to keep py26-tkinter and py26-gdbm's versions sync'd with this
 version                 2.6.9
-revision                1
+revision                2
 set major               [lindex [split $version .] 0]
 set branch              [join [lrange [split ${version} .] 0 1] .]
 categories              lang
@@ -45,17 +45,20 @@ patchfiles              patch-Makefile.pre.in.diff \
                         patch-setup.py-db46.diff \
                         patch-Lib-ctypes-macholib-dyld.py.diff \
                         patch-setup.py-disabled_modules.diff \
-                        patch-libedit.diff
+                        patch-libedit.diff \
+                        use-db48.patch
 
 # http://bugs.python.org/issue21811
 patchfiles-append       yosemite-configure-fixes.patch \
                         yosemite-python-fixes.patch
 
 depends_lib             port:gettext port:zlib port:openssl \
-                        port:sqlite3 port:db46 port:ncurses \
+                        port:sqlite3 port:db48 port:ncurses \
                         port:bzip2 port:libedit
 depends_run             port:python_select
 
+configure.cppflags-append   -I${prefix}/include/db48
+configure.ldflags-append    -L${prefix}/lib/db48
 configure.args          --enable-framework=${frameworks_dir} \
                         --enable-ipv6
 configure.ccache        no
diff --git a/dports/lang/python26/files/use-db48.patch b/dports/lang/python26/files/use-db48.patch
new file mode 100644
index 0000000..8eea4fb
--- /dev/null
+++ b/dports/lang/python26/files/use-db48.patch
@@ -0,0 +1,176 @@
+Index: setup.py
+===================================================================
+--- setup.py.orig
++++ setup.py
+@@ -782,7 +782,7 @@ class PyBuildExt(build_ext):
+         # a release.  Most open source OSes come with one or more
+         # versions of BerkeleyDB already installed.
+ 
+-        max_db_ver = (4, 7)
++        max_db_ver = (4, 8)
+         min_db_ver = (3, 3)
+         db_setup_debug = False   # verbose debug prints from this script?
+ 
+Index: Modules/_bsddb.c
+===================================================================
+--- Modules/_bsddb.c.orig
++++ Modules/_bsddb.c
+@@ -1417,6 +1417,62 @@ _db_associateCallback(DB* db, const DBT*
+                 PyErr_Print();
+             }
+         }
++#if (DBVER >= 46)
++        else if (PyList_Check(result))
++        {
++            char* data;
++            Py_ssize_t size;
++            int i, listlen;
++            DBT* dbts;
++
++            listlen = PyList_Size(result);
++
++            dbts = (DBT *)malloc(sizeof(DBT) * listlen);
++
++            for (i=0; i<listlen; i++)
++            {
++                if (!PyBytes_Check(PyList_GetItem(result, i)))
++                {
++                    PyErr_SetString(
++                       PyExc_TypeError,
++#if (PY_VERSION_HEX < 0x03000000)
++"The list returned by DB->associate callback should be a list of strings.");
++#else
++"The list returned by DB->associate callback should be a list of bytes.");
++#endif
++                    PyErr_Print();
++                }
++
++                PyBytes_AsStringAndSize(
++                    PyList_GetItem(result, i),
++                    &data, &size);
++
++                CLEAR_DBT(dbts[i]);
++                dbts[i].data = malloc(size);          /* TODO, check this */
++
++                if (dbts[i].data)
++                {
++                    memcpy(dbts[i].data, data, size);
++                    dbts[i].size = size;
++                    dbts[i].ulen = dbts[i].size;
++                    dbts[i].flags = DB_DBT_APPMALLOC;  /* DB will free */
++                }
++                else
++                {
++                    PyErr_SetString(PyExc_MemoryError,
++                        "malloc failed in _db_associateCallback (list)");
++                    PyErr_Print();
++                }
++            }
++
++            CLEAR_DBT(*secKey);
++
++            secKey->data = dbts;
++            secKey->size = listlen;
++            secKey->flags = DB_DBT_APPMALLOC | DB_DBT_MULTIPLE;
++            retval = 0;
++        }
++#endif
+         else {
+             PyErr_SetString(
+                PyExc_TypeError,
+@@ -4501,7 +4557,11 @@ DBEnv_txn_recover(DBEnvObject* self)
+     DBTxnObject *txn;
+ #define PREPLIST_LEN 16
+     DB_PREPLIST preplist[PREPLIST_LEN];
++#if (DBVER < 48) || (DBVER >= 52)
+     long retp;
++#else
++    u_int32_t retp;
++#endif
+ 
+     CHECK_ENV_NOT_CLOSED(self);
+ 
+@@ -4522,7 +4582,7 @@ DBEnv_txn_recover(DBEnvObject* self)
+         flags=DB_NEXT;  /* Prepare for next loop pass */
+         for (i=0; i<retp; i++) {
+             gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
+-                                DB_XIDDATASIZE);
++                                DB_GID_SIZE);
+             if (!gid) {
+                 Py_DECREF(list);
+                 return NULL;
+@@ -5046,7 +5106,7 @@ DBEnv_set_private(DBEnvObject* self, PyO
+     RETURN_NONE();
+ }
+ 
+-
++#if (DBVER < 48)
+ static PyObject*
+ DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -5068,6 +5128,7 @@ DBEnv_set_rpc_server(DBEnvObject* self, 
+     RETURN_IF_ERR();
+     RETURN_NONE();
+ }
++#endif
+ 
+ static PyObject*
+ DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
+@@ -5949,9 +6010,9 @@ DBTxn_prepare(DBTxnObject* self, PyObjec
+     if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
+         return NULL;
+ 
+-    if (gid_size != DB_XIDDATASIZE) {
++    if (gid_size != DB_GID_SIZE) {
+         PyErr_SetString(PyExc_TypeError,
+-                        "gid must be DB_XIDDATASIZE bytes long");
++                        "gid must be DB_GID_SIZE bytes long");
+         return NULL;
+     }
+ 
+@@ -6541,8 +6602,10 @@ static PyMethodDef DBEnv_methods[] = {
+ #endif
+     {"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none, METH_VARARGS},
+     {"txn_recover",     (PyCFunction)DBEnv_txn_recover,       METH_NOARGS},
++#if (DBVER < 48)
+     {"set_rpc_server",  (PyCFunction)DBEnv_set_rpc_server,
+-        METH_VARARGS||METH_KEYWORDS},
++        METH_VARARGS|METH_KEYWORDS},
++#endif
+     {"set_verbose",     (PyCFunction)DBEnv_set_verbose,       METH_VARARGS},
+ #if (DBVER >= 42)
+     {"get_verbose",     (PyCFunction)DBEnv_get_verbose,       METH_VARARGS},
+@@ -7091,14 +7154,17 @@ PyMODINIT_FUNC  PyInit__bsddb(void)    /
+     ADD_INT(d, DB_MAX_PAGES);
+     ADD_INT(d, DB_MAX_RECORDS);
+ 
+-#if (DBVER >= 42)
++#if (DBVER >= 42) && (DBVER < 48)
+     ADD_INT(d, DB_RPCCLIENT);
+-#else
++#elif (DBVER < 42)
+     ADD_INT(d, DB_CLIENT);
+     /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
+     _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
+ #endif
++
++#if (DBVER < 48)
+     ADD_INT(d, DB_XA_CREATE);
++#endif
+ 
+     ADD_INT(d, DB_CREATE);
+     ADD_INT(d, DB_NOMMAP);
+@@ -7115,7 +7181,13 @@ PyMODINIT_FUNC  PyInit__bsddb(void)    /
+     ADD_INT(d, DB_INIT_TXN);
+     ADD_INT(d, DB_JOINENV);
+ 
++#if (DBVER >= 48)
++    ADD_INT(d, DB_GID_SIZE);
++#else
+     ADD_INT(d, DB_XIDDATASIZE);
++    /* Allow new code to work in old BDB releases */
++    _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
++#endif
+ 
+     ADD_INT(d, DB_RECOVER);
+     ADD_INT(d, DB_RECOVER_FATAL);
