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