Re: PyStemmer: " 'dict' object has no attribute 'iteritems'" on Python 3
Marc Abramowitz <[email protected]> Fri, 22 Feb 2013 05:27:08 +0000
| Newsgroups | gmane.comp.search.snowball |
|---|---|
| Message-ID | <E5CD626161E81C4DBB58B3E7F649BEA213747C@DAGN04b-e6.exg6.exghost.com> |
After messing around with this a bit, I think that my patch is probably not necessary. I discovered that the code works as-is if I build it myself. It only fails if I pip install PyStemmer. Based on this, I suspect that the problem is the version of Cython used to build the sdist. Cython 0.11 was used to generate the sdist on PyPI and I have a feeling that this version doesn't know how to generate the appropriate C code needed to translate "iteritems" for Python 3. When I build PyStemmer from source, I'm using Cython 0.17 and this version of Cython probably does the correct translation for Python 3. This is my theory at least. I was hoping to test the theory by installing Cython 0.11 on my Mac, but I've run into problems with building it. I think all that might be necessary is to generate a new sdist for PyPI using a newer version of Cython. From: Marc Abramowitz <[email protected]<mailto:[email protected]>> Date: Thursday, February 21, 2013 12:51 PM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: Re: [Snowball-discuss] PyStemmer: " 'dict' object has no attribute 'iteritems'" on Python 3 An update to my previous message. I figured out how to do the build. I had to manually download http://snowball.tartarus.org/dist/libstemmer_c.tgz and untar it in the pystemmer directory. That made `python setup.py build`, etc. work. So then I came up with a patch to fix the "iteritems" issue in __purgeCache on Python 3. Here it is: https://gist.github.com/msabramo/5008065 I hope that is useful. Thanks for creating and sharing PyStemmer! Cheers, Marc http://marc-abramowitz.com/ _______________________________________________ Snowball-discuss mailing list [email protected] http://lists.tartarus.org/mailman/listinfo/snowball-discuss