summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-17 00:15:11 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-17 00:15:11 +0000
commitcb0f273297db79c47d38df235bcf18378126e9eb (patch)
tree4c97c131a8bf370145f504f9d6148076bda324c1 /pym/portage/tests/__init__.py
parent95b6068670e0248feb5bf86593f840ae81a4c757 (diff)
downloadportage-cb0f273297db79c47d38df235bcf18378126e9eb.tar.gz
portage-cb0f273297db79c47d38df235bcf18378126e9eb.tar.bz2
portage-cb0f273297db79c47d38df235bcf18378126e9eb.zip
Use _content_encoding and _fs_encoding for unicode encoding/decoding.
svn path=/main/trunk/; revision=14072
Diffstat (limited to 'pym/portage/tests/__init__.py')
-rw-r--r--pym/portage/tests/__init__.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py
index 8676c6ae2..4a5ced8a3 100644
--- a/pym/portage/tests/__init__.py
+++ b/pym/portage/tests/__init__.py
@@ -3,14 +3,21 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
import sys
import time
import unittest
+from portage import os
+from portage import _fs_encoding
+from portage import _unicode_encode
+from portage import _unicode_decode
+
def main():
- TEST_FILE = '__test__'
+ TEST_FILE = _unicode_encode('__test__',
+ encoding=_fs_encoding, errors='strict')
+ svn_dirname = _unicode_encode('.svn',
+ encoding=_fs_encoding, errors='strict')
suite = unittest.TestSuite()
basedir = os.path.dirname(os.path.realpath(__file__))
testDirs = []
@@ -19,8 +26,14 @@ def main():
# I was tired of adding dirs to the list, so now we add __test__
# to each dir we want tested.
for root, dirs, files in os.walk(basedir):
- if ".svn" in dirs:
- dirs.remove('.svn')
+ if svn_dirname in dirs:
+ dirs.remove(svn_dirname)
+ try:
+ root = _unicode_decode(root,
+ encoding=_fs_encoding, errors='strict')
+ except UnicodeDecodeError:
+ continue
+
if TEST_FILE in files:
testDirs.append(root)