mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
Fix for glob.py if filesystem encoding is None.
This commit is contained in:
parent
0bbbfc4c0b
commit
b54a809825
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue