diff options
| author | Cory Benfield <lukasaoz@gmail.com> | 2013-08-03 19:24:23 +0100 |
|---|---|---|
| committer | Cory Benfield <lukasaoz@gmail.com> | 2013-08-03 19:24:23 +0100 |
| commit | a5e5a51fb4e7202910172624bcc732700422a738 (patch) | |
| tree | 38a47381d6f1fdeaa23d99f905fb6ea6e6009610 /requests | |
| parent | a05aba10330e73bc8fcc8af08dc8508668e1e0ee (diff) | |
| download | python-requests-a5e5a51fb4e7202910172624bcc732700422a738.tar.gz | |
Catch UnsupportedOperation.
Diffstat (limited to 'requests')
| -rw-r--r-- | requests/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/requests/models.py b/requests/models.py index ee9c329b..6b4a2994 100644 --- a/requests/models.py +++ b/requests/models.py @@ -11,7 +11,7 @@ import collections import logging import datetime -from io import BytesIO +from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict @@ -385,7 +385,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): try: length = super_len(data) - except (TypeError, AttributeError): + except (TypeError, AttributeError, UnsupportedOperation): length = None if is_stream: |
