UnicodeDecodeError while fetching items
See original GitHub issueIt seems like I randomly get errors like this:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xde in position 174: invalid continuation byte
at msgpack._cmsgpack.Unpacker._unpack (_unpacker.pyx:443)
at msgpack._cmsgpack.Unpacker.__next__ (_unpacker.pyx:518)
at mpdecode (/usr/local/lib/python3.7/site-packages/scrapinghub/hubstorage/serialization.py:33)
at iter (/usr/local/lib/python3.7/site-packages/scrapinghub/client/proxy.py:115)
This happens while iterating the items through last_job.items.iter()
It seems to happen about 50% of the time from what I see. I scrape the same website every day and run that function and sometimes it works fine, sometimes raise that error. I am not sure if this is an issue with this library or with the ScrapingHub API though but it is very problematic.
This happens on the latest (2.3.1) version
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why am I getting UnicodeDecodeError here? - python
You are trying to read a file that is not encoded in the default platform encoding ( cp1253 ). By opening the file...
Read more >UnicodeDecodeError utf-8 codec can t decode byte 0xba in ...
Hi Guys, I am trying to read one CSV file in my jupyter notebook using pandas, but it shows me ... error. How...
Read more >UnicodeDecodeError when attempting to access a cursor's ...
If you print out the value of connection.encoding in the failing situation that can be confirmed. One other thought: are you fetching data...
Read more >UnicodeDecodeError - Python Wiki
The UnicodeDecodeError normally happens when decoding an str string from a certain coding. Since codings map only a limited number of str ...
Read more >UnicodeDecodeError in for loop - GIS Stack Exchange
I am getting a unicode error while using a combination of an UpdateCursor and csv reader . I'm trying to fix field values...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It does seem like it fixed the issue, thank you for the help.
This might be worth mentioning in the documentation somewhere though because the error doesn’t make it easy to understand the problem.
Thank you I will try that solution and close this issue if it fixes it. It might take a few days though as the error doesn’t happen every day as I mentioned.