Giter VIP home page Giter VIP logo

Comments (6)

rodneykeeling avatar rodneykeeling commented on August 15, 2024

Hi @tchakravarty,

I haven't seen this issue before. I use IPython quite a lot myself and haven't seen this. Are you using an IPython shell (i.e., ipython -i) or IPython Notebook? My suggestion would be to put a break point (import ipdb; ipdb.set_trace()) before the line output = repr(obj) and inspect the obj variable. That appears to be the wrong type, so perhaps inspecting it a bit could provide some clues.

Let me know if you find anything.

Thanks,
Rodney

from discogs_client.

tchakravarty avatar tchakravarty commented on August 15, 2024

Hi @rodneykeeling, I am using the IPython console from within PyCharm. But please note that Martijn Pieters is claiming that this is a bug over on SO, and he is not often wrong... :-)

from discogs_client.

rodneykeeling avatar rodneykeeling commented on August 15, 2024

Ah, I see. I am still primarily using Python 2.7.9.

I added those .encode('utf-8') bits in there because some characters in Python 2 were having encoding issues. I'll see if I can find a nice middleground to get both Python 2 & 3 working.

Thanks,
Rodney

from discogs_client.

takluyver avatar takluyver commented on August 15, 2024

Not very elegant, but something like this should work:

r = ... # create something with unicode
if sys.version_info[0] < 3:
    return r.encode('utf-8')
return r

UTF-8 will not always be the right encoding, especially on Windows, but if it's mostly ascii characters you can get away with it.

from discogs_client.

rodneykeeling avatar rodneykeeling commented on August 15, 2024

@takluyver Yeah, creating a method that does that in one of the parent classes seems like the least intrusive option since there are so many __repr__() methods.

from discogs_client.

rodneykeeling avatar rodneykeeling commented on August 15, 2024

Got a PR up here #56. Would love it if someone could test it. I tried it using Python 2.7.9 and 3.4.0 and it seems to work fine.

from discogs_client.

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.