Fix for glob.py if filesystem encoding is None.
This commit is contained in:
parent
0bbbfc4c0b
commit
b54a809825
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue