Royal-Society-of-New-Zealand / NZ-ORCID-Hub

The home of development for the New Zealand ORCID Hub
MIT License
13 stars 8 forks source link

UnicodeDecodeError with orcid_proxy #1280

Closed Jason-Gush closed 3 years ago

Jason-Gush commented 3 years ago

e.g., NZ-ORCID-HUB-235

seems to be

        for chunk in resp.raw.stream(decode_content=False):
            call.response += chunk.decode()
            yield chunk

failing because the chunk isn't reliably complete characters causing unicode decode fails at beginning or end when it hits a half. ?

should it be call.response += chunk call.response = call.response.decode() ??

Jason-Gush commented 3 years ago

Or is it that the message was too big? Full size was 721KB and this particular work had ~3000 contributors

nad2000 commented 3 years ago

fixed