diff options
-rw-r--r-- | Lib/glob.py | 3 |
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: |