django-imagekit icon indicating copy to clipboard operation
django-imagekit copied to clipboard

Fix equality checking of paths by normalizing them

Open armanexplorer opened this issue 3 years ago • 0 comments

The main reason for this PR is the final part of the FileSystemStorage._save() method in the Django library that leads to generating unnormalized paths:

...

# Store filenames with forward slashes, even on Windows.
return str(name).replace('\\', '/')

So, we should care for the normalized paths generated by namer (using os.path.normpath()) against the unnormalized paths generated by Django Storage. Hence, this leads to a fault when the OS doesn't use forward slashes for the path formatting, like Windows.

armanexplorer avatar Apr 03 '22 04:04 armanexplorer