mirror of
https://github.com/python/cpython.git
synced 2025-11-21 19:24:44 +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:
|
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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue