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

Exception needed in encoder.total_len when all if conditions are False (requests_toolbelt) #295

Open
BookWorm0 opened this issue May 16, 2020 · 0 comments

Comments

@BookWorm0
Copy link

If I attempt to upload using a fileobj which does not contain one of the attributes which provide its length, total_len() returns None. This then leads to an exception being raised with the confusing message, “TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'” (encoder.py, line 488, in init).

It would be helpful if total_len() raised an exception which identified the problem as a fileobj which could not provide the package its content length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant