我正在使用Python工具包进行拉力赛REST API来更新拉力赛服务器上的缺陷。我已经确认,我可以通过获取当前缺陷列表来与服务器进行联系并进行身份验证。我遇到了更新它们的问题。我使用Python 2.7.3与pyral 0.9.1并请求0.13.3。通过pyral更新拉力赛中的缺陷时无法分析输入流错误
此外,我正在将'verify = False'传递给Rally()调用,并已对 restapi模块进行了适当的修改以弥补这一点。
这里是我的测试代码:
import sys
from pyral import Rally, rallySettings
server = "rallydev.server1.com"
user = "[email protected]"
password = "trial"
workspace = "trialWorkspace"
project = "Testing Project"
defectID = "DE192"
rally = Rally(server, user, password, workspace=workspace,
project=project, verify=False)
defect_data = { "FormattedID" : defectID,
"State" : "Closed"
}
try:
defect = rally.update('Defect', defect_data)
except Exception, details:
sys.stderr.write('ERROR: %s \n' % details)
sys.exit(1)
print "Defect %s updated" % defect.FormattedID
当我运行该脚本:
[temp]$ ./updefect.py
ERROR: Unable to update the Defect
如果我在RallyRESTResponse功能打印出self.errors的值更改代码的时候发现(rallyresp.py的第164行),我得到这个输出:
[temp]$ ./updefect.py
[u"Cannot parse input stream due to I/O error as JSON document: Parse error: expected '{' but saw '\uffff' [ chars read = >>>\uffff<<< ]"]
ERROR: Unable to update the Defect
我确实发现了另一个问题,这可能与我的相关:
App SDK: Erorr parsing input stream when running query
你能提供任何帮助吗?
我要补充一点,列出的defectID的是,我在适当的创建一个真正的缺陷真正的工作区和项目通过网络GUI。如果我在Rally调用中使用debug = on运行脚本,则可以看到POST操作期间发生的问题:https://rallydev.server1.com/slm/webservice/1.30/defe ct/12345678.js?workspace = workspace/1234&project = project/12345 – Bryon 2012-07-19 20:13:40