Giter VIP home page Giter VIP logo

Comments (3)

johnwmillr avatar johnwmillr commented on August 12, 2024

Thanks for pointing this out! Are you using Python 2 or 3? The solution you've suggested works well for me for Python 3 but throws a UnicodeEncodeError in Python 2. From my understanding, Python 3 does a much better job of handling Unicode text than Python 2.

My .encode('ascii','ignore').decode('ascii') line is basically a kludge to try and deal with these UnicodeEncodeError errors; I hadn't encountered this issue for a while, but here's proof that my solution is inadequate.

Do you want to put together a pull request addressing this issue? I'd be happy to merge your changes if you're able to solve the issue for both Python 2 and 3. Otherwise I'll try to get to the issue once I have time.

John

EDIT: I see your PR now.

from lyricsgenius.

DiSonDS avatar DiSonDS commented on August 12, 2024

@johnwmillr I'm using Python 3 and I did not even think about Python 2. Hmm...

from lyricsgenius.

johnwmillr avatar johnwmillr commented on August 12, 2024

Right, your solution is good for Python 3, but 2 is a pain... Maybe I need to think about whether it's worth supporting 2 much longer. It may make sense to allow Python 2 to just throw an error on the UnicodeEncodeError and let the Python 2 user deal with it as they like (as I mentioned in my comment on your PR).

from lyricsgenius.

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.