~barry/mailman/lp1423756

« back to all changes in this revision

Viewing changes to src/mailman/archiving/tests/test_prototype.py

  • Committer: Barry Warsaw
  • Date: 2015-01-05 01:20:33 UTC
  • mfrom: (7264.4.66 py3)
  • Revision ID: barry@list.org-20150105012033-zdrw9c2odhpf22fz
Merge the Python 3 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Test the prototype archiver."""
19
19
 
20
 
from __future__ import absolute_import, print_function, unicode_literals
21
 
 
22
 
__metaclass__ = type
23
20
__all__ = [
24
21
    'TestPrototypeArchiver',
25
22
    ]
33
30
 
34
31
from email import message_from_file
35
32
from flufl.lock import Lock
36
 
 
37
33
from mailman.app.lifecycle import create_list
38
34
from mailman.archiving.prototype import Prototype
39
35
from mailman.config import config
89
85
    def _find(self, path):
90
86
        all_filenames = set()
91
87
        for dirpath, dirnames, filenames in os.walk(path):
92
 
            if not isinstance(dirpath, unicode):
93
 
                dirpath = unicode(dirpath)
 
88
            if isinstance(dirpath, bytes):
 
89
                dirpath = dirpath.decode('utf-8')
94
90
            all_filenames.add(dirpath)
95
91
            for filename in filenames:
96
92
                new_filename = filename
97
 
                if not isinstance(filename, unicode):
98
 
                    new_filename = unicode(filename)
 
93
                if isinstance(filename, bytes):
 
94
                    new_filename = filename.decode('utf-8')
99
95
                all_filenames.add(os.path.join(dirpath, new_filename))
100
96
        return all_filenames
101
97