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

Fixing compatibility with python3 - #28

Open
UnknownProgrammer wants to merge 2 commits into
LightTable:masterfrom
UnknownProgrammer:master
Open

Fixing compatibility with python3#28
UnknownProgrammer wants to merge 2 commits into
LightTable:masterfrom
UnknownProgrammer:master

Conversation

@UnknownProgrammer

Copy link
Copy Markdown

Added try-except because python3 has no unicode class.

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

hayd commented Jun 28, 2015

Copy link
Copy Markdown

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

@kenny-evitt

Copy link
Copy Markdown

This seems to be related to #24.

@UnknownProgrammer – how 'bout this:

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

hayd commented Jun 28, 2015

Copy link
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown
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

3 participants