Coder Social home page Coder Social logo

Comments (6)

nekitdev avatar nekitdev commented on July 30, 2024

Point is, ignoring unknown bytes gives garbage to the programmers using the library (and consequently to their projects). I think we need to figure out the best way to handle encoding/decoding issues before applying changes.

from gd.py.

QuasiStellar avatar QuasiStellar commented on July 30, 2024

gives garbage to the programmers

Isn't it better than not giving anything and crashing with an error instead?

from gd.py.

nekitdev avatar nekitdev commented on July 30, 2024

I said we need to find the best way — the proposed solution is merely better.

from gd.py.

QuasiStellar avatar QuasiStellar commented on July 30, 2024

Well, I wasted multiple hours investigating this crash and then rerunning the code that depends on it. None of this would happen if the error-handling strategy was set to "replace" or "ignore" (which GD itself is using) from the start. The problem affects 1 very old level out of 38 000 rated ones and I really don't care if its description contains � instead of a non-breaking space that was supposed to be there for whatever reason. I do care when the libraries I use break down for such minor reasons though.

from gd.py.

QuasiStellar avatar QuasiStellar commented on July 30, 2024

In general I think that methods such as search_levels should never throw if they can get at least some valid info. If something is not right (such as in this case), a warning can be printed.

from gd.py.

nekitdev avatar nekitdev commented on July 30, 2024

You can now handle this via setting GD_ENCODING_ERRORS environment variable.

from gd.py.

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.