diff --git a/kallithea/controllers/admin/admin.py b/kallithea/controllers/admin/admin.py --- a/kallithea/controllers/admin/admin.py +++ b/kallithea/controllers/admin/admin.py @@ -60,7 +60,7 @@ def _journal_filter(user_log, search_ter if search_term: qp = QueryParser('repository', schema=JOURNAL_SCHEMA) qp.add_plugin(DateParserPlugin()) - qry = qp.parse(unicode(search_term)) + qry = qp.parse(search_term) log.debug('Filtering using parsed query %r', qry) def wildcard_handler(col, wc_term): diff --git a/kallithea/controllers/search.py b/kallithea/controllers/search.py --- a/kallithea/controllers/search.py +++ b/kallithea/controllers/search.py @@ -96,7 +96,7 @@ class SearchController(BaseRepoControlle # for case-sensitive matching cur_query = u'repository_rawname:%s %s' % (c.repo_name, cur_query) try: - query = qp.parse(unicode(cur_query)) + query = qp.parse(cur_query) # extract words for highlight if isinstance(query, Phrase): highlight_items.update(query.words) diff --git a/kallithea/lib/vcs/backends/git/repository.py b/kallithea/lib/vcs/backends/git/repository.py --- a/kallithea/lib/vcs/backends/git/repository.py +++ b/kallithea/lib/vcs/backends/git/repository.py @@ -274,7 +274,7 @@ class GitRepository(BaseRepository): msg = "Revision %r does not exist for %s" % (revision, self.name) raise ChangesetDoesNotExistError(msg) - if isinstance(revision, (str, unicode)): + if isinstance(revision, str): if revision.isdigit() and (len(revision) < 12 or len(revision) == revision.count('0')): try: return self.revisions[int(revision)] diff --git a/kallithea/lib/vcs/backends/hg/inmemory.py b/kallithea/lib/vcs/backends/hg/inmemory.py --- a/kallithea/lib/vcs/backends/hg/inmemory.py +++ b/kallithea/lib/vcs/backends/hg/inmemory.py @@ -30,12 +30,12 @@ class MercurialInMemoryChangeset(BaseInM """ self.check_integrity(parents) + if not isinstance(message, str): + raise RepositoryError('message must be a str - got %r' % type(message)) + if not isinstance(author, str): + raise RepositoryError('author must be a str - got %r' % type(author)) + from .repository import MercurialRepository - if not isinstance(message, unicode) or not isinstance(author, unicode): - raise RepositoryError('Given message and author needs to be ' - 'an instance got %r & %r instead' - % (type(message), type(author))) - if branch is None: branch = MercurialRepository.DEFAULT_BRANCH_NAME kwargs[b'branch'] = safe_bytes(branch) diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -218,9 +218,7 @@ class Setting(Base, BaseDbModel): @app_settings_value.setter def app_settings_value(self, val): """ - Setter that will always make sure we use unicode in app_settings_value - - :param val: + Setter that will always make sure we use str in app_settings_value """ self._app_settings_value = safe_str(val) diff --git a/scripts/update-copyrights.py b/scripts/update-copyrights.py --- a/scripts/update-copyrights.py +++ b/scripts/update-copyrights.py @@ -51,7 +51,7 @@ def sortkey(x): * first contribution * number of contribution years * name (with some unicode normalization) - The entries must be 2-tuples of a list of string years and the unicode name""" + The entries must be 2-tuples of a list of string years and the name""" return (x[0] and -int(x[0][-1]), x[0] and int(x[0][0]), -len(x[0]),