Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a31bf18c
Commit
a31bf18c
authored
Apr 09, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glob('anything*/') would fail because isdir is in os.path, not os.
parent
e0bb597d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Lib/glob.py
Lib/glob.py
+1
-1
Lib/test/test_glob.py
Lib/test/test_glob.py
+8
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/glob.py
View file @
a31bf18c
...
...
@@ -60,7 +60,7 @@ def glob0(dirname, basename):
if
basename
==
''
:
# `os.path.split()` returns an empty basename for paths ending with a
# directory separator. 'q*x/' should match only directories.
if
os
.
isdir
(
dirname
):
if
os
.
path
.
isdir
(
dirname
):
return
[
basename
]
else
:
if
os
.
path
.
lexists
(
os
.
path
.
join
(
dirname
,
basename
)):
...
...
Lib/test/test_glob.py
View file @
a31bf18c
...
...
@@ -80,6 +80,14 @@ class GlobTests(unittest.TestCase):
eq
(
self
.
glob
(
'?a?'
,
'*F'
),
map
(
self
.
norm
,
[
os
.
path
.
join
(
'aaa'
,
'zzzF'
),
os
.
path
.
join
(
'aab'
,
'F'
)]))
def
test_glob_directory_with_trailing_slash
(
self
):
# We are verifying that when there is wildcard pattern which
# ends with os.sep doesn't blow up.
res
=
glob
.
glob
(
self
.
tempdir
+
'*'
+
os
.
sep
)
self
.
assertEqual
(
len
(
res
),
1
)
# either of these results are reasonable
self
.
assertTrue
(
res
[
0
]
in
[
self
.
tempdir
,
self
.
tempdir
+
os
.
sep
])
def
test_glob_broken_symlinks
(
self
):
if
hasattr
(
os
,
'symlink'
):
eq
=
self
.
assertSequencesEqual_noorder
...
...
Misc/NEWS
View file @
a31bf18c
...
...
@@ -20,6 +20,8 @@ Extension Modules
Library
-------
- Fix exception when doing glob.glob('
anything
*/
')
Build
-----
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment