[issue8163] DictionaryServices module broken in python2.6 and later

Shashwat Anand report at bugs.python.org
Wed Mar 17 11:22:49 CET 2010


New submission from Shashwat Anand <anand.shashwat at 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 <report at bugs.python.org>
<http://bugs.python.org/issue8163>
_______________________________________


More information about the Python-bugs-list mailing list