Commit 7ef8bcbb authored by Georg Brandl's avatar Georg Brandl

Fix for glob.py if filesystem encoding is None.

parent 17b3a630
...@@ -50,7 +50,8 @@ def glob1(dirname, pattern): ...@@ -50,7 +50,8 @@ def glob1(dirname, pattern):
if not dirname: if not dirname:
dirname = os.curdir dirname = os.curdir
if isinstance(pattern, unicode) and not isinstance(dirname, unicode): if isinstance(pattern, unicode) and not isinstance(dirname, unicode):
dirname = unicode(dirname, sys.getfilesystemencoding()) dirname = unicode(dirname, sys.getfilesystemencoding() or
sys.getdefaultencoding())
try: try:
names = os.listdir(dirname) names = os.listdir(dirname)
except os.error: except os.error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment