Skip to content

Commit

Permalink
修改了文件中有特殊字符的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoulaoyuanjia committed Mar 23, 2013
1 parent 3a339a5 commit eb32d6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vdisksdk.py
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit eb32d6f

Please sign in to comment.