New submission from Shashwat Anand <anand.shash...@gmail.com>: I am able to call DictionaryServices module from python2.5 and later. However it works correctly only on python2.5. Below is the stack-trace on using DictionaryServices on python2.5, python2.6 and python2.7
Shashwat-Anands-MacBook-Pro:PyObjCTest l0nwlf$ python2.5 Python 2.5.4 (r254:67916, Jul 7 2009, 23:51:24) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DictionaryServices >>> word = "lone wolf" >>> DictionaryServices.DCSCopyTextDefinition(None, word, (0, len(word))) u'noun \na person who prefers to act or be alone. \n' >>> Shashwat-Anands-MacBook-Pro:Desktop l0nwlf$ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DictionaryServices >>> word = "lone wolf" >>> DictionaryServices.DCSCopyTextDefinition(None, word, (0, len(word))) Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: NSRangeException - *** -[OC_PythonString _createSubstringWithRange:]: Range or index out of bounds >>> Shashwat-Anands-MacBook-Pro:Desktop l0nwlf$ python2.7 Python 2.7a4+ (trunk:78750, Mar 7 2010, 08:09:00) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import DictionaryServices Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named DictionaryServices ---------- assignee: ronaldoussoren components: Macintosh messages: 101216 nosy: l0nwlf, ronaldoussoren severity: normal status: open title: DictionaryServices module broken in python2.6 and later type: behavior versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8163> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com