From: Christopher Bare Date: Wed, 30 Jan 2013 23:33:43 +0000 (-0800) Subject: shorten filename by os.path.basename in guess_filename(obj) X-Git-Tag: v1.2.0~57^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ff8cbe5fb5e917b95dcbd6bc81e43d35dcbbb16;p=services%2Fpython-requests.git shorten filename by os.path.basename in guess_filename(obj) --- diff --git a/requests/utils.py b/requests/utils.py index 3bdfe31..91bb3e8 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -89,7 +89,7 @@ def guess_filename(obj): """Tries to guess the filename of the given object.""" name = getattr(obj, 'name', None) if name and name[0] != '<' and name[-1] != '>': - return name + return os.path.basename(name) def from_key_val_list(value):