Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Fixing compatibility with python3 #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

UnknownProgrammer
Copy link

Added try-except because python3 has no unicode class.

Added try-except because python3 has no unicode class.
@hayd
Copy link

hayd commented Jun 28, 2015

This could probably just be in a try-except block (i.e. not mention unicode).

@kenny-evitt
Copy link

This seems to be related to #24.

@UnknownProgrammer – how 'bout this:

  try:
    return s.encode('utf8', 'ignore')
  except:
    return str(s)

@hayd
Copy link

hayd commented Jun 28, 2015

@kenny-evitt I think that encode is actually incorrect here. it should decode, otherwise if you pass bytes it becomes u"b'string'" which I don't think is not what you want?

@kenny-evitt
Copy link

@hayd I have no idea what that code does; I just know that it currently calls encode so I'm at least a little skeptical that it should be changed to a call that seemingly does the opposite of what it does now. I created a thread in the forum asking for help reviewing your changes.

@UnknownProgrammer
Copy link
Author

@kenny-evitt That's nicer, I just wanted it to work with python 3 without removing someone's work.
I posted my opinion on #30

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants