changeset 6103:500f68d3e2fd

remove our own usage of python_compatibility module
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 01:00:25 +0200
parents df21062e294d
children 68f8bea727e5
files MoinMoin/PageEditor.py MoinMoin/action/SyncPages.py MoinMoin/action/__init__.py MoinMoin/action/cache.py MoinMoin/action/info.py MoinMoin/action/serveopenid.py MoinMoin/config/_tests/test_multiconfig.py MoinMoin/config/multiconfig.py MoinMoin/conftest.py MoinMoin/events/emailnotify.py MoinMoin/events/jabbernotify.py MoinMoin/formatter/text_html.py MoinMoin/macro/AdvancedSearch.py MoinMoin/macro/FootNote.py MoinMoin/parser/_ParserBase.py MoinMoin/parser/highlight.py MoinMoin/parser/text_moin_wiki.py MoinMoin/script/maint/mkpagepacks.py MoinMoin/script/migration/_conv160_wiki.py MoinMoin/script/migration/_conv160a_wiki.py MoinMoin/script/migration/text_moin158_wiki.py MoinMoin/script/migration/text_moin160a_wiki.py MoinMoin/script/migration/wikiutil160a.py MoinMoin/security/antispam.py MoinMoin/security/textcha.py MoinMoin/user.py MoinMoin/userprefs/oid.py MoinMoin/util/moinoid.py MoinMoin/util/thread_monitor.py MoinMoin/wikiutil.py jabberbot/capat.py
diffstat 31 files changed, 43 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/PageEditor.py	Tue Sep 06 01:00:25 2016 +0200
@@ -25,7 +25,6 @@
 from MoinMoin.widget.dialog import Status
 from MoinMoin.logfile import editlog, eventlog
 from MoinMoin.mail.sendmail import encodeSpamSafeEmail
-from MoinMoin.support.python_compatibility import set
 from MoinMoin.util import filesys, timefuncs, web
 from MoinMoin.util.abuse import log_attempt
 from MoinMoin.events import PageDeletedEvent, PageRenamedEvent, PageCopiedEvent, PageRevertedEvent
--- a/MoinMoin/action/SyncPages.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/action/SyncPages.py	Tue Sep 06 01:00:25 2016 +0200
@@ -19,7 +19,6 @@
 from MoinMoin.Page import Page
 from MoinMoin.wikisync import TagStore, UnsupportedWikiException, SyncPage, NotAllowedException
 from MoinMoin.wikisync import MoinLocalWiki, MoinRemoteWiki, UP, DOWN, BOTH, MIMETYPE_MOIN
-from MoinMoin.support.python_compatibility import set
 from MoinMoin.util.bdiff import decompress, patch, compress, textdiff
 from MoinMoin.util import diff3, rpc_aggregator
 
--- a/MoinMoin/action/__init__.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/action/__init__.py	Tue Sep 06 01:00:25 2016 +0200
@@ -32,7 +32,6 @@
 from MoinMoin.util import pysupport
 from MoinMoin import config, wikiutil
 from MoinMoin.Page import Page
-from MoinMoin.support.python_compatibility import set
 
 # create a list of extension actions from the package directory
 modules = pysupport.getPackageModules(__file__)
--- a/MoinMoin/action/cache.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/action/cache.py	Tue Sep 06 01:00:25 2016 +0200
@@ -28,6 +28,7 @@
 """
 
 from datetime import datetime
+import hmac
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -39,7 +40,6 @@
 from MoinMoin import config, caching
 from MoinMoin.util import filesys
 from MoinMoin.action import AttachFile
-from MoinMoin.support.python_compatibility import hmac_new
 
 action_name = __name__.split('.')[-1]
 
@@ -99,7 +99,7 @@
         raise AssertionError('cache_key called with unsupported parameters')
 
     hmac_data = hmac_data.encode('utf-8')
-    key = hmac_new(secret, hmac_data).hexdigest()
+    key = hmac.new(secret, hmac_data).hexdigest()
     return key
 
 
--- a/MoinMoin/action/info.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/action/info.py	Tue Sep 06 01:00:25 2016 +0200
@@ -8,6 +8,7 @@
                 2006-2008 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
+import hashlib
 
 from MoinMoin import config, wikiutil, action
 from MoinMoin.Page import Page
@@ -33,8 +34,7 @@
                       f.text(_("Page size: %d") % page.size()),
                       f.paragraph(0))
 
-        from MoinMoin.support.python_compatibility import hash_new
-        digest = hash_new('sha1', page.get_raw_body().encode(config.charset)).hexdigest().upper()
+        digest = hashlib.new('sha1', page.get_raw_body().encode(config.charset)).hexdigest().upper()
         request.write(f.paragraph(1),
                       f.rawHTML('%(label)s <tt>%(value)s</tt>' % {
                           'label': _("SHA digest of this page's content is:"),
--- a/MoinMoin/action/serveopenid.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/action/serveopenid.py	Tue Sep 06 01:00:25 2016 +0200
@@ -8,7 +8,6 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from MoinMoin.support.python_compatibility import rsplit
 from MoinMoin.util.moinoid import MoinOpenIDStore, strbase64
 from MoinMoin import wikiutil
 from openid.consumer.discover import OPENID_1_0_TYPE, \
@@ -117,7 +116,7 @@
 
         # we can very well split on the last slash since usernames
         # must not contain slashes
-        base, received_name = rsplit(identity, '/', 1)
+        base, received_name = identity.rsplit('/', 1)
         check_name = received_name
 
         if received_name == '':
--- a/MoinMoin/config/_tests/test_multiconfig.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/config/_tests/test_multiconfig.py	Tue Sep 06 01:00:25 2016 +0200
@@ -7,7 +7,6 @@
 """
 
 import py
-from MoinMoin.support.python_compatibility import set
 
 
 class TestPasswordChecker:
--- a/MoinMoin/config/multiconfig.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/config/multiconfig.py	Tue Sep 06 01:00:25 2016 +0200
@@ -8,6 +8,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
+import hashlib
 import re
 import os
 import sys
@@ -27,7 +28,6 @@
 import MoinMoin.web.session
 from MoinMoin.packages import packLine
 from MoinMoin.security import AccessControlList
-from MoinMoin.support.python_compatibility import set
 
 _url_re_cache = None
 _farmconfig_mtime = None
@@ -626,7 +626,6 @@
         plugin packages as "moin_plugin_<sha1(path)>.plugin".
         """
         import imp
-        from MoinMoin.support.python_compatibility import hash_new
 
         plugin_dirs = [self.plugin_dir] + self.plugin_dirs
         self._plugin_modules = []
@@ -636,7 +635,7 @@
             imp.acquire_lock()
             try:
                 for pdir in plugin_dirs:
-                    csum = 'p_%s' % hash_new('sha1', pdir).hexdigest()
+                    csum = 'p_%s' % hashlib.new('sha1', pdir).hexdigest()
                     modname = '%s.%s' % (self.siteid, csum)
                     # If the module is not loaded, try to load it
                     if not modname in sys.modules:
--- a/MoinMoin/conftest.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/conftest.py	Tue Sep 06 01:00:25 2016 +0200
@@ -29,7 +29,6 @@
 moindir = rootdir.join("..")
 sys.path.insert(0, str(moindir))
 
-from MoinMoin.support.python_compatibility import set
 from MoinMoin.web.request import TestRequest, Client
 from MoinMoin.wsgiapp import Application, init
 from MoinMoin._tests import maketestwiki, wikiconfig
--- a/MoinMoin/events/emailnotify.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/events/emailnotify.py	Tue Sep 06 01:00:25 2016 +0200
@@ -12,7 +12,6 @@
 from MoinMoin import user
 from MoinMoin.Page import Page
 from MoinMoin.mail import sendmail
-from MoinMoin.support.python_compatibility import set
 from MoinMoin.user import User, superusers
 from MoinMoin.action.AttachFile import getAttachUrl
 
--- a/MoinMoin/events/jabbernotify.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/events/jabbernotify.py	Tue Sep 06 01:00:25 2016 +0200
@@ -15,7 +15,6 @@
 
 from MoinMoin.Page import Page
 from MoinMoin.user import User, superusers
-from MoinMoin.support.python_compatibility import set
 from MoinMoin.action.AttachFile import getAttachUrl
 
 import MoinMoin.events.notification as notification
--- a/MoinMoin/formatter/text_html.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/formatter/text_html.py	Tue Sep 06 01:00:25 2016 +0200
@@ -14,7 +14,6 @@
 from MoinMoin import wikiutil, i18n
 from MoinMoin.Page import Page
 from MoinMoin.action import AttachFile
-from MoinMoin.support.python_compatibility import set
 
 # insert IDs into output wherever they occur
 # warning: breaks toggle line numbers javascript
--- a/MoinMoin/macro/AdvancedSearch.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/macro/AdvancedSearch.py	Tue Sep 06 01:00:25 2016 +0200
@@ -13,7 +13,6 @@
 from MoinMoin.i18n import languages
 from MoinMoin.widget import html
 from MoinMoin.util.web import makeSelection
-from MoinMoin.support.python_compatibility import sorted
 import mimetypes
 
 Dependencies = ['pages']
--- a/MoinMoin/macro/FootNote.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/macro/FootNote.py	Tue Sep 06 01:00:25 2016 +0200
@@ -9,10 +9,10 @@
                 2007 Johannes Berg
     @license: GNU GPL, see COPYING for details.
 """
+import hashlib
 
 from MoinMoin import config, wikiutil
 from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
-from MoinMoin.support.python_compatibility import hash_new
 
 Dependencies = ["time"] # footnote macro cannot be cached
 
@@ -33,7 +33,7 @@
         idx = request.footnote_ctr
         request.footnote_ctr += 1
 
-        shahex = hash_new('sha1', args.encode(config.charset)).hexdigest()
+        shahex = hashlib.new('sha1', args.encode(config.charset)).hexdigest()
         backlink_id = "fndef-%s-%d" % (shahex, idx)
         fwdlink_id = "fnref-%s" % shahex
 
--- a/MoinMoin/parser/_ParserBase.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/parser/_ParserBase.py	Tue Sep 06 01:00:25 2016 +0200
@@ -24,13 +24,13 @@
 
 """
 
+import hashlib
 import re
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
 from MoinMoin import config, wikiutil
-from MoinMoin.support.python_compatibility import hash_new
 from MoinMoin.parser import parse_start_step
 
 
@@ -220,7 +220,7 @@
 
         result = [] # collects output
 
-        self._code_id = hash_new('sha1', self.raw.encode(config.charset)).hexdigest()
+        self._code_id = hashlib.new('sha1', self.raw.encode(config.charset)).hexdigest()
         result.append(formatter.code_area(1, self._code_id, self.parsername, self.show_nums, self.num_start, self.num_step))
 
         self.lastpos = 0
--- a/MoinMoin/parser/highlight.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/parser/highlight.py	Tue Sep 06 01:00:25 2016 +0200
@@ -5,7 +5,7 @@
     @copyright: 2008 Radomir Dopieralski <moindev@sheep.art.pl>
     @license: GNU GPL, see COPYING for details.
 """
-
+import hashlib
 import re
 
 import pygments
@@ -16,7 +16,6 @@
 
 from MoinMoin import config, wikiutil
 from MoinMoin.parser import parse_start_step
-from MoinMoin.support.python_compatibility import hash_new
 from MoinMoin.Page import Page
 
 Dependencies = ['user'] # the "Toggle line numbers link" depends on user's language
@@ -161,7 +160,7 @@
             fmt.result.append(formatter.line_anchordef(lineno))
 
         fmt.result.append(formatter.div(1, css_class="highlight %s" % self.syntax))
-        self._code_id = hash_new('sha1', self.raw.encode(config.charset)).hexdigest()
+        self._code_id = hashlib.new('sha1', self.raw.encode(config.charset)).hexdigest()
         msg = None
         if self.filename is not None:
             try:
--- a/MoinMoin/parser/text_moin_wiki.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Tue Sep 06 01:00:25 2016 +0200
@@ -15,7 +15,6 @@
 
 from MoinMoin import config, wikiutil, macro
 from MoinMoin.Page import Page
-from MoinMoin.support.python_compatibility import set
 
 Dependencies = ['user'] # {{{#!wiki comment ... }}} has different output depending on the user's profile settings
 
--- a/MoinMoin/script/maint/mkpagepacks.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/script/maint/mkpagepacks.py	Tue Sep 06 01:00:25 2016 +0200
@@ -13,7 +13,6 @@
 import time
 from datetime import datetime
 
-from MoinMoin.support.python_compatibility import set
 from MoinMoin import wikiutil
 from MoinMoin.action.AttachFile import _get_files
 from MoinMoin.Page import Page
--- a/MoinMoin/script/migration/_conv160_wiki.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/script/migration/_conv160_wiki.py	Tue Sep 06 01:00:25 2016 +0200
@@ -33,7 +33,6 @@
 from MoinMoin import config, wikiutil, macro
 from MoinMoin.action import AttachFile
 from MoinMoin.Page import Page
-from MoinMoin.support.python_compatibility import rsplit
 
 from text_moin158_wiki import Parser
 
@@ -177,7 +176,7 @@
         return new_name
 
     def _replace_target(self, target):
-        target_and_anchor = rsplit(target, '#', 1)
+        target_and_anchor = target.rsplit('#', 1)
         if len(target_and_anchor) > 1:
             target, anchor = target_and_anchor
             target = self._replace(('PAGE', target))
--- a/MoinMoin/script/migration/_conv160a_wiki.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/script/migration/_conv160a_wiki.py	Tue Sep 06 01:00:25 2016 +0200
@@ -21,7 +21,6 @@
 from MoinMoin import config, macro, wikiutil
 from MoinMoin.action import AttachFile
 from MoinMoin.Page import Page
-from MoinMoin.support.python_compatibility import rsplit
 
 import wikiutil160a
 from text_moin160a_wiki import Parser
@@ -168,7 +167,7 @@
         return new_name
 
     def _replace_target(self, target):
-        target_and_anchor = rsplit(target, '#', 1)
+        target_and_anchor = target.rsplit('#', 1)
         if len(target_and_anchor) > 1:
             target, anchor = target_and_anchor
             target = self._replace(('PAGE', target))
--- a/MoinMoin/script/migration/text_moin158_wiki.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/script/migration/text_moin158_wiki.py	Tue Sep 06 01:00:25 2016 +0200
@@ -7,6 +7,7 @@
 """
 
 import os, re
+import hashlib
 from MoinMoin import config, wikiutil
 from MoinMoin import macro as wikimacro
 from MoinMoin.Page import Page
@@ -748,8 +749,6 @@
 
     def _heading_repl(self, word):
         """Handle section headings."""
-        from MoinMoin.support.python_compatibility import hash_new
-
         h = word.strip()
         level = 1
         while h[level:level+1] == '=':
@@ -768,7 +767,7 @@
         if self.titles[pntt] > 1:
             unique_id = '-%d' % self.titles[pntt]
         result = self._closeP()
-        result += self.formatter.heading(1, depth, id="head-"+hash_new('sha1', pntt.encode(config.charset)).hexdigest()+unique_id)
+        result += self.formatter.heading(1, depth, id="head-"+hashlib.new('sha1', pntt.encode(config.charset)).hexdigest()+unique_id)
 
         return (result + self.formatter.text(title_text) +
                 self.formatter.heading(0, depth))
--- a/MoinMoin/script/migration/text_moin160a_wiki.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/script/migration/text_moin160a_wiki.py	Tue Sep 06 01:00:25 2016 +0200
@@ -6,7 +6,7 @@
                 2006 by MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-
+import hashlib
 import re
 
 import wikiutil160a as wikiutil
@@ -767,8 +767,6 @@
 
     def _heading_repl(self, word):
         """Handle section headings."""
-        from MoinMoin.support.python_compatibility import hash_new
-
         h = word.strip()
         level = 1
         while h[level:level+1] == '=':
@@ -786,7 +784,7 @@
         if self.titles[pntt] > 1:
             unique_id = '-%d' % self.titles[pntt]
         result = self._closeP()
-        result += self.formatter.heading(1, depth, id="head-"+hash_new('sha1', pntt.encode(config.charset)).hexdigest()+unique_id)
+        result += self.formatter.heading(1, depth, id="head-"+hashlib.new('sha1', pntt.encode(config.charset)).hexdigest()+unique_id)
 
         return (result + self.formatter.text(title_text) +
                 self.formatter.heading(0, depth))
--- a/MoinMoin/script/migration/wikiutil160a.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/script/migration/wikiutil160a.py	Tue Sep 06 01:00:25 2016 +0200
@@ -9,6 +9,7 @@
 
 import cgi
 import codecs
+import hashlib
 import os
 import re
 import time
@@ -1578,9 +1579,8 @@
 
 def createTicket(request, tm=None):
     """Create a ticket using a site-specific secret (the config)"""
-    from MoinMoin.support.python_compatibility import hash_new
     ticket = tm or "%010x" % time.time()
-    digest = hash_new('sha1', ticket)
+    digest = hashlib.new('sha1', ticket)
 
     varnames = ['data_dir', 'data_underlay_dir', 'language_default',
                 'mail_smarthost', 'mail_from', 'page_front_page',
--- a/MoinMoin/security/antispam.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/security/antispam.py	Tue Sep 06 01:00:25 2016 +0200
@@ -11,7 +11,6 @@
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
-from MoinMoin.support.python_compatibility import frozenset
 from MoinMoin.security import Permissions
 from MoinMoin import caching, wikiutil
 
--- a/MoinMoin/security/textcha.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/security/textcha.py	Tue Sep 06 01:00:25 2016 +0200
@@ -19,7 +19,7 @@
     @copyright: 2007 by MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-
+import hmac
 import re
 import random
 
@@ -30,7 +30,6 @@
 
 from MoinMoin import wikiutil
 from werkzeug.security import safe_str_cmp as safe_str_equal
-from MoinMoin.support.python_compatibility import hmac_new
 
 SHA1_LEN = 40 # length of hexdigest
 TIMESTAMP_LEN = 10 # length of timestamp
@@ -85,7 +84,7 @@
 
     def _compute_signature(self, question, timestamp):
         signature = u"%s%d" % (question, timestamp)
-        return hmac_new(self.secret, signature.encode('utf-8')).hexdigest()
+        return hmac.new(self.secret, signature.encode('utf-8')).hexdigest()
 
     def _init_qa(self, question=None):
         """ Initialize the question / answer.
--- a/MoinMoin/user.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/user.py	Tue Sep 06 01:00:25 2016 +0200
@@ -21,6 +21,8 @@
 """
 
 import os, time, codecs, base64
+import hashlib
+import hmac
 from copy import deepcopy
 import md5crypt
 
@@ -32,8 +34,6 @@
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
-from MoinMoin.support.python_compatibility import hash_new, hmac_new
-
 from MoinMoin import config, caching, wikiutil, i18n, events
 from werkzeug.security import safe_str_cmp as safe_str_equal
 from MoinMoin.util import timefuncs, random_string
@@ -285,7 +285,7 @@
         if salt is None:
             salt = random_string(20)
         assert isinstance(salt, str)
-        hash = hash_new('sha1', pwd)
+        hash = hashlib.new('sha1', pwd)
         hash.update(salt)
         return '{SSHA}' + base64.encodestring(hash.digest() + salt).rstrip()
     else:
@@ -715,13 +715,13 @@
                     if scheme == '{SSHA}':
                         d = base64.decodestring(d)
                         salt = d[20:]
-                        hash = hash_new('sha1', password.encode('utf-8'))
+                        hash = hashlib.new('sha1', password.encode('utf-8'))
                         hash.update(salt)
                         enc = base64.encodestring(hash.digest() + salt).rstrip()
 
                     elif scheme == '{SHA}':
                         enc = base64.encodestring(
-                            hash_new('sha1', password.encode('utf-8')).digest()).rstrip()
+                            hashlib.new('sha1', password.encode('utf-8')).digest()).rstrip()
 
                     elif scheme == '{APR1}':
                         # d is of the form "$apr1$<salt>$<hash>"
@@ -1260,7 +1260,7 @@
     def generate_recovery_token(self):
         key = random_string(64, "abcdefghijklmnopqrstuvwxyz0123456789")
         msg = str(int(time.time()))
-        h = hmac_new(key, msg).hexdigest()
+        h = hmac.new(key, msg).hexdigest()
         self.recoverpass_key = key
         self.save()
         return msg + '-' + h
@@ -1278,7 +1278,7 @@
             return False
         # check hmac
         # key must be of type string
-        h = hmac_new(str(self.recoverpass_key), str(stamp)).hexdigest()
+        h = hmac.new(str(self.recoverpass_key), str(stamp)).hexdigest()
         if not safe_str_equal(h, parts[1]):
             return False
         self.recoverpass_key = ""
--- a/MoinMoin/userprefs/oid.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/userprefs/oid.py	Tue Sep 06 01:00:25 2016 +0200
@@ -5,11 +5,11 @@
     @copyright: 2007     MoinMoin:JohannesBerg
     @license: GNU GPL, see COPYING for details.
 """
+import hashlib
 
 from MoinMoin import wikiutil, user
 from MoinMoin.widget import html
 from MoinMoin.userprefs import UserPrefBase
-from MoinMoin.support.python_compatibility import hash_new
 
 try:
     from MoinMoin.auth.openidrp import OpenIDAuth
@@ -46,7 +46,7 @@
             return
         openids = self.request.user.openids[:]
         for oid in self.request.user.openids:
-            name = "rm-%s" % hash_new('sha1', oid).hexdigest()
+            name = "rm-%s" % hashlib.new('sha1', oid).hexdigest()
             if name in self.request.form:
                 openids.remove(oid)
         if not openids and len(self.request.cfg.auth) == 1:
@@ -172,7 +172,7 @@
         _ = self.request.getText
         form = self._make_form()
         for oid in self.request.user.openids:
-            name = "rm-%s" % hash_new('sha1', oid).hexdigest()
+            name = "rm-%s" % hashlib.new('sha1', oid).hexdigest()
             form.append(html.INPUT(type="checkbox", name=name, id=name))
             form.append(html.LABEL(for_=name).append(html.Text(oid)))
             form.append(html.BR())
--- a/MoinMoin/util/moinoid.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/util/moinoid.py	Tue Sep 06 01:00:25 2016 +0200
@@ -4,7 +4,7 @@
     @copyright: 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
     @license: GNU GPL, see COPYING for details.
 """
-
+import hashlib
 from random import randint
 import time
 
@@ -14,7 +14,6 @@
 from openid.store import nonce
 
 from MoinMoin import caching
-from MoinMoin.support.python_compatibility import hash_new
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -53,7 +52,7 @@
 
     def key(self, url):
         '''return cache key'''
-        return hash_new('sha1', url).hexdigest()
+        return hashlib.new('sha1', url).hexdigest()
 
     def storeAssociation(self, server_url, association):
         ce = caching.CacheEntry(self.request, 'openid', self.key(server_url),
@@ -104,7 +103,7 @@
 
     def useNonce(self, server_url, timestamp, salt):
         val = ''.join([str(server_url), str(timestamp), str(salt)])
-        csum = hash_new('sha1', val).hexdigest()
+        csum = hashlib.new('sha1', val).hexdigest()
         ce = caching.CacheEntry(self.request, 'openid-nonce', csum,
                                 scope='farm', use_pickle=False)
         if ce.exists():
--- a/MoinMoin/util/thread_monitor.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/util/thread_monitor.py	Tue Sep 06 01:00:25 2016 +0200
@@ -23,8 +23,6 @@
 from time import sleep
 from StringIO import StringIO
 
-from MoinMoin.support.python_compatibility import set
-
 
 class AbstractMonitor(object):
     def activate_hook(self):
--- a/MoinMoin/wikiutil.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/wikiutil.py	Tue Sep 06 01:00:25 2016 +0200
@@ -12,6 +12,7 @@
 
 import cgi
 import codecs
+import hmac
 import os
 import re
 import time
@@ -21,7 +22,6 @@
 logging = log.getLogger(__name__)
 
 from MoinMoin import config
-from MoinMoin.support.python_compatibility import rsplit
 from inspect import getargspec, isfunction, isclass, ismethod
 
 from MoinMoin import web # needed so that next lines work:
@@ -2472,7 +2472,7 @@
           pagename part (and no anchor). Also, we need to append #anchor
           at the END of the generated URL (AFTER the query string).
     """
-    parts = rsplit(pagename, '#', 1)
+    parts = pagename.rsplit('#', 1)
     if len(parts) == 2:
         return parts
     else:
@@ -2497,8 +2497,6 @@
                              page than the current one, you MUST specify the
                              page name you use when posting the form.
     """
-
-    from MoinMoin.support.python_compatibility import hmac_new
     if tm is None:
         # for age-check of ticket
         tm = "%010x" % time.time()
@@ -2531,9 +2529,9 @@
             value = value.encode('utf-8')
         hmac_data.append(value)
 
-    hmac = hmac_new(request.cfg.secrets['wikiutil/tickets'],
-                    ''.join(hmac_data))
-    return "%s.%s" % (tm, hmac.hexdigest())
+    h = hmac.new(request.cfg.secrets['wikiutil/tickets'],
+                 ''.join(hmac_data))
+    return "%s.%s" % (tm, h.hexdigest())
 
 
 def checkTicket(request, ticket):
--- a/jabberbot/capat.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/jabberbot/capat.py	Tue Sep 06 01:00:25 2016 +0200
@@ -13,8 +13,8 @@
 """
 
 import base64
+import hashlib
 import itertools
-from MoinMoin.support.python_compatibility import hash_new
 from pyxmpp.presence import Presence
 
 HASHALIASES = { # IANA Hash Function Textual Names Registry
@@ -45,7 +45,7 @@
     # only IANA aliases are supported
     if algo not in HASHALIASES:
         raise ValueError("undefined hash algorithm")
-    algo = hash_new(HASHALIASES[algo])
+    algo = hashlib.new(HASHALIASES[algo])
 
     ident = list(identities)
     # default sorting already considers both, category and type