Permalink
Browse files

修改了文件中有特殊字符的处理

  • Loading branch information...
1 parent 3a339a5 commit eb32d6f0761308784cbfa435722225dae32b9e6e @xiyoulaoyuanjia xiyoulaoyuanjia committed Mar 23, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 vdisksdk.py
View
@@ -68,7 +68,7 @@ def _http_call(client, url, method, authorization, **kw):
http_url = (method == _HTTP_GET) and ('%s%s' %(url ,url_ext)) or ('%s' % (url))
for k, v in kw.iteritems():
if method == _HTTP_UPLOAD and k == 'file':
- uploadPa+=" -F "+k+"=@"+str(v)
+ uploadPa+=" -F "+k+"=@\""+str(v)+"\""
elif method==_HTTP_UPLOAD:
uploadPa+=" -F "+k+"="+str(v)
else:
@@ -77,6 +77,7 @@ def _http_call(client, url, method, authorization, **kw):
if method ==_HTTP_UPLOAD:
uploadPa+=" -F token="+params['token']
cmd="curl"+uploadPa+" \""+http_url+"\""
+ print cmd
return _get_json_request(os.popen(cmd).read())
# print body
else:

0 comments on commit eb32d6f

Please sign in to comment.