-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows fixes #27
base: master
Are you sure you want to change the base?
Windows fixes #27
Conversation
: is not allowed character in path under Windows. Signed-off-by: Vasily E <[email protected]>
Signed-off-by: Vasily E <[email protected]>
Signed-off-by: Vasily E <[email protected]>
Hi @laerreal Welcome to Cappy and thank you for the PR. I've gone through it and it looks good to merge except for some small issues.
This would add an extra slash to While this works without any issues, I'd rather have this documented somewhere than have this as a side-effect. Maybe we could use @cyriac what do you think ? |
Hi @laerreal. Thanks for the contribution. As @sebinthomas suggested, this would cause one additional directory to be created that is not necessarily adding value. Could we use a different separator there? Also instead of using |
Hi. Using slash as seperator also preserves original file names. This can be convenient under some circumstances. So, I suggest next:
'{method} {param_str} {stub}' Also, is it possible in HTTP request, a raw space is present in either file name or parametrs? If not, this approch will also revent possible confusion with requests of files with names like "GET-myfile.html". What do you think? P.S. I will replace |
How about we convert So the code would roughly translate to something like this def get_hashed_filepath(stub, method, parsed_url, params):
hash_template = '{method}%s{stub}{param_str}' % os.sep # Formatting for this can be anything
... other code ....
filepath = hash_template.format(method=method, stub=stub, param_str=param_str)
return hashlib.md5(filepath).hexdigest() |
Signed-off-by: Vasily E <[email protected]>
Signed-off-by: Vasily E <[email protected]>
Signed-off-by: Vasily E <[email protected]>
@laerreal I suggest you keep
and do
This makes it easy if you want to revert or see the filename/stub if you're debugging. Notice the Looks good to merge otherwise. |
Hello! Ricently I used this tool under Windows 7 x64, Python 2.7.15 x86_64. There are few fixes I made.
Using OS specific separator instead of
:
will cause misses on old caches. But this does make new caches portable.