@@ -249,13 +249,14 @@ def getDocRoot(webApi=None):
249249 for absFilePath in kb .absFilePaths :
250250 if directoryPath (absFilePath ) == '/' :
251251 continue
252+
252253 absFilePath = normalizePath (absFilePath )
253254 absFilePathWin = None
254255
255256 if isWindowsPath (absFilePath ):
256257 absFilePathWin = posixToNtSlashes (absFilePath )
257258 absFilePath = ntToPosixSlashes (absFilePath [2 :])
258- elif isWindowsDriveLetterPath (absFilePath ): #e .g. C:/xampp/htdocs
259+ elif isWindowsDriveLetterPath (absFilePath ): # E .g. C:/xampp/htdocs
259260 absFilePath = absFilePath [2 :]
260261
261262 if pagePath in absFilePath :
@@ -309,10 +310,13 @@ def getDirs(webApi=None):
309310 for absFilePath in kb .absFilePaths :
310311 if absFilePath :
311312 directory = directoryPath (absFilePath )
313+
312314 if isWindowsPath (directory ):
313315 directory = ntToPosixSlashes (directory )
316+
314317 if directory == '/' :
315318 continue
319+
316320 directories .add (directory )
317321 else :
318322 warnMsg = "unable to retrieve any web server path"
@@ -981,21 +985,17 @@ def urlEncodeCookieValues(cookieStr):
981985def directoryPath (path ):
982986 retVal = None
983987
984- if isWindowsPath (path ):
988+ if isWindowsDriveLetterPath (path ):
985989 retVal = ntpath .dirname (path )
986990 else :
987991 retVal = posixpath .dirname (path )
988992
989993 return retVal
990994
991995def normalizePath (path ):
992- """
993- This function must be called only after posixToNtSlashes()
994- and ntToPosixSlashes()
995- """
996996 retVal = None
997997
998- if isWindowsPath (path ):
998+ if isWindowsDriveLetterPath (path ):
999999 retVal = ntpath .normpath (path )
10001000 else :
10011001 retVal = posixpath .normpath (path )
0 commit comments