summaryrefslogtreecommitdiff
path: root/Lib/glob.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-20 23:05:14 +0000
committerGeorg Brandl <georg@python.org>2007-03-20 23:05:14 +0000
commit7ef8bcbb01c438ce80a21d89e041ebf1944f42c3 (patch)
treed3ac4ff8dac404c68abf913bf1c6a2e2e3a536f0 /Lib/glob.py
parent17b3a630595bd33855e9dd2107762df893683c1e (diff)
downloadcpython-7ef8bcbb01c438ce80a21d89e041ebf1944f42c3.tar.gz
Fix for glob.py if filesystem encoding is None.
Diffstat (limited to 'Lib/glob.py')
-rw-r--r--Lib/glob.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/glob.py b/Lib/glob.py
index a92b11f431..75d7bf94e5 100644
--- a/Lib/glob.py
+++ b/Lib/glob.py
@@ -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: