diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2014-11-03 17:57:19 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2014-12-27 14:48:13 +0000 |
commit | 985f9c5376387c2273340ea9e325e5b9a0c1b473 (patch) | |
tree | d5b22455b2171a654ff4797e955e71789ed7757e | |
parent | 2201e071dc6e2700ad0151fa87c6f0c8ce3cec6f (diff) | |
download | bottle-985f9c5376387c2273340ea9e325e5b9a0c1b473.tar.gz |
Make `root='/'` work cross-platform
If `root` already ends in `os.sep`, don't add another one.
`abspath` strips trailing slashes from all paths _except_ root (C:\, /)
-rw-r--r-- | bottle.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2352,7 +2352,7 @@ def static_file(filename, root, mimetype='auto', download=False, charset='UTF-8' mime-type. (default: UTF-8) """ - root = os.path.abspath(root) + os.sep + root = os.path.join(os.path.abspath(root), '') filename = os.path.abspath(os.path.join(root, filename.strip('/\\'))) headers = dict() |