Skip to content
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

Infinite loop when uploading zero-length files #152

Closed
Tauwasser opened this issue Nov 8, 2016 · 2 comments
Closed

Infinite loop when uploading zero-length files #152

Tauwasser opened this issue Nov 8, 2016 · 2 comments
Assignees
Labels

Comments

@Tauwasser
Copy link

@Tauwasser Tauwasser commented Nov 8, 2016

When uploading zero-length files when creating issues or updating them, python just hangs and seemingly does nothing anymore. Apparently this has to do with the fact that the file is opened as a stream and the underlying code in packages/requests will now try to send in chunks, but I know too little python to identify the respective line of code.

Example code:

redmine.issue.create(project_id=project.id, subject='Upload Test', tracker_id=1, description='Test uploading zero-length file', status_id=3, priority_id=7,uploads=[{'path': '/path/to/empty.file'}])

@maxtepkeev maxtepkeev added the bug label Nov 9, 2016
@maxtepkeev maxtepkeev self-assigned this Nov 9, 2016
@maxtepkeev
Copy link
Owner

@maxtepkeev maxtepkeev commented Nov 9, 2016

Hi, ok, I'll look into it, meanwhile you can just add a check in your code for the zero-length files.

maxtepkeev added a commit that referenced this issue Nov 12, 2016
@maxtepkeev
Copy link
Owner

@maxtepkeev maxtepkeev commented Nov 12, 2016

This is a bug in requests, see psf/requests#3066. I've tried the current master branch of requests and it works fine now, i.e. raises ValidationError: 1 file(s) could not be saved.

I've also added a size check in python-redmine which will be a part of the next release. (See 71cb6e5)

Thanks for the bug report.

@maxtepkeev maxtepkeev closed this Nov 12, 2016
maxtepkeev added a commit that referenced this issue Nov 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants