summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa@gmail.com>2013-09-28 12:51:20 +0000
committerTakayuki Shimizukawa <shimizukawa@gmail.com>2013-09-28 12:51:20 +0000
commit58be2f19b3aeeabf4d9a3d10be84824508c0fda2 (patch)
treea8a7655fd475a3d77ecdc8ff3919c421af9e3b99 /sphinx/util/osutil.py
parent445bb5daecba49e8054435d8071130e1fb48383e (diff)
downloadsphinx-git-58be2f19b3aeeabf4d9a3d10be84824508c0fda2.tar.gz
When Sphinx couldn't decode multibyte filename, now Sphinx notices UnicodeError and continuing if possible instead of raise exception. Closes #703
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r--sphinx/util/osutil.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index f37c10222..3128b9c78 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -77,7 +77,14 @@ def walk(top, topdown=True, followlinks=False):
dirs, nondirs = [], []
for name in names:
- if path.isdir(path.join(top, name)):
+ try:
+ fullpath = path.join(top, name)
+ except UnicodeError:
+ print >>sys.stderr, (
+ '%s:: ERROR: multibyte filename did not support on this filesystem '
+ 'encoding %r, skipped.' % (name, fs_encoding))
+ continue
+ if path.isdir(fullpath):
dirs.append(name)
else:
nondirs.append(name)