-
Notifications
You must be signed in to change notification settings - Fork 119
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
Can't upload attachments with .save in .new #25
Comments
Can't reproduce this error, everything works perfectly for me, here's the code: >>> issue = redmine.issue.new()
>>> issue.project_id = 'some_project'
>>> issue.subject = 'test'
>>> issue.uploads = [{'path': '/some/path/to/file/test.zip'}]
>>> issue.save()
True Also, you error message is a little bit strange, why do you have this If the error is still there I need more details from you to reproduce this:
|
I removed the version i had (and yes, i was trying to trouble shoot the issue myself). I now have a freash copy from easy_install (0.8.0). I reran my code and got my original error which is: Traceback (most recent call last): I am running python 2.7.5 and my code is as follows (some items renamed to protect the innocent). It shouldn't matter, but I am coding on mac OSX 10 issue = redmine.issue.new() |
OK, it seems that the
in line 77 ( |
Max, Sorry, im using the 0.8.0 that gets installed when you do an easy_install. it seems that the json is too large looking at the below error. Which is 200 413 <title>413 Request Entity Too Large</title>Request Entity Too LargeThe requested resource Apache/2.2.15 (CentOS) Server at project.DOMAIN.com Port 443 On Mon, Mar 31, 2014 at 11:44 AM, Max Tepkeev notifications@github.comwrote:
|
Hi! 0.8.0 is the version of Python Redmine, and not the Redmine itself. I was asking your Redmine version because your problem is not related to Python Redmine but either to the Redmine itself or to the web server hosting your Redmine application (seems to be Apache in your case). Keep in mind that file uploads via REST API are available only for Redmine 1.4.0+ Also, there is a LimitRequestBody directive in Apache which controls this limits. If you have nginx in front of Apache there is a client_max_body_size directive which also controls the request body limits. I'm afraid that's all I can do for you because the problem doesn't seem to be related with Python Redmine. You have to upgrade your Redmine if it's < 1.4.0 and play with Redmine/Apache/Nginx settings to make uploads work. I'm not closing this issue in case you'll have any more questions about this problem. Also if you'll find a solution please post it here for others. Thanks. |
It appears to be the Redmine version. I'm just going to write some code to On Tue, Apr 1, 2014 at 3:46 AM, Max Tepkeev notifications@github.comwrote:
|
0.8.0 can't be the Redmine version, because REST API become available only from Redmine 1.0+. You can find your Redmine version at http://your-redmine-url/admin/info There is a version check in Python Redmine but you have to specify your Redmine version explicitly in redmine = Redmine('http://demo.redmine.org', version='2.3.3') because there is currently no way to get the Redmine version through it's api. |
I added additional error checks which are available as of v0.8.1 |
This happens when the following code is run
issue.requireditems_here
issue.uploads = [{'path': '/folder/folderDocuments/sample_37c8b57c0811b74f44c4ee0ae300b608.zip'}]
issue.save
This happens both with and without the patch
Traceback (most recent call last):
File "./kedmine.py", line 137, in
main()
File "./kedmine.py", line 125, in main
res = issue.save()
File "/Library/Python/2.7/site-packages/python_redmine-0.8.0-py2.7.egg/redmine/resources.py", line 227, in save
for item, value in self.manager.create(**self._changes):
File "/Library/Python/2.7/site-packages/python_redmine-0.8.0-py2.7.egg/redmine/managers.py", line 164, in create
fields['uploads'][index]['token'] = self.redmine.upload(upload.get('path', ''))
File "/Library/Python/2.7/site-packages/python_redmine-0.8.0-py2.7.egg/redmine/init.py", line 49, in upload
print response['upload']['token']
TypeError: 'NoneType' object has no attribute 'getitem'
The text was updated successfully, but these errors were encountered: