e-dard/flask-s3 — pull request #28 by kageurufu (2014-07-22 17:43:01+00:00)
Title: Fix uploading assets on windows machines

I was running into errors on my windows machine, when uploading assets using create_all

File "C:\Users\Franklyn\Envs\comanage\lib\site-packages\flask_s3.py", line 118, in _write_files
asset_loc)
File "C:\Users\Franklyn\Envs\comanage\lib\site-packages\flask_s3.py", line 105, in _static_folder_path
(static_asset, static_folder))
ValueError: /Users/Franklyn/Source/comanage/comanage/public/.webassets-cache/035ed7663649a13ac64ecdeb9860a493 static asset must be under C:\Users\Franklyn\Source\comanage\comanage\public static folder

This was due to the _path_to_relative_url converting C:\Users\Franklyn\Source\comanage\comanage\public to /Users/Franklyn/Source/comanage/comanage/public/ but then attempting to compare to the original string.

This PR will use the same relative_url function to provide equivalent comparisons for these paths.

I was unable to write a test for this case, as it did not exhibit the same behavior on other systems