folz / cleverbot.py

ARCHIVED - Use https://github.com/edwardslabs/cleverwrap.py instead.
BSD 2-Clause "Simplified" License
77 stars 41 forks source link

python 3 modules and unicode encoding hashing #17

Closed cxlai closed 8 years ago

cxlai commented 8 years ago

Had some trouble getting this to work (and am still having trouble). Since Python 3 has changed some of its modules, namely http.cookiejar, urllib2, urllib.parse... the init in cleverbot.py causes errors during import. I also got a Unicode-object must be encoded before hashing error that I'm trying to fix.

I don't know much about Python so I'm really have some trouble. Any tips on how to fix the unicode error?

ghost commented 8 years ago

Use Python 2. Nobody likes Python 3 anyway.

folz commented 8 years ago

...I like python 3 On Dec 6, 2015 3:08 AM, "Norwack" notifications@github.com wrote:

Use Python 2. Nobody likes Python 3 anyway.

— Reply to this email directly or view it on GitHub https://github.com/folz/cleverbot.py/issues/17#issuecomment-162303857.

folz commented 8 years ago

I don't do too much with this library anymore but I've always wanted to learn six, so I'll take a look at adding py2&3 compatibility over the weekend. On Dec 6, 2015 3:10 AM, "Rodney Folz" rodney@rodneyfolz.com wrote:

...I like python 3 On Dec 6, 2015 3:08 AM, "Norwack" notifications@github.com wrote:

Use Python 2. Nobody likes Python 3 anyway.

— Reply to this email directly or view it on GitHub https://github.com/folz/cleverbot.py/issues/17#issuecomment-162303857.

JohnPhamous commented 8 years ago

Has this been updated to py3?

Delivator commented 8 years ago

I don't think so :/

folz commented 8 years ago

Thanks for the comment - I got inspired and worked on some py2/py3 compatibility stuff this weekend. I'll push to a branch soon(tm). If this is something you want, comment in the thread so you get notified / give me motivation.

JohnPhamous commented 8 years ago

Yes! If you need help I can give it a shot too.

folz commented 8 years ago

Hi - please check out #19 and see if it works for you under python 2 and 3.

folz commented 8 years ago

(also @cxlai - give http://stackoverflow.com/questions/7585307/typeerror-unicode-objects-must-be-encoded-before-hashing a read)

Delivator commented 8 years ago

Umlauts don't work correctly! Instead of "ß" i get "ß" the html code i think!

But everything else works perfect for now! (Pyhton3)

folz commented 8 years ago

(oops, fat-fingered the close button)

@Delivator - Does that behavior happen on the version that's currently on pypi (aka, before my py3 changes)?

Delivator commented 8 years ago

Idk and i don't want to install python2 just for tesing :/

folz commented 8 years ago

For sure, I'll check it out on my end.

folz commented 8 years ago

Fixed with #19. Thanks for opening the issue!