From b54a809825ca010bdf3d4902fa8c8a4870c5baf1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 20 Mar 2007 23:05:14 +0000 Subject: [PATCH] Fix for glob.py if filesystem encoding is None. --- Lib/glob.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.40.0