我正在为 Gitlab API 使用 python-gitlab 驱动程序。以下在我的存储库上工作正常:
>>> rf_blob = p.repository_blob(p_latest_commit.id, 'iOSBoilerplate/GooglePlus/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2Authentication.h')
>>> rf_blob = p.repository_blob(p_latest_commit.id, 'iOSBoilerplate/GooglePlus/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2SignIn.h')
但是,当我尝试打开一个包含+
字符的文件时,即使该文件明确存在于存储库中,我也会得到以下信息:
>>> rf_blob = p.repository_blob(p_latest_commit.id, 'iOSBoilerplate/GooglePlus/GoogleOpenSource.framework/Versions/A/Headers/GTMNSString+URLArguments.h')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/gitlab/objects.py", line 1521, in repository_blob
raise_error_from_response(r, GitlabGetError)
File "/usr/local/lib/python2.7/site-packages/gitlab/exceptions.py", line 140, in raise_error_from_response
response_body=response.content)
gitlab.exceptions.GitlabGetError: 404: 404 File Not Found
我该如何转义+
in python 以便我可以获取文件的 blob?