mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Ensure Unicode filenames work with glob - they already do, but the test seems worth keeping.
This commit is contained in:
parent
6253a114a7
commit
e843e482ce
1 changed files with 9 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
# Test some Unicode file name semantics
|
# Test some Unicode file name semantics
|
||||||
# We dont test many operations on files other than
|
# We dont test many operations on files other than
|
||||||
# that their names can be used with Unicode characters.
|
# that their names can be used with Unicode characters.
|
||||||
import os
|
import os, glob
|
||||||
|
|
||||||
from test_support import verify, TestSkipped, TESTFN_UNICODE
|
from test_support import verify, TestSkipped, TESTFN_UNICODE
|
||||||
try:
|
try:
|
||||||
|
@ -57,6 +57,14 @@ if not os.path.isfile(TESTFN_UNICODE) or \
|
||||||
path, base = os.path.split(os.path.abspath(TESTFN_ENCODED))
|
path, base = os.path.split(os.path.abspath(TESTFN_ENCODED))
|
||||||
if base not in os.listdir(path):
|
if base not in os.listdir(path):
|
||||||
print "Filename did not appear in os.listdir()"
|
print "Filename did not appear in os.listdir()"
|
||||||
|
path, base = os.path.split(os.path.abspath(TESTFN_UNICODE))
|
||||||
|
if base not in os.listdir(path):
|
||||||
|
print "Unicode filename did not appear in os.listdir()"
|
||||||
|
|
||||||
|
if os.path.abspath(TESTFN_ENCODED) != os.path.abspath(glob.glob(TESTFN_ENCODED)[0]):
|
||||||
|
print "Filename did not appear in glob.glob()"
|
||||||
|
if os.path.abspath(TESTFN_UNICODE) != os.path.abspath(glob.glob(TESTFN_UNICODE)[0]):
|
||||||
|
print "Unicode filename did not appear in glob.glob()"
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
os.unlink(TESTFN_UNICODE)
|
os.unlink(TESTFN_UNICODE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue