Skip to content

Commit 2f01331

Browse files
authored
Prevent os.walk("/")
1 parent 5481ced commit 2f01331

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tika/tika.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def getPaths(urlOrPaths):
174174
a directory, it walks the directory and then finds all file paths in it, and ads them
175175
too. If it's a file, it adds it to the paths. If it's a URL it just adds it to the path.
176176
"""
177+
if isinstance(urlOrPaths, basestring):
178+
urlOrPaths = [urlOrPaths] # do not recursively walk over letters of a single path which can include "/"
177179
paths = []
178180
for eachUrlOrPaths in urlOrPaths:
179181
if os.path.isdir(eachUrlOrPaths):

0 commit comments

Comments
 (0)