Skip to content

Feature/useragent #104

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

Merged
merged 4 commits into from
Apr 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## CHANGE LOG

### v6.1.6

2014-04-15 issue [#104](https://github.com/qiniu/python-sdk/pull/104)
- [#100] 遵循PEP8语法规范
- [#101] 增加pyflakes语法检测
- [#103] 错误信息中加入Reqid信息,以便追溯
- [#104] 完善User-Agent头信息,以便追溯

### v6.1.5

2014-04-08 issue [#98](https://github.com/qiniu/python-sdk/pull/98)
Expand Down
2 changes: 1 addition & 1 deletion qiniu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
'''

# -*- coding: utf-8 -*-
__version__ = '6.1.4'
__version__ = '6.1.6'
7 changes: 6 additions & 1 deletion qiniu/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
UP_HOST = "up.qiniu.com"

from . import __version__
USER_AGENT = "qiniu python-sdk v%s" % __version__
import platform

sys_info = "%s/%s" % (platform.system(), platform.machine())
py_ver = platform.python_version()

USER_AGENT = "QiniuPython/%s (%s) Python/%s" % (__version__, sys_info, py_ver)
4 changes: 1 addition & 3 deletions qiniu/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ def call_with(self, path, body, content_type=None, content_length=None):
if resp.status / 100 != 2:
err_msg = ret if "error" not in ret else ret["error"]
reqid = resp.getheader("X-Reqid", None)
detail = resp.getheader("x-log", None)
# detail = resp.getheader("x-log", None)
if reqid is not None:
err_msg += ", reqid:%s" % reqid
if detail is not None:
err_msg += ", detail:%s" % detail

return None, err_msg

Expand Down