Fix for glob.py if filesystem encoding is None.

This commit is contained in:
Georg Brandl 2007-03-20 23:05:14 +00:00
parent 0bbbfc4c0b
commit b54a809825
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ def glob1(dirname, pattern):
if not dirname:
dirname = os.curdir
if isinstance(pattern, unicode) and not isinstance(dirname, unicode):
dirname = unicode(dirname, sys.getfilesystemencoding())
dirname = unicode(dirname, sys.getfilesystemencoding() or
sys.getdefaultencoding())
try:
names = os.listdir(dirname)
except os.error: