UnicodeDecodeError
See original GitHub issueI have encountered the following error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 1: invalid start byte
thrown on line 236 of torrent_parser.py
Your tests might not have encountered this due to a small sample size, since I use your library to processes a thousands of torrents in an hour. Thats how I found it.
I have temporarily fixed this by adding the ignore flag on the byte string decode function like so.
string = raw.decode(encoding, "ignore")
It would be lovely if you could add this to the upstream directory.
A test file I used is attached: auratorrent.torrent.zip
The PR request is #5
This is covered here: https://docs.python.org/3/howto/unicode.html
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
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 >How to fix: "UnicodeDecodeError: 'ascii' codec can't decode ...
UnicodeDecodeError : 'ascii' codec can't decode byte generally happens when you try to convert a Python 2.x str that contains non-ASCII to a ......
Read more >UnicodeDecodeError utf-8 codec can t decode byte in position ...
While I importing the file it shows UnicodeDecodeError: "utf-8" codec can"t decode byte 0xa0 in position ... as pd a ...
Read more >How to resolve a UnicodeDecodeError for a CSV file - Kaggle
_string_box_utf8() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 1: invalid continuation byte During handling of the above exception, ...
Read more >'charmap' codec can't decode byte 0x81 in position X ... - GitHub
UnicodeDecodeError : 'charmap' codec can't decode byte 0x81 in position X: character maps to <undefined> #770. Closed. guilhermeferrari opened this issue on Apr ......
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 Free
Top 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
v0.3.0 just released.
In this version, there are many way to deal with this problem:
the output:
the
hash_field("info_hash")
is added to the class:Thanks for your idea.
I will finish the customize hash fields API tomorrow and release a new version.
Due to the break change and so may thing be added, It will be 0.3.0.
(And yes, in 0.x.x break change don’t need add the major version… I’m still considering when to reach the 1.0 ⌛)