Giter VIP home page Giter VIP logo

Comments (5)

rndusr avatar rndusr commented on May 30, 2024 1

I think I've fixed both issues in 4.2.0.

I hope this works better for you.

from torf.

Kiwi-Torrent-Research avatar Kiwi-Torrent-Research commented on May 30, 2024

I come across this issue when reading torrent files from this dataset. I loaded some of the torrent files that fail verification with a torrent client and they load and download fine.

I also get "Invalid metainfo: ['info']['name'] must be str, not bytes" when the name (or a filename) contain a non ascii character.
I think this is caused by the bdecoder returning bytes if the string contains a non ascii character.

Looking forward to your thoughts on these issues.

from torf.

rndusr avatar rndusr commented on May 30, 2024

from torf.

Kiwi-Torrent-Research avatar Kiwi-Torrent-Research commented on May 30, 2024

Returning strings as two different types wouldn't be very friendly although it would fix the problem.

I don't think using chardet would be a good idea either because of what you've mentioned.

One solution would be to not decode strings, leaving them as bytes. Users would have to decode the strings themself and dict keys would also be in bytes. A bit of a major change to the library. This seems to be the best option for compatibility. Or just a 'bytes mode' where strings aren't decoded.

Another solution would be to decode to utf-8 with errors being ignored or replaced. I've tested a few of the trouble torrents with libtorrent 2.0.7 in Python and libtorrent appears to replace non-utf_8 characters with an underscore.

from torf.

rndusr avatar rndusr commented on May 30, 2024

from torf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.