-
Notifications
You must be signed in to change notification settings - Fork 875
Not python3 compliant #80
Comments
@ashneo76 Our tests seem to run just fine on Python 3.x in travis. Mind writing a testcase for me tthat showcases this issue? |
In [1]: from fuzzywuzzy import fuzz
In [2]: fuzz.ratio('24','3434')
Out[2]: 33
In [3]: fuzz.ratio(24,'3434')
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-7195477da1e5> in <module>()
----> 1 fuzz.ratio(24,'3434')
/usr/lib/python3.4/site-packages/fuzzywuzzy/fuzz.py in ratio(s1, s2)
47 if s2 is None:
48 raise TypeError("s2 is None")
---> 49 s1, s2 = utils.make_type_consistent(s1, s2)
50
51 if len(s1) == 0 or len(s2) == 0:
/usr/lib/python3.4/site-packages/fuzzywuzzy/utils.py in make_type_consistent(s1, s2)
41 return s1, s2
42
---> 43 elif isinstance(s1, unicode) and isinstance(s2, unicode):
44 return s1, s2
45
NameError: name 'unicode' is not defined I guess I should convert my 'int's to strings before passing them in. |
@josegonzalez yeah that's a derp. I bet we don't have a test case that hits that path. |
@acslater00 Whats the fix in this case? I'm guessing we should have a specific test for |
Not really, i'd have to think about it. The method doesn't really make On Wed, Feb 25, 2015 at 12:37 PM, Jose Diaz-Gonzalez <
|
Patched by defining unicode variable as a string object. Hackish but is working for me. Full python 3 compatibility should be something to have these days though. |
I'm getting the same error. even though i have the latest version of the package installed. Any help? |
I haven't had time to make a release yet, but I'll be working on that this weekend. Will update this issue when its up. Apologies. |
@NabeelahB did you try uninstalling and then installing using pip directly from the github repo? >> pip uninstall fuzzywuzzy
>> pip install git+https://github.com/seatgeek/fuzzywuzzy |
This worked!
|
I notice there was a release recently. I guess this issue can be closed? |
I get the following error:
The text was updated successfully, but these errors were encountered: