I would like to extract common path from a list irrespective of any case using python 2.7
I'm trying to use os.path.commonprefix()
to extract the common prefix from the list but unable to extract the expected path due to case sensitive extraction. Is there any way to extract the common path by ignoring the case?
paths = ['C:\Users\Public\Desktop', 'c:\Users\Default']
prefix = os.path.commonprefix(paths)
I expect the output of prefix to be 'c:\Users\' or 'C:\Users\', but it returns an empty string because of case sensitive 'C:\' drive in paths